diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10a7f3da6c..51f13739d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,7 @@ jobs: - uses: actions/checkout@v3 - uses: software-mansion/setup-scarb@v1 with: - scarb-version: "2.6.3" + scarb-version: "2.7.0-rc.3" - run: | scarb --manifest-path examples/spawn-and-move/Scarb.toml fmt --check scarb --manifest-path crates/dojo-core/Scarb.toml fmt --check diff --git a/.tool-versions b/.tool-versions index e1290964bb..6f986cedae 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -scarb 2.6.4 +scarb 2.7.0-rc.3 diff --git a/crates/benches/contracts/src/tests/test_world.cairo b/crates/benches/contracts/src/tests/test_world.cairo index 74dfd8023e..2134437f63 100644 --- a/crates/benches/contracts/src/tests/test_world.cairo +++ b/crates/benches/contracts/src/tests/test_world.cairo @@ -6,7 +6,7 @@ mod tests { use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; // import test utils - use dojo::test_utils::{spawn_test_world, deploy_contract}; + use dojo::utils::test::{spawn_test_world, deploy_contract}; // import test utils use dojo_starter::{ diff --git a/crates/dojo-bindgen/src/lib.rs b/crates/dojo-bindgen/src/lib.rs index 07b8fdede1..6a72cca156 100644 --- a/crates/dojo-bindgen/src/lib.rs +++ b/crates/dojo-bindgen/src/lib.rs @@ -141,7 +141,7 @@ fn gather_dojo_data( // interfaces. let mut systems = vec![]; let interface_blacklist = - ["dojo::world::IWorldProvider", "dojo::components::upgradeable::IUpgradeable"]; + ["dojo::world::IWorldProvider", "dojo::contract::upgradeable::IUpgradeable"]; for (interface, funcs) in &tokens.interfaces { if !interface_blacklist.contains(&interface.as_str()) { @@ -183,7 +183,7 @@ fn filter_model_tokens(tokens: &TokenizedAbi) -> TokenizedAbi { // All types from introspect module can also be removed as the clients does not rely on them. // Events are also always empty at model contract level. fn skip_token(token: &Token) -> bool { - if token.type_path().starts_with("dojo::database::introspect") { + if token.type_path().starts_with("dojo::model::introspect") { return true; } diff --git a/crates/dojo-core/Scarb.lock b/crates/dojo-core/Scarb.lock index 7465e5b535..ecaaf70855 100644 --- a/crates/dojo-core/Scarb.lock +++ b/crates/dojo-core/Scarb.lock @@ -11,4 +11,4 @@ dependencies = [ [[package]] name = "dojo_plugin" version = "0.7.3" -source = "git+https://github.com/dojoengine/dojo?branch=bump-cairo-2.7#17bc842f2f87b6ac0472d196efc11f01a5e55add" +source = "git+https://github.com/dojoengine/dojo?rev=d90b52b#d90b52b89749ac8af82f352dc08aa0b1378cfae6" diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index 5cf61dbe36..8f45ab937f 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -1,6 +1,6 @@ [package] cairo-version = "2.7.0-rc.3" -edition = "2023_11" +edition = "2024_07" description = "The Dojo Core library for autonomous worlds." name = "dojo" version = "0.7.3" diff --git a/crates/dojo-core/src/components.cairo b/crates/dojo-core/src/components.cairo deleted file mode 100644 index 06a50c8591..0000000000 --- a/crates/dojo-core/src/components.cairo +++ /dev/null @@ -1 +0,0 @@ -pub mod upgradeable; diff --git a/crates/dojo-core/src/config.cairo b/crates/dojo-core/src/config.cairo deleted file mode 100644 index fee8901c6f..0000000000 --- a/crates/dojo-core/src/config.cairo +++ /dev/null @@ -1,2 +0,0 @@ -pub mod component; -pub mod interface; diff --git a/crates/dojo-core/src/config/interface.cairo b/crates/dojo-core/src/config/interface.cairo deleted file mode 100644 index cd272229de..0000000000 --- a/crates/dojo-core/src/config/interface.cairo +++ /dev/null @@ -1,39 +0,0 @@ -use starknet::ContractAddress; - -#[starknet::interface] -pub trait IConfig { - /// Sets the information of the program that generates the - /// state transition trace (namely DojoOS). - /// - /// # Arguments - /// - /// * `program_hash` - The program hash. - /// * `config_hash` - The program's config hash. - 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). - /// - /// # Returns - /// - /// The program hash and it's configuration hash. - 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. - /// - /// # Arguments - /// - /// * `address` - The facts registry contract's address. - fn set_facts_registry(ref self: T, address: ContractAddress); - - /// Gets the facts registry contract address. - /// - /// # Returns - /// - /// The contract address of the facts registry. - fn get_facts_registry(self: @T) -> ContractAddress; -} - diff --git a/crates/dojo-core/src/base.cairo b/crates/dojo-core/src/contract/base_contract.cairo similarity index 75% rename from crates/dojo-core/src/base.cairo rename to crates/dojo-core/src/contract/base_contract.cairo index 8231407583..d00a69a224 100644 --- a/crates/dojo-core/src/base.cairo +++ b/crates/dojo-core/src/contract/base_contract.cairo @@ -1,12 +1,10 @@ -use dojo::world::IWorldDispatcher; - #[starknet::contract] pub mod base { - use starknet::{ClassHash, get_caller_address}; - use dojo::world::IWorldDispatcher; - use dojo::world::IWorldProvider; + use starknet::{ClassHash, ContractAddress, get_caller_address}; + use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess}; - use dojo::components::upgradeable::upgradeable as upgradeable_component; + use dojo::contract::upgradeable::upgradeable as upgradeable_component; + use dojo::world::{IWorldProvider, IWorldDispatcher, IWorldDispatcherTrait}; component!(path: upgradeable_component, storage: upgradeable, event: UpgradeableEvent); diff --git a/crates/dojo-core/src/contract.cairo b/crates/dojo-core/src/contract/contract.cairo similarity index 100% rename from crates/dojo-core/src/contract.cairo rename to crates/dojo-core/src/contract/contract.cairo diff --git a/crates/dojo-core/src/components/upgradeable.cairo b/crates/dojo-core/src/contract/upgradeable.cairo similarity index 94% rename from crates/dojo-core/src/components/upgradeable.cairo rename to crates/dojo-core/src/contract/upgradeable.cairo index 5c4380eb88..818260b761 100644 --- a/crates/dojo-core/src/components/upgradeable.cairo +++ b/crates/dojo-core/src/contract/upgradeable.cairo @@ -7,16 +7,16 @@ pub trait IUpgradeable { #[starknet::component] pub mod upgradeable { + use core::num::traits::Zero; use core::starknet::SyscallResultTrait; - use starknet::ClassHash; - use starknet::ContractAddress; - use starknet::get_caller_address; + + use starknet::{ClassHash, ContractAddress, get_caller_address}; use starknet::syscalls::replace_class_syscall; + use dojo::world::{IWorldProvider, IWorldProviderDispatcher, IWorldDispatcher}; - use core::num::traits::Zero; #[storage] - struct Storage {} + pub struct Storage {} #[event] #[derive(Drop, starknet::Event)] diff --git a/crates/dojo-core/src/database/utils.cairo b/crates/dojo-core/src/database/utils.cairo deleted file mode 100644 index 89f533effd..0000000000 --- a/crates/dojo-core/src/database/utils.cairo +++ /dev/null @@ -1,29 +0,0 @@ -pub fn any_none(arr: @Array>) -> bool { - let mut i = 0; - let mut res = false; - loop { - if i >= arr.len() { - break; - } - - if arr.at(i).is_none() { - res = true; - break; - } - i += 1; - }; - res -} - -pub fn sum(arr: Array>) -> u32 { - let mut i = 0; - let mut res = 0; - - loop { - if i >= arr.len() { - break res; - } - res += (*arr.at(i)).unwrap(); - i += 1; - } -} diff --git a/crates/dojo-core/src/lib.cairo b/crates/dojo-core/src/lib.cairo index 662cdadff4..c3edf62d4f 100644 --- a/crates/dojo-core/src/lib.cairo +++ b/crates/dojo-core/src/lib.cairo @@ -1,39 +1,81 @@ -pub mod base; -#[cfg(test)] -mod base_test; -pub mod config; -pub mod database; -#[cfg(test)] -mod database_test; -pub mod interfaces; -pub mod model; -#[cfg(test)] -mod model_test; -pub mod contract; -pub mod packing; -#[cfg(test)] -mod packing_test; -pub mod world; -#[cfg(test)] -mod world_test; -pub 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. -// -// 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")] -pub mod test_utils; +pub mod contract { + mod base_contract; + pub use base_contract::base; + pub mod contract; + pub use contract::{IContract, IContractDispatcher, IContractDispatcherTrait}; + pub mod upgradeable; +} -#[cfg(test)] -mod benchmarks; +pub mod model { + pub mod introspect; + pub mod layout; + pub use layout::{Layout, FieldLayout}; + + pub mod model; + pub use model::{ + Model, ModelIndex, ModelEntity, IModel, IModelDispatcher, IModelDispatcherTrait, + deploy_and_get_metadata + }; -pub mod components; -pub mod resource_metadata; + pub mod metadata; + pub use metadata::{ResourceMetadata, ResourceMetadataTrait, resource_metadata}; + pub(crate) use metadata::{initial_address, initial_class_hash}; +} + +pub(crate) mod storage { + pub(crate) mod database; + pub(crate) mod packing; + pub(crate) mod layout; + pub(crate) mod storage; +} + +pub mod utils { + // 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")] + pub mod test; + + pub mod utils; + pub use utils::{ + bytearray_hash, entity_id_from_keys, find_field_layout, find_model_field_layout, any_none, + sum, combine_key + }; +} + +pub mod world { + pub(crate) mod update; + pub(crate) mod config; + + mod world_contract; + pub use world_contract::{ + world, IWorld, IWorldDispatcher, IWorldDispatcherTrait, IWorldProvider, + IWorldProviderDispatcher, IWorldProviderDispatcherTrait + }; + pub(crate) use world_contract::{ + IUpgradeableWorld, IUpgradeableWorldDispatcher, IUpgradeableWorldDispatcherTrait + }; +} + +#[cfg(test)] +mod tests { + mod model { + mod introspect; + mod model; + } + mod storage { + mod database; + mod packing; + mod storage; + } + mod base; + mod benchmarks; + mod world; + mod utils; +} diff --git a/crates/dojo-core/src/database/introspect.cairo b/crates/dojo-core/src/model/introspect.cairo similarity index 87% rename from crates/dojo-core/src/database/introspect.cairo rename to crates/dojo-core/src/model/introspect.cairo index 96395f5573..e65e114116 100644 --- a/crates/dojo-core/src/database/introspect.cairo +++ b/crates/dojo-core/src/model/introspect.cairo @@ -1,24 +1,4 @@ -#[derive(Copy, Drop, Serde, Debug, PartialEq)] -pub struct FieldLayout { - pub selector: felt252, - pub layout: Layout -} - -#[derive(Copy, Drop, Serde, Debug, PartialEq)] -pub enum Layout { - Fixed: Span, - Struct: Span, - Tuple: Span, - // We can't have `Layout` here as it will cause infinite recursion. - // And `Box` is not serializable. So using a Span, even if it's to have - // one element, does the trick. - Array: Span, - ByteArray, - // there is one layout per variant. - // the `selector` field identifies the variant - // the `layout` defines the variant data (could be empty for variant without data). - Enum: Span, -} +use dojo::model::{Layout, FieldLayout}; #[derive(Copy, Drop, Serde)] pub enum Ty { @@ -260,10 +240,11 @@ pub impl Introspect_option> of Introspect> { fn layout() -> Layout { Layout::Enum( array![ - FieldLayout { // Some + dojo::model::FieldLayout { // Some selector: 0, layout: Introspect::::layout() }, - FieldLayout { // None - selector: 1, layout: Layout::Fixed(array![].span()) }, + dojo::model::FieldLayout { // None + selector: 1, layout: Layout::Fixed(array![].span()) + }, ] .span() ) diff --git a/crates/dojo-core/src/model/layout.cairo b/crates/dojo-core/src/model/layout.cairo new file mode 100644 index 0000000000..69bd49c20d --- /dev/null +++ b/crates/dojo-core/src/model/layout.cairo @@ -0,0 +1,35 @@ +use dojo::storage::packing::calculate_packed_size; + +#[derive(Copy, Drop, Serde, Debug, PartialEq)] +pub struct FieldLayout { + pub selector: felt252, + pub layout: Layout +} + +#[derive(Copy, Drop, Serde, Debug, PartialEq)] +pub enum Layout { + Fixed: Span, + Struct: Span, + Tuple: Span, + // We can't have `Layout` here as it will cause infinite recursion. + // And `Box` is not serializable. So using a Span, even if it's to have + // one element, does the trick. + Array: Span, + ByteArray, + // there is one layout per variant. + // the `selector` field identifies the variant + // the `layout` defines the variant data (could be empty for variant without data). + Enum: Span, +} + +/// Compute the full size in bytes of a layout, when all the fields +/// are bit-packed. +/// Could be None if at least a field has a dynamic size. +pub fn compute_packed_size(layout: Layout) -> Option { + if let Layout::Fixed(layout) = layout { + let mut span_layout = layout; + Option::Some(calculate_packed_size(ref span_layout)) + } else { + Option::None + } +} diff --git a/crates/dojo-core/src/resource_metadata.cairo b/crates/dojo-core/src/model/metadata.cairo similarity index 63% rename from crates/dojo-core/src/resource_metadata.cairo rename to crates/dojo-core/src/model/metadata.cairo index 7f891c2a15..8749608207 100644 --- a/crates/dojo-core/src/resource_metadata.cairo +++ b/crates/dojo-core/src/model/metadata.cairo @@ -3,9 +3,15 @@ //! Manually expand to ensure that dojo-core //! does not depend on dojo plugin to be built. //! -use dojo::world::{IWorldDispatcherTrait, ModelIndex}; -use dojo::model::Model; +use core::array::ArrayTrait; +use core::byte_array::ByteArray; +use core::poseidon::poseidon_hash_span; +use core::serde::Serde; + +use dojo::model::introspect::{Introspect, Ty, Struct, Member}; +use dojo::model::{Model, ModelIndex, Layout, FieldLayout}; use dojo::utils; +use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; pub fn initial_address() -> starknet::ContractAddress { starknet::contract_address_const::<0>() @@ -27,7 +33,7 @@ pub struct ResourceMetadata { #[generate_trait] pub impl ResourceMetadataImpl of ResourceMetadataTrait { fn from_values(resource_id: felt252, ref values: Span) -> ResourceMetadata { - let metadata_uri = core::serde::Serde::::deserialize(ref values); + let metadata_uri = Serde::::deserialize(ref values); if metadata_uri.is_none() { panic!("Model `ResourceMetadata`: metadata_uri deserialization failed."); } @@ -36,8 +42,8 @@ pub impl ResourceMetadataImpl of ResourceMetadataTrait { } } -pub impl ResourceMetadataModel of dojo::model::Model { - fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> ResourceMetadata { +pub impl ResourceMetadataModel of Model { + fn get(world: IWorldDispatcher, keys: Span) -> ResourceMetadata { if keys.len() != 1 { panic!("Model `ResourceMetadata`: bad keys length."); }; @@ -46,18 +52,18 @@ pub impl ResourceMetadataModel of dojo::model::Model { ResourceMetadataTrait::from_values(*keys.at(0), ref values) } - fn set(self: @ResourceMetadata, world: dojo::world::IWorldDispatcher,) { - dojo::world::IWorldDispatcherTrait::set_entity( + fn set(self: @ResourceMetadata, world: IWorldDispatcher,) { + IWorldDispatcherTrait::set_entity( world, Self::selector(), ModelIndex::Keys(self.keys()), self.values(), Self::layout() ); } - fn delete(self: @ResourceMetadata, world: dojo::world::IWorldDispatcher,) { + fn delete(self: @ResourceMetadata, world: IWorldDispatcher,) { world.delete_entity(Self::selector(), ModelIndex::Keys(self.keys()), Self::layout()); } fn get_member( - world: dojo::world::IWorldDispatcher, keys: Span, member_id: felt252 + world: IWorldDispatcher, keys: Span, member_id: felt252 ) -> Span { match utils::find_model_field_layout(Self::layout(), member_id) { Option::Some(field_layout) => { @@ -72,10 +78,7 @@ pub impl ResourceMetadataModel of dojo::model::Model { } fn set_member( - self: @ResourceMetadata, - world: dojo::world::IWorldDispatcher, - member_id: felt252, - values: Span + self: @ResourceMetadata, world: IWorldDispatcher, member_id: felt252, values: Span ) { match utils::find_model_field_layout(Self::layout(), member_id) { Option::Some(field_layout) => { @@ -111,7 +114,7 @@ pub impl ResourceMetadataModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - core::poseidon::poseidon_hash_span(array![Self::namespace_hash(), Self::name_hash()].span()) + poseidon_hash_span(array![Self::namespace_hash(), Self::name_hash()].span()) } #[inline(always)] @@ -120,39 +123,39 @@ pub impl ResourceMetadataModel of dojo::model::Model { } fn name_hash() -> felt252 { - utils::hash(@Self::name()) + utils::bytearray_hash(@Self::name()) } fn namespace_hash() -> felt252 { - utils::hash(@Self::namespace()) + utils::bytearray_hash(@Self::namespace()) } #[inline(always)] fn entity_id(self: @ResourceMetadata) -> felt252 { - core::poseidon::poseidon_hash_span(self.keys()) + poseidon_hash_span(self.keys()) } #[inline(always)] fn keys(self: @ResourceMetadata) -> Span { - let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.resource_id); - core::array::ArrayTrait::span(@serialized) + let mut serialized = ArrayTrait::new(); + ArrayTrait::append(ref serialized, *self.resource_id); + ArrayTrait::span(@serialized) } #[inline(always)] fn values(self: @ResourceMetadata) -> Span { - let mut serialized = core::array::ArrayTrait::new(); - core::serde::Serde::serialize(self.metadata_uri, ref serialized); - core::array::ArrayTrait::span(@serialized) + let mut serialized = ArrayTrait::new(); + Serde::serialize(self.metadata_uri, ref serialized); + ArrayTrait::span(@serialized) } #[inline(always)] - fn layout() -> dojo::database::introspect::Layout { - dojo::database::introspect::Introspect::::layout() + fn layout() -> Layout { + Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @ResourceMetadata) -> dojo::database::introspect::Layout { + fn instance_layout(self: @ResourceMetadata) -> Layout { Self::layout() } @@ -162,44 +165,33 @@ pub impl ResourceMetadataModel of dojo::model::Model { } } -pub impl ResourceMetadataIntrospect<> of dojo::database::introspect::Introspect< - ResourceMetadata<> -> { +pub impl ResourceMetadataIntrospect<> of Introspect> { #[inline(always)] fn size() -> Option { Option::None } #[inline(always)] - fn layout() -> dojo::database::introspect::Layout { - dojo::database::introspect::Layout::Struct( - array![ - dojo::database::introspect::FieldLayout { - selector: selector!("metadata_uri"), - layout: dojo::database::introspect::Layout::ByteArray - } - ] + fn layout() -> Layout { + Layout::Struct( + array![FieldLayout { selector: selector!("metadata_uri"), layout: Layout::ByteArray }] .span() ) } #[inline(always)] - fn ty() -> dojo::database::introspect::Ty { - dojo::database::introspect::Ty::Struct( - dojo::database::introspect::Struct { + fn ty() -> Ty { + Ty::Struct( + Struct { name: 'ResourceMetadata', attrs: array![].span(), children: array![ - dojo::database::introspect::Member { + Member { name: 'resource_id', - ty: dojo::database::introspect::Ty::Primitive('felt252'), + ty: Ty::Primitive('felt252'), attrs: array!['key'].span() }, - dojo::database::introspect::Member { - name: 'metadata_uri', - ty: dojo::database::introspect::Ty::ByteArray, - attrs: array![].span() - } + Member { name: 'metadata_uri', ty: Ty::ByteArray, attrs: array![].span() } ] .span() } @@ -212,6 +204,9 @@ pub mod resource_metadata { use super::ResourceMetadata; use super::ResourceMetadataModel; + use dojo::model::introspect::{Introspect, Ty}; + use dojo::model::Layout; + #[storage] struct Storage {} @@ -234,7 +229,7 @@ pub mod resource_metadata { #[external(v0)] fn unpacked_size(self: @ContractState) -> Option { - dojo::database::introspect::Introspect::::size() + Introspect::::size() } #[external(v0)] @@ -243,13 +238,13 @@ pub mod resource_metadata { } #[external(v0)] - fn layout(self: @ContractState) -> dojo::database::introspect::Layout { + fn layout(self: @ContractState) -> Layout { ResourceMetadataModel::layout() } #[external(v0)] - fn schema(self: @ContractState) -> dojo::database::introspect::Ty { - dojo::database::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> Ty { + Introspect::::ty() } #[external(v0)] diff --git a/crates/dojo-core/src/model.cairo b/crates/dojo-core/src/model/model.cairo similarity index 85% rename from crates/dojo-core/src/model.cairo rename to crates/dojo-core/src/model/model.cairo index 164eeffa1f..3854e1322f 100644 --- a/crates/dojo-core/src/model.cairo +++ b/crates/dojo-core/src/model/model.cairo @@ -1,18 +1,29 @@ -use dojo::world::{IWorldDispatcher, ModelIndex}; use starknet::SyscallResult; +use dojo::model::Layout; +use dojo::model::introspect::Ty; +use dojo::world::IWorldDispatcher; + +#[derive(Copy, Drop, Serde, Debug, PartialEq)] +pub enum ModelIndex { + Keys: Span, + Id: felt252, + // (entity_id, member_id) + MemberId: (felt252, felt252) +} + /// Trait that is implemented at Cairo level for each struct that is a model. pub trait ModelEntity { fn id(self: @T) -> felt252; fn values(self: @T) -> Span; - fn from_values(entity_id: felt252, values: Span) -> T; + fn from_values(entity_id: felt252, ref values: Span) -> T; fn get(world: IWorldDispatcher, entity_id: felt252) -> T; fn update(self: @T, world: IWorldDispatcher); fn delete(self: @T, world: IWorldDispatcher); fn get_member( world: IWorldDispatcher, entity_id: felt252, member_id: felt252, ) -> Span; - fn set_member(self: @T, world: IWorldDispatcher, member_id: felt252, values: Span,); + fn set_member(self: @T, world: IWorldDispatcher, member_id: felt252, values: Span); } pub trait Model { @@ -50,8 +61,8 @@ pub trait Model { fn entity_id(self: @T) -> felt252; fn keys(self: @T) -> Span; fn values(self: @T) -> Span; - fn layout() -> dojo::database::introspect::Layout; - fn instance_layout(self: @T) -> dojo::database::introspect::Layout; + fn layout() -> Layout; + fn instance_layout(self: @T) -> Layout; fn packed_size() -> Option; } @@ -67,8 +78,8 @@ pub trait IModel { 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; - fn schema(self: @T) -> dojo::database::introspect::Ty; + fn layout(self: @T) -> Layout; + fn schema(self: @T) -> Ty; } /// Deploys a model with the given [`ClassHash`] and retrieves it's name. diff --git a/crates/dojo-core/src/database.cairo b/crates/dojo-core/src/storage/database.cairo similarity index 82% rename from crates/dojo-core/src/database.cairo rename to crates/dojo-core/src/storage/database.cairo index e54ef3f0af..2427082467 100644 --- a/crates/dojo-core/src/database.cairo +++ b/crates/dojo-core/src/storage/database.cairo @@ -1,29 +1,24 @@ -use core::option::OptionTrait; use core::array::{ArrayTrait, SpanTrait}; -use core::traits::{Into, TryInto}; -use core::serde::Serde; use core::hash::LegacyHash; +use core::option::OptionTrait; use core::poseidon::poseidon_hash_span; +use core::serde::Serde; +use core::traits::{Into, TryInto}; + use starknet::SyscallResultTrait; +use super::storage; + const DOJO_STORAGE: felt252 = 'dojo_storage'; pub const MAX_ARRAY_LENGTH: u256 = 4_294_967_295; -pub mod introspect; -#[cfg(test)] -mod introspect_test; -pub mod storage; -#[cfg(test)] -mod storage_test; -pub mod utils; - /// Fill the provided array with zeroes. /// /// # Arguments /// * `values` - the array to fill /// * `size` - the number of zero to append in the array -fn _fill_with_zeroes(ref values: Array, size: u32) { +fn fill_with_zeroes(ref values: Array, size: u32) { let mut i = 0; loop { @@ -36,14 +31,14 @@ fn _fill_with_zeroes(ref values: Array, size: u32) { } /// Compute the internal storage key from a table selector and a key. -/// +/// /// # Arguments /// * `table` - the table selector /// * `key` - a key to identify a record in the table /// /// # Returns /// A [`Span`] representing an internal storage key. -fn _get_storage_key(table: felt252, key: felt252) -> Span { +fn get_storage_key(table: felt252, key: felt252) -> Span { let mut keys = ArrayTrait::new(); keys.append(DOJO_STORAGE); keys.append(table); @@ -61,7 +56,7 @@ fn _get_storage_key(table: felt252, key: felt252) -> Span { /// # Returns /// A [`Span`] containing the raw unpacked data of the read record. pub fn get(table: felt252, key: felt252, layout: Span) -> Span { - storage::get_many(0, _get_storage_key(table, key), layout).unwrap_syscall() + storage::get_many(0, get_storage_key(table, key), layout).unwrap_syscall() } /// Write a record with its ID, layout and new value. @@ -72,7 +67,7 @@ pub fn get(table: felt252, key: felt252, layout: Span) -> Span { /// * `value` - the new raw unpacked data value of the record /// * `layout` - the layout of the record to write. pub fn set(table: felt252, key: felt252, value: Span, offset: u32, layout: Span) { - let storage_key = _get_storage_key(table, key); + let storage_key = get_storage_key(table, key); storage::set_many(0, storage_key, value, offset, layout).unwrap_syscall(); } @@ -84,16 +79,16 @@ pub fn set(table: felt252, key: felt252, value: Span, offset: u32, layo /// * `layout` - the layout of the record to delete pub fn delete(table: felt252, key: felt252, layout: Span) { let mut reset_values = array![]; - _fill_with_zeroes(ref reset_values, layout.len()); + fill_with_zeroes(ref reset_values, layout.len()); set(table, key, reset_values.span(), 0, layout); } pub fn set_array(table: felt252, key: felt252, value: Span, offset: u32, array_size: u32) { - let storage_key = _get_storage_key(table, key); + let storage_key = get_storage_key(table, key); storage::set_packed_array(0, storage_key, value, offset, array_size).unwrap_syscall(); } pub fn get_array(table: felt252, key: felt252, array_size: u32) -> Span { - let storage_key = _get_storage_key(table, key); + let storage_key = get_storage_key(table, key); storage::get_packed_array(0, storage_key, array_size).unwrap_syscall() } diff --git a/crates/dojo-core/src/storage/layout.cairo b/crates/dojo-core/src/storage/layout.cairo new file mode 100644 index 0000000000..c9c5b17711 --- /dev/null +++ b/crates/dojo-core/src/storage/layout.cairo @@ -0,0 +1,463 @@ +use dojo::model::{Layout, FieldLayout}; +use dojo::utils::{combine_key, find_field_layout}; + +use super::database; + +// the minimum internal size of an empty ByteArray +const MIN_BYTE_ARRAY_SIZE: u32 = 3; + +/// Write values to the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the object key. +/// * `values` - the object values. +/// * `offset` - the start of object values in the `values` parameter. +/// * `layout` - the object values layout. +pub fn write_layout( + model: felt252, key: felt252, values: Span, ref offset: u32, layout: Layout, +) { + match layout { + Layout::Fixed(layout) => { write_fixed_layout(model, key, values, ref offset, layout); }, + Layout::Struct(layout) => { write_struct_layout(model, key, values, ref offset, layout); }, + Layout::Array(layout) => { write_array_layout(model, key, values, ref offset, layout); }, + Layout::Tuple(layout) => { write_tuple_layout(model, key, values, ref offset, layout); }, + Layout::ByteArray => { write_byte_array_layout(model, key, values, ref offset); }, + Layout::Enum(layout) => { write_enum_layout(model, key, values, ref offset, layout); } + } +} + +/// Write fixed layout model record to the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the model record key. +/// * `values` - the model record values. +/// * `offset` - the start of model record values in the `values` parameter. +/// * `layout` - the model record layout. +pub fn write_fixed_layout( + model: felt252, key: felt252, values: Span, ref offset: u32, layout: Span +) { + database::set(model, key, values, offset, layout); + offset += layout.len(); +} + +/// Write array layout model record to the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the model record key. +/// * `values` - the model record values. +/// * `offset` - the start of model record values in the `values` parameter. +/// * `item_layout` - the model record layout (temporary a Span because of type recursion issue). +pub fn write_array_layout( + model: felt252, key: felt252, values: Span, ref offset: u32, item_layout: Span +) { + assert((values.len() - offset) > 0, 'Invalid values length'); + + // first, read array size which is the first felt252 from values + let array_len = *values.at(offset); + assert(array_len.into() <= database::MAX_ARRAY_LENGTH, 'invalid array length'); + let array_len: u32 = array_len.try_into().unwrap(); + + // then, write the array size + database::set(model, key, values, offset, array![251].span()); + offset += 1; + + // and then, write array items + let item_layout = *item_layout.at(0); + + let mut i = 0; + loop { + if i >= array_len { + break; + } + let key = combine_key(key, i.into()); + + write_layout(model, key, values, ref offset, item_layout); + + i += 1; + }; +} + +/// +pub fn write_byte_array_layout( + model: felt252, key: felt252, values: Span, ref offset: u32 +) { + // The ByteArray internal structure is + // struct ByteArray { + // 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 + assert((values.len() - offset) >= MIN_BYTE_ARRAY_SIZE, 'Invalid values length'); + + let data_len = *values.at(offset); + assert( + data_len.into() <= (database::MAX_ARRAY_LENGTH - MIN_BYTE_ARRAY_SIZE.into()), + 'invalid array length' + ); + + let array_size: u32 = data_len.try_into().unwrap() + MIN_BYTE_ARRAY_SIZE.into(); + assert((values.len() - offset) >= array_size, 'Invalid values length'); + + database::set_array(model, key, values, offset, array_size); + offset += array_size; +} + +/// Write struct layout model record to the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the model record key. +/// * `values` - the model record values. +/// * `offset` - the start of model record values in the `values` parameter. +/// * `layout` - list of field layouts. +pub fn write_struct_layout( + model: felt252, key: felt252, values: Span, ref offset: u32, layout: Span +) { + let mut i = 0; + loop { + if i >= layout.len() { + break; + } + + let field_layout = *layout.at(i); + let field_key = combine_key(key, field_layout.selector); + + write_layout(model, field_key, values, ref offset, field_layout.layout); + + i += 1; + } +} + +/// Write tuple layout model record to the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the model record key. +/// * `values` - the model record values. +/// * `offset` - the start of model record values in the `values` parameter. +/// * `layout` - list of tuple item layouts. +pub fn write_tuple_layout( + model: felt252, key: felt252, values: Span, ref offset: u32, layout: Span +) { + let mut i = 0; + loop { + if i >= layout.len() { + break; + } + + let field_layout = *layout.at(i); + let key = combine_key(key, i.into()); + + write_layout(model, key, values, ref offset, field_layout); + + i += 1; + }; +} + +pub fn write_enum_layout( + model: felt252, + key: felt252, + values: Span, + ref offset: u32, + variant_layouts: Span +) { + // first, get the variant value from `values`` + 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 = combine_key(key, variant); + + match find_field_layout(variant, variant_layouts) { + Option::Some(layout) => write_layout(model, variant_data_key, values, ref offset, layout), + Option::None => panic!("Unable to find the variant layout") + }; +} + +/// Delete a fixed layout model record from the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the model record key. +/// * `layout` - the model layout +pub fn delete_fixed_layout(model: felt252, key: felt252, layout: Span) { + database::delete(model, key, layout); +} + +/// Delete an array layout model record from the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the model record key. +pub fn delete_array_layout(model: felt252, key: felt252) { + // just set the array length to 0 + database::delete(model, key, array![251].span()); +} + +/// +pub fn delete_byte_array_layout(model: felt252, key: felt252) { + // The ByteArray internal structure is + // struct ByteArray { + // 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) + database::delete(model, key, array![251, 251, 251].span()); +} + +/// Delete a model record from the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the model record key. +/// * `layout` - the model layout +pub fn delete_layout(model: felt252, key: felt252, layout: Layout) { + match layout { + Layout::Fixed(layout) => { delete_fixed_layout(model, key, layout); }, + Layout::Struct(layout) => { delete_struct_layout(model, key, layout); }, + Layout::Array(_) => { delete_array_layout(model, key); }, + Layout::Tuple(layout) => { delete_tuple_layout(model, key, layout); }, + Layout::ByteArray => { delete_byte_array_layout(model, key); }, + Layout::Enum(layout) => { delete_enum_layout(model, key, layout); } + } +} + +/// Delete a struct layout model record from the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the model record key. +/// * `layout` - list of field layouts. +pub fn delete_struct_layout(model: felt252, key: felt252, layout: Span) { + let mut i = 0; + loop { + if i >= layout.len() { + break; + } + + let field_layout = *layout.at(i); + let key = combine_key(key, field_layout.selector); + + delete_layout(model, key, field_layout.layout); + + i += 1; + } +} + +/// Delete a tuple layout model record from the world storage. +/// +/// # Arguments +/// * `model` - the model selector. +/// * `key` - the model record key. +/// * `layout` - list of tuple item layouts. +pub fn delete_tuple_layout(model: felt252, key: felt252, layout: Span) { + let mut i = 0; + loop { + if i >= layout.len() { + break; + } + + let field_layout = *layout.at(i); + let key = combine_key(key, i.into()); + + delete_layout(model, key, field_layout); + + i += 1; + } +} + +pub fn delete_enum_layout(model: felt252, key: felt252, variant_layouts: Span) { + // 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 = combine_key(key, variant); + + match find_field_layout(variant, variant_layouts) { + Option::Some(layout) => delete_layout(model, variant_data_key, layout), + Option::None => panic!("Unable to find the variant layout") + }; +} + +/// Read a model record. +/// +/// # Arguments +/// * `model` - the model selector +/// * `key` - model record key. +/// * `read_data` - the read data. +/// * `layout` - the model layout +pub fn read_layout(model: felt252, key: felt252, ref read_data: Array, layout: Layout) { + match layout { + Layout::Fixed(layout) => read_fixed_layout(model, key, ref read_data, layout), + Layout::Struct(layout) => read_struct_layout(model, key, ref read_data, layout), + Layout::Array(layout) => read_array_layout(model, key, ref read_data, layout), + Layout::Tuple(layout) => read_tuple_layout(model, key, ref read_data, layout), + Layout::ByteArray => read_byte_array_layout(model, key, ref read_data), + Layout::Enum(layout) => read_enum_layout(model, key, ref read_data, layout), + }; +} + +/// Read a fixed layout model record. +/// +/// # Arguments +/// * `model` - the model selector +/// * `key` - model record key. +/// * `read_data` - the read data. +/// * `layout` - the model layout +pub fn read_fixed_layout( + model: felt252, key: felt252, ref read_data: Array, layout: Span +) { + let mut data = database::get(model, key, layout); + read_data.append_span(data); +} + +/// Read an array layout model record. +/// +/// # Arguments +/// * `model` - the model selector +/// * `key` - model record key. +/// * `read_data` - the read data. +/// * `layout` - the array item layout +pub fn read_array_layout( + model: felt252, key: felt252, ref read_data: Array, layout: Span +) { + // read number of array items + let res = database::get(model, key, array![251].span()); + assert(res.len() == 1, 'internal database error'); + + let array_len = *res.at(0); + assert(array_len.into() <= database::MAX_ARRAY_LENGTH, 'invalid array length'); + + read_data.append(array_len); + + let item_layout = *layout.at(0); + let array_len: u32 = array_len.try_into().unwrap(); + + let mut i = 0; + loop { + if i >= array_len { + break; + } + + let field_key = combine_key(key, i.into()); + read_layout(model, field_key, ref read_data, item_layout); + + i += 1; + }; +} + +/// +pub fn read_byte_array_layout(model: felt252, key: felt252, ref read_data: Array) { + // The ByteArray internal structure is + // struct ByteArray { + // data: Array, + // pending_word: felt252, + // pending_word_len: usize, + // } + // + // So, read the length of data and compute the full size to read + + let res = database::get(model, key, array![251].span()); + assert(res.len() == 1, 'internal database error'); + + let data_len = *res.at(0); + assert( + data_len.into() <= (database::MAX_ARRAY_LENGTH - MIN_BYTE_ARRAY_SIZE.into()), + 'invalid array length' + ); + + let array_size: u32 = data_len.try_into().unwrap() + MIN_BYTE_ARRAY_SIZE; + + let mut data = database::get_array(model, key, array_size); + read_data.append_span(data); +} + +/// Read a struct layout model record. +/// +/// # Arguments +/// * `model` - the model selector +/// * `key` - model record key. +/// * `read_data` - the read data. +/// * `layout` - the list of field layouts. +pub fn read_struct_layout( + model: felt252, key: felt252, ref read_data: Array, layout: Span +) { + let mut i = 0; + loop { + if i >= layout.len() { + break; + } + + let field_layout = *layout.at(i); + let field_key = combine_key(key, field_layout.selector); + + read_layout(model, field_key, ref read_data, field_layout.layout); + + i += 1; + } +} + +/// Read a tuple layout model record. +/// +/// # Arguments +/// * `model` - the model selector +/// * `key` - model record key. +/// * `read_data` - the read data. +/// * `layout` - the tuple item layouts +pub fn read_tuple_layout( + model: felt252, key: felt252, ref read_data: Array, layout: Span +) { + let mut i = 0; + loop { + if i >= layout.len() { + break; + } + + let field_layout = *layout.at(i); + let field_key = combine_key(key, i.into()); + read_layout(model, field_key, ref read_data, field_layout); + + i += 1; + }; +} + +pub fn read_enum_layout( + model: felt252, key: felt252, ref read_data: Array, variant_layouts: 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'); + + read_data.append(variant); + + // find the corresponding layout and the read the variant data + let variant_data_key = combine_key(key, variant); + + match find_field_layout(variant, variant_layouts) { + Option::Some(layout) => read_layout(model, variant_data_key, ref read_data, layout), + Option::None => panic!("Unable to find the variant layout") + }; +} diff --git a/crates/dojo-core/src/packing.cairo b/crates/dojo-core/src/storage/packing.cairo similarity index 99% rename from crates/dojo-core/src/packing.cairo rename to crates/dojo-core/src/storage/packing.cairo index 39f5f3d8d7..9f0853b1ac 100644 --- a/crates/dojo-core/src/packing.cairo +++ b/crates/dojo-core/src/storage/packing.cairo @@ -1,7 +1,8 @@ -use starknet::{ClassHash, ContractAddress}; use core::array::{ArrayTrait, SpanTrait}; -use core::traits::{Into, TryInto}; use core::option::OptionTrait; +use core::traits::{Into, TryInto}; + +use starknet::{ClassHash, ContractAddress}; const PACKING_MAX_BITS: u8 = 251; @@ -79,9 +80,11 @@ pub fn pack_inner( assert(packing_offset <= PACKING_MAX_BITS, 'Invalid packing offset'); assert(size <= PACKING_MAX_BITS, 'Invalid layout size'); - // Cannot use all 252 bits because some bit arrangements (eg. 11111...11111) are not valid felt252 values. + // Cannot use all 252 bits because some bit arrangements (eg. 11111...11111) are not valid + // felt252 values. // Thus only 251 bits are used. ^-252 times-^ - // One could optimize by some conditional alligment mechanism, but it would be an at most 1/252 space-wise improvement. + // One could optimize by some conditional alligment mechanism, but it would be an at most 1/252 + // space-wise improvement. let remaining_bits: u8 = (PACKING_MAX_BITS - packing_offset).into(); // If we have less remaining bits than the current item size, diff --git a/crates/dojo-core/src/database/storage.cairo b/crates/dojo-core/src/storage/storage.cairo similarity index 70% rename from crates/dojo-core/src/database/storage.cairo rename to crates/dojo-core/src/storage/storage.cairo index 8dbedd36de..62d032ab3a 100644 --- a/crates/dojo-core/src/database/storage.cairo +++ b/crates/dojo-core/src/storage/storage.cairo @@ -1,29 +1,28 @@ use core::array::{ArrayTrait, SpanTrait}; use core::option::OptionTrait; -use starknet::{SyscallResultTrait, SyscallResult}; -use starknet::storage_access::{StorageAddress, StorageBaseAddress}; -use core::traits::Into; use core::poseidon::poseidon_hash_span; use core::serde::Serde; -use dojo::packing::{pack, unpack, calculate_packed_size}; +use core::traits::Into; + +use starknet::{SyscallResultTrait, SyscallResult}; +use starknet::storage_access::{ + StorageAddress, StorageBaseAddress, storage_base_address_from_felt252, + storage_address_from_base, storage_address_from_base_and_offset +}; +use starknet::syscalls::{storage_read_syscall, storage_write_syscall}; + +use super::packing::{pack, unpack, calculate_packed_size}; pub fn get(address_domain: u32, keys: Span) -> felt252 { - let base = starknet::storage_access::storage_base_address_from_felt252( - poseidon_hash_span(keys) - ); - starknet::syscalls::storage_read_syscall( - address_domain, starknet::storage_access::storage_address_from_base(base) - ) - .unwrap_syscall() + let base = storage_base_address_from_felt252(poseidon_hash_span(keys)); + storage_read_syscall(address_domain, storage_address_from_base(base)).unwrap_syscall() } pub fn get_many( address_domain: u32, keys: Span, mut layout: Span ) -> SyscallResult> { - let base = starknet::storage_access::storage_base_address_from_felt252( - poseidon_hash_span(keys) - ); - let base_address = starknet::storage_access::storage_address_from_base(base); + let base = storage_base_address_from_felt252(poseidon_hash_span(keys)); + let base_address = storage_address_from_base(base); let mut packed = ArrayTrait::new(); @@ -36,11 +35,8 @@ pub fn get_many( let mut packed_span = loop { let value = - match starknet::syscalls::storage_read_syscall( - address_domain, - starknet::storage_access::storage_address_from_base_and_offset( - chunk_base, index_in_chunk - ) + match storage_read_syscall( + address_domain, storage_address_from_base_and_offset(chunk_base, index_in_chunk) ) { Result::Ok(value) => value, Result::Err(err) => { break SyscallResult::>::Err(err); }, @@ -77,13 +73,8 @@ pub fn get_many( pub fn set(address_domain: u32, keys: Span, value: felt252) { - let base = starknet::storage_access::storage_base_address_from_felt252( - poseidon_hash_span(keys) - ); - starknet::syscalls::storage_write_syscall( - address_domain, starknet::storage_access::storage_address_from_base(base), value - ) - .unwrap_syscall(); + let base = storage_base_address_from_felt252(poseidon_hash_span(keys)); + storage_write_syscall(address_domain, storage_address_from_base(base), value).unwrap_syscall(); } pub fn set_many( @@ -93,10 +84,8 @@ pub fn set_many( offset: u32, mut layout: Span ) -> SyscallResult<()> { - let base = starknet::storage_access::storage_base_address_from_felt252( - poseidon_hash_span(keys) - ); - let base_address = starknet::storage_access::storage_address_from_base(base); + let base = storage_base_address_from_felt252(poseidon_hash_span(keys)); + let base_address = storage_address_from_base(base); let mut packed = ArrayTrait::new(); pack(ref packed, ref unpacked, offset, ref layout); @@ -111,11 +100,9 @@ pub fn set_many( Option::None => { break Result::Ok(()); }, }; - match starknet::syscalls::storage_write_syscall( + match storage_write_syscall( address_domain, - starknet::storage_access::storage_address_from_base_and_offset( - chunk_base, index_in_chunk - ), + storage_address_from_base_and_offset(chunk_base, index_in_chunk), curr_value.into() ) { Result::Ok(_) => {}, @@ -142,10 +129,8 @@ pub fn set_packed_array( address_domain: u32, keys: Span, mut data: Span, offset: u32, array_size: u32 ) -> SyscallResult<()> { // write data+offset by chunk of 256 felts - let base = starknet::storage_access::storage_base_address_from_felt252( - poseidon_hash_span(keys) - ); - let base_address = starknet::storage_access::storage_address_from_base(base); + let base = storage_base_address_from_felt252(poseidon_hash_span(keys)); + let base_address = storage_address_from_base(base); let mut chunk = 0; let mut chunk_base = base; @@ -159,11 +144,9 @@ pub fn set_packed_array( let curr_value = *data.at(offset + i); - match starknet::syscalls::storage_write_syscall( + match storage_write_syscall( address_domain, - starknet::storage_access::storage_address_from_base_and_offset( - chunk_base, index_in_chunk - ), + storage_address_from_base_and_offset(chunk_base, index_in_chunk), curr_value.into() ) { Result::Ok(_) => {}, @@ -195,10 +178,8 @@ pub fn get_packed_array( return SyscallResult::>::Ok(array![].span()); } - let base = starknet::storage_access::storage_base_address_from_felt252( - poseidon_hash_span(keys) - ); - let base_address = starknet::storage_access::storage_address_from_base(base); + let base = storage_base_address_from_felt252(poseidon_hash_span(keys)); + let base_address = storage_address_from_base(base); let mut packed = ArrayTrait::new(); @@ -208,11 +189,8 @@ pub fn get_packed_array( loop { let value = - match starknet::syscalls::storage_read_syscall( - address_domain, - starknet::storage_access::storage_address_from_base_and_offset( - chunk_base, index_in_chunk - ) + match storage_read_syscall( + address_domain, storage_address_from_base_and_offset(chunk_base, index_in_chunk) ) { Result::Ok(value) => value, Result::Err(err) => { break SyscallResult::>::Err(err); }, @@ -244,5 +222,5 @@ pub fn get_packed_array( fn chunk_segment_pointer(address: StorageAddress, chunk: felt252) -> StorageBaseAddress { let p = poseidon_hash_span(array![address.into(), chunk, 'DojoStorageChunk'].span()); - starknet::storage_access::storage_base_address_from_felt252(p) + storage_base_address_from_felt252(p) } diff --git a/crates/dojo-core/src/base_test.cairo b/crates/dojo-core/src/tests/base.cairo similarity index 94% rename from crates/dojo-core/src/base_test.cairo rename to crates/dojo-core/src/tests/base.cairo index 4d9ffaeee6..61df9a429b 100644 --- a/crates/dojo-core/src/base_test.cairo +++ b/crates/dojo-core/src/tests/base.cairo @@ -1,10 +1,11 @@ use core::option::OptionTrait; -use starknet::ClassHash; use core::traits::TryInto; -use dojo::base::base; -use dojo::components::upgradeable::{IUpgradeableDispatcher, IUpgradeableDispatcherTrait}; -use dojo::test_utils::{spawn_test_world}; +use starknet::ClassHash; + +use dojo::contract::base; +use dojo::contract::upgradeable::{IUpgradeableDispatcher, IUpgradeableDispatcherTrait}; +use dojo::utils::test::{spawn_test_world}; use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; @@ -133,7 +134,7 @@ mod invalid_legacy_model { } fn namespace_hash(self: @ContractState) -> felt252 { - dojo::utils::hash(@Self::namespace(self)) + dojo::utils::bytearray_hash(@Self::namespace(self)) } fn name(self: @ContractState) -> ByteArray { @@ -160,7 +161,7 @@ mod invalid_legacy_model_world { } fn namespace_hash(self: @ContractState) -> felt252 { - dojo::utils::hash(@Self::namespace(self)) + dojo::utils::bytearray_hash(@Self::namespace(self)) } fn name(self: @ContractState) -> ByteArray { @@ -187,7 +188,7 @@ mod invalid_model { } fn namespace_hash(self: @ContractState) -> felt252 { - dojo::utils::hash(@Self::namespace(self)) + dojo::utils::bytearray_hash(@Self::namespace(self)) } fn name(self: @ContractState) -> ByteArray { @@ -214,7 +215,7 @@ mod invalid_model_world { } fn namespace_hash(self: @ContractState) -> felt252 { - dojo::utils::hash(@Self::namespace(self)) + dojo::utils::bytearray_hash(@Self::namespace(self)) } fn name(self: @ContractState) -> ByteArray { diff --git a/crates/dojo-core/src/benchmarks.cairo b/crates/dojo-core/src/tests/benchmarks.cairo similarity index 80% rename from crates/dojo-core/src/benchmarks.cairo rename to crates/dojo-core/src/tests/benchmarks.cairo index d7312d4a09..78388d2209 100644 --- a/crates/dojo-core/src/benchmarks.cairo +++ b/crates/dojo-core/src/tests/benchmarks.cairo @@ -1,16 +1,22 @@ -use core::result::ResultTrait; -use core::array::ArrayTrait; -use core::array::SpanTrait; +use core::array::{ArrayTrait, SpanTrait}; use core::poseidon::poseidon_hash_span; -use starknet::SyscallResultTrait; -use starknet::{contract_address_const, ContractAddress, ClassHash, get_caller_address}; - -use dojo::database; -use dojo::database::storage; -use dojo::model::Model; -use dojo::world_test::Foo; -use dojo::test_utils::GasCounterTrait; -use dojo::database::introspect::{Introspect, Layout}; +use core::result::ResultTrait; +use core::serde::Serde; + +use starknet::{ + contract_address_const, ContractAddress, ClassHash, get_caller_address, SyscallResultTrait +}; +use starknet::storage_access::{ + storage_base_address_from_felt252, storage_address_from_base, + storage_address_from_base_and_offset +}; +use starknet::syscalls::{storage_read_syscall, storage_write_syscall}; + +use dojo::model::{Model, Layout}; +use dojo::model::introspect::Introspect; +use dojo::storage::{database, storage}; +use dojo::utils::test::GasCounterTrait; +use dojo::tests::world::Foo; #[test] #[available_gas(1000000000)] @@ -60,18 +66,16 @@ fn bench_storage_many() { fn bench_native_storage() { let gas = GasCounterTrait::start(); let keys = array![0x1337].span(); - let base = starknet::storage_access::storage_base_address_from_felt252( - poseidon_hash_span(keys) - ); - let address = starknet::storage_access::storage_address_from_base(base); + let base = storage_base_address_from_felt252(poseidon_hash_span(keys)); + let address = storage_address_from_base(base); gas.end("native prep"); let gas = GasCounterTrait::start(); - starknet::syscalls::storage_write_syscall(0, address, 42).unwrap_syscall(); + storage_write_syscall(0, address, 42).unwrap_syscall(); gas.end("native write"); let gas = GasCounterTrait::start(); - let value = starknet::syscalls::storage_read_syscall(0, address).unwrap_syscall(); + let value = storage_read_syscall(0, address).unwrap_syscall(); gas.end("native read"); assert(value == 42, 'read invalid'); @@ -82,18 +86,16 @@ fn bench_native_storage() { fn bench_native_storage_offset() { let gas = GasCounterTrait::start(); let keys = array![0x1337].span(); - let base = starknet::storage_access::storage_base_address_from_felt252( - poseidon_hash_span(keys) - ); - let address = starknet::storage_access::storage_address_from_base_and_offset(base, 42); + let base = storage_base_address_from_felt252(poseidon_hash_span(keys)); + let address = storage_address_from_base_and_offset(base, 42); gas.end("native prep of"); let gas = GasCounterTrait::start(); - starknet::syscalls::storage_write_syscall(0, address, 42).unwrap_syscall(); + storage_write_syscall(0, address, 42).unwrap_syscall(); gas.end("native writ of"); let gas = GasCounterTrait::start(); - let value = starknet::syscalls::storage_read_syscall(0, address).unwrap_syscall(); + let value = storage_read_syscall(0, address).unwrap_syscall(); gas.end("native read of"); assert(value == 42, 'read invalid'); @@ -151,9 +153,9 @@ fn bench_simple_struct() { let gas = GasCounterTrait::start(); let mut serialized = ArrayTrait::new(); - core::serde::Serde::serialize(@foo.a, ref serialized); - core::serde::Serde::serialize(@foo.b, ref serialized); - let serialized = core::array::ArrayTrait::span(@serialized); + Serde::serialize(@foo.a, ref serialized); + Serde::serialize(@foo.b, ref serialized); + let serialized = ArrayTrait::span(@serialized); gas.end("foo serialize"); let gas = GasCounterTrait::start(); @@ -200,14 +202,14 @@ fn test_struct_with_many_fields_fixed() { let gas = GasCounterTrait::start(); let mut serialized = ArrayTrait::new(); - core::serde::Serde::serialize(@pos.x, ref serialized); - core::serde::Serde::serialize(@pos.y, ref serialized); - core::serde::Serde::serialize(@pos.z, ref serialized); - core::serde::Serde::serialize(@pos.a, ref serialized); - core::serde::Serde::serialize(@pos.b, ref serialized); - core::serde::Serde::serialize(@pos.c, ref serialized); - core::serde::Serde::serialize(@pos.d, ref serialized); - let serialized = core::array::ArrayTrait::span(@serialized); + Serde::serialize(@pos.x, ref serialized); + Serde::serialize(@pos.y, ref serialized); + Serde::serialize(@pos.z, ref serialized); + Serde::serialize(@pos.a, ref serialized); + Serde::serialize(@pos.b, ref serialized); + Serde::serialize(@pos.c, ref serialized); + Serde::serialize(@pos.d, ref serialized); + let serialized = ArrayTrait::span(@serialized); gas.end("pos serialize"); let gas = GasCounterTrait::start(); @@ -268,9 +270,9 @@ fn bench_nested_struct_packed() { let gas = GasCounterTrait::start(); let mut serialized = ArrayTrait::new(); - core::serde::Serde::serialize(@case.sword, ref serialized); - core::serde::Serde::serialize(@case.material, ref serialized); - let serialized = core::array::ArrayTrait::span(@serialized); + Serde::serialize(@case.sword, ref serialized); + Serde::serialize(@case.material, ref serialized); + let serialized = ArrayTrait::span(@serialized); gas.end("case serialize"); let gas = GasCounterTrait::start(); @@ -387,12 +389,12 @@ fn bench_complex_struct_packed() { let gas = GasCounterTrait::start(); let mut serialized = ArrayTrait::new(); - core::serde::Serde::serialize(@char.heigth, ref serialized); - core::serde::Serde::serialize(@char.abilities, ref serialized); - core::serde::Serde::serialize(@char.stats, ref serialized); - core::serde::Serde::serialize(@char.weapon, ref serialized); - core::serde::Serde::serialize(@char.gold, ref serialized); - let serialized = core::array::ArrayTrait::span(@serialized); + Serde::serialize(@char.heigth, ref serialized); + Serde::serialize(@char.abilities, ref serialized); + Serde::serialize(@char.stats, ref serialized); + Serde::serialize(@char.weapon, ref serialized); + Serde::serialize(@char.gold, ref serialized); + let serialized = ArrayTrait::span(@serialized); gas.end("chars serialize"); let gas = GasCounterTrait::start(); diff --git a/crates/dojo-core/src/database/introspect_test.cairo b/crates/dojo-core/src/tests/model/introspect.cairo similarity index 98% rename from crates/dojo-core/src/database/introspect_test.cairo rename to crates/dojo-core/src/tests/model/introspect.cairo index c62d9561bc..1b24b2b85c 100644 --- a/crates/dojo-core/src/database/introspect_test.cairo +++ b/crates/dojo-core/src/tests/model/introspect.cairo @@ -1,4 +1,5 @@ -use dojo::database::introspect::{Introspect, Layout, FieldLayout}; +use dojo::model::introspect::Introspect; +use dojo::model::{Layout, FieldLayout}; #[derive(Drop, Introspect)] struct Base { diff --git a/crates/dojo-core/src/model_test.cairo b/crates/dojo-core/src/tests/model/model.cairo similarity index 74% rename from crates/dojo-core/src/model_test.cairo rename to crates/dojo-core/src/tests/model/model.cairo index b8734934a1..7204264f97 100644 --- a/crates/dojo-core/src/model_test.cairo +++ b/crates/dojo-core/src/tests/model/model.cairo @@ -1,4 +1,5 @@ -use dojo::test_utils::{spawn_test_world}; +use dojo::model::{Model, ModelEntity}; +use dojo::utils::test::{spawn_test_world}; use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; // Utils @@ -28,23 +29,23 @@ fn test_values() { let mvalues = FooEntity { __id: 1, v1: 3, v2: 4 }; let expected_values = array![3, 4].span(); - let values = dojo::model::ModelEntity::::values(@mvalues); + let values = ModelEntity::::values(@mvalues); assert!(expected_values == values); } #[test] fn test_from_values() { - let values = array![3, 4].span(); + let mut values = array![3, 4].span(); - let model_entity = dojo::model::ModelEntity::::from_values(1, values); + let model_entity = ModelEntity::::from_values(1, ref values); assert!(model_entity.__id == 1 && model_entity.v1 == 3 && model_entity.v2 == 4); } #[test] #[should_panic(expected: "ModelEntity `FooEntity`: deserialization failed.")] fn test_from_values_bad_data() { - let values = array![3].span(); - let _ = dojo::model::ModelEntity::::from_values(1, values); + let mut values = array![3].span(); + let _ = ModelEntity::::from_values(1, ref values); } #[test] @@ -56,7 +57,7 @@ fn test_get_and_update_entity() { foo.set(world); let entity_id = foo.entity_id(); - let mut entity = FooEntityTrait::get(world, entity_id); + let mut entity = FooEntityStore::get(world, entity_id); assert!(entity.__id == entity_id && entity.v1 == entity.v1 && entity.v2 == entity.v2); entity.v1 = 12; @@ -64,7 +65,7 @@ fn test_get_and_update_entity() { entity.update(world); - let read_values = FooEntityTrait::get(world, entity_id); + let read_values = FooEntityStore::get(world, entity_id); assert!(read_values.v1 == entity.v1 && read_values.v2 == entity.v2); } @@ -77,10 +78,10 @@ fn test_delete_entity() { foo.set(world); let entity_id = foo.entity_id(); - let mut entity = FooEntityTrait::get(world, entity_id); + let mut entity = FooEntityStore::get(world, entity_id); entity.delete(world); - let read_values = FooEntityTrait::get(world, entity_id); + let read_values = FooEntityStore::get(world, entity_id); assert!(read_values.v1 == 0 && read_values.v2 == 0); } @@ -92,17 +93,17 @@ fn test_get_and_set_member_from_entity() { let foo = Foo { k1: 1, k2: 2, v1: 3, v2: 4 }; foo.set(world); - let v1_raw_value: Span = dojo::model::ModelEntity::< + let v1_raw_value: Span = ModelEntity::< FooEntity >::get_member(world, foo.entity_id(), selector!("v1")); assert!(v1_raw_value.len() == 1); assert!(*v1_raw_value.at(0) == 3); - let entity = FooEntityTrait::get(world, foo.entity_id()); + let entity = FooEntityStore::get(world, foo.entity_id()); entity.set_member(world, selector!("v1"), array![42].span()); - let entity = FooEntityTrait::get(world, foo.entity_id()); + let entity = FooEntityStore::get(world, foo.entity_id()); assert!(entity.v1 == 42); } @@ -114,13 +115,13 @@ fn test_get_and_set_field_name() { let foo = Foo { k1: 1, k2: 2, v1: 3, v2: 4 }; foo.set(world); - let v1 = FooEntityTrait::get_v1(world, foo.entity_id()); + let v1 = FooEntityStore::get_v1(world, foo.entity_id()); assert!(foo.v1 == v1); - let entity = FooEntityTrait::get(world, foo.entity_id()); + let entity = FooEntityStore::get(world, foo.entity_id()); entity.set_v1(world, 42); - let v1 = FooEntityTrait::get_v1(world, foo.entity_id()); + let v1 = FooEntityStore::get_v1(world, foo.entity_id()); assert!(v1 == 42); } @@ -132,7 +133,7 @@ fn test_get_and_set_from_model() { let foo = Foo { k1: 1, k2: 2, v1: 3, v2: 4 }; foo.set(world); - let read_entity = FooTrait::get(world, foo.k1, foo.k2); + let read_entity = FooStore::get(world, foo.k1, foo.k2); assert!( foo.k1 == read_entity.k1 @@ -151,7 +152,7 @@ fn test_delete_from_model() { foo.set(world); foo.delete(world); - let read_entity = FooTrait::get(world, foo.k1, foo.k2); + let read_entity = FooStore::get(world, foo.k1, foo.k2); assert!( read_entity.k1 == foo.k1 && read_entity.k2 == foo.k2 @@ -169,13 +170,13 @@ fn test_get_and_set_member_from_model() { let keys = array![foo.k1.into(), foo.k2.into()].span(); foo.set(world); - let v1_raw_value = dojo::model::Model::::get_member(world, keys, selector!("v1")); + let v1_raw_value = Model::::get_member(world, keys, selector!("v1")); assert!(v1_raw_value.len() == 1); assert!(*v1_raw_value.at(0) == 3); foo.set_member(world, selector!("v1"), array![42].span()); - let foo = FooTrait::get(world, foo.k1, foo.k2); + let foo = FooStore::get(world, foo.k1, foo.k2); assert!(foo.v1 == 42); } @@ -187,12 +188,12 @@ fn test_get_and_set_field_name_from_model() { let foo = Foo { k1: 1, k2: 2, v1: 3, v2: 4 }; foo.set(world); - let v1 = FooTrait::get_v1(world, foo.k1, foo.k2); + let v1 = FooStore::get_v1(world, foo.k1, foo.k2); assert!(v1 == 3); foo.set_v1(world, 42); - let v1 = FooTrait::get_v1(world, foo.k1, foo.k2); + let v1 = FooStore::get_v1(world, foo.k1, foo.k2); assert!(v1 == 42); } diff --git a/crates/dojo-core/src/database_test.cairo b/crates/dojo-core/src/tests/storage/database.cairo similarity index 94% rename from crates/dojo-core/src/database_test.cairo rename to crates/dojo-core/src/tests/storage/database.cairo index 7b653f59e4..cd312f1e85 100644 --- a/crates/dojo-core/src/database_test.cairo +++ b/crates/dojo-core/src/tests/storage/database.cairo @@ -1,15 +1,15 @@ -use core::result::ResultTrait; -use core::array::ArrayTrait; +use core::array::{ArrayTrait, SpanTrait}; use core::option::OptionTrait; +use core::result::ResultTrait; use core::serde::Serde; -use core::array::SpanTrait; use core::traits::{Into, TryInto}; -use starknet::syscalls::deploy_syscall; use starknet::class_hash::ClassHash; +use starknet::syscalls::deploy_syscall; + +use dojo::storage::database::{get, set, MAX_ARRAY_LENGTH}; +use dojo::utils::test::assert_array; use dojo::world::{IWorldDispatcher}; -use dojo::database::{get, set, MAX_ARRAY_LENGTH}; -use dojo::test_utils::assert_array; #[test] #[available_gas(1000000)] diff --git a/crates/dojo-core/src/packing_test.cairo b/crates/dojo-core/src/tests/storage/packing.cairo similarity index 94% rename from crates/dojo-core/src/packing_test.cairo rename to crates/dojo-core/src/tests/storage/packing.cairo index b6986d2e99..7495727410 100644 --- a/crates/dojo-core/src/packing_test.cairo +++ b/crates/dojo-core/src/tests/storage/packing.cairo @@ -1,11 +1,11 @@ use core::array::{ArrayTrait, SpanTrait}; +use core::option::OptionTrait; +use core::traits::{Into, TryInto}; use starknet::{ClassHash, ContractAddress}; -use dojo::packing::{ + +use dojo::storage::packing::{ shl, shr, fpow, pack, unpack, pack_inner, unpack_inner, calculate_packed_size, pow2_const }; -use core::option::OptionTrait; -use core::traits::{Into, TryInto}; -use dojo::database::introspect::Introspect; #[test] #[available_gas(9000000)] @@ -44,7 +44,7 @@ fn test_bit_shift() { #[test] #[available_gas(9000000)] fn test_pack_unpack_single() { - let mut packed = core::array::ArrayTrait::new(); + let mut packed = ArrayTrait::new(); let mut packing: felt252 = 0; let mut offset = 0; pack_inner(@18, 251, ref packing, ref offset, ref packed); @@ -63,7 +63,7 @@ fn test_pack_unpack_single() { #[test] #[available_gas(9000000)] fn test_pack_unpack_felt252_u128() { - let mut packed = core::array::ArrayTrait::new(); + let mut packed = ArrayTrait::new(); let mut packing: felt252 = 0; let mut offset = 0; pack_inner(@1337, 128, ref packing, ref offset, ref packed); @@ -86,7 +86,7 @@ fn test_pack_unpack_felt252_u128() { #[test] #[available_gas(100000000)] fn test_pack_multiple() { - let mut packed = core::array::ArrayTrait::new(); + let mut packed = ArrayTrait::new(); let mut packing: felt252 = 0; let mut offset = 0; @@ -112,7 +112,7 @@ fn test_pack_multiple() { #[test] #[available_gas(500000000)] fn test_pack_unpack_multiple() { - let mut packed = core::array::ArrayTrait::new(); + let mut packed = ArrayTrait::new(); let mut packing: felt252 = 0; let mut offset = 0; @@ -155,7 +155,7 @@ fn test_pack_unpack_multiple() { #[test] #[available_gas(500000000)] fn test_pack_unpack_types() { - let mut packed = core::array::ArrayTrait::new(); + let mut packed = ArrayTrait::new(); let mut packing: felt252 = 0; let mut offset = 0; @@ -241,7 +241,7 @@ fn test_pack_unpack_types() { #[available_gas(9000000)] fn test_inner_pack_unpack_u256_single() { let input: u256 = 2000; - let mut packed = core::array::ArrayTrait::new(); + let mut packed = ArrayTrait::new(); let mut packing: felt252 = 0; let mut offset = 0; pack_inner(@input.low.into(), 128, ref packing, ref offset, ref packed); @@ -276,7 +276,7 @@ fn test_pack_unpack_u256_single() { let mut unpacked_span = unpacked.span(); - let mut packed = core::array::ArrayTrait::new(); + let mut packed = ArrayTrait::new(); pack(ref packed, ref unpacked_span, 0, ref layout_span); let mut layout = ArrayTrait::new(); @@ -284,7 +284,7 @@ fn test_pack_unpack_u256_single() { layout.append(128); let mut layout_span = layout.span(); - let mut unpacked = core::array::ArrayTrait::new(); + let mut unpacked = ArrayTrait::new(); let mut packed_span = packed.span(); unpack(ref unpacked, ref packed_span, ref layout_span); let mut unpacked_span = unpacked.span(); @@ -296,7 +296,7 @@ fn test_pack_unpack_u256_single() { #[available_gas(9000000)] fn test_pack_unpack_max_felt252() { let MAX: felt252 = 3618502788666131213697322783095070105623107215331596699973092056135872020480; - let mut packed = core::array::ArrayTrait::new(); + let mut packed = ArrayTrait::new(); let mut packing: felt252 = 0; let mut offset = 0; pack_inner(@MAX, 251, ref packing, ref offset, ref packed); @@ -322,14 +322,14 @@ fn test_pack_unpack_felt252_single() { let mut unpacked_span = unpacked.span(); - let mut packed = core::array::ArrayTrait::new(); + let mut packed = ArrayTrait::new(); pack(ref packed, ref unpacked_span, 0, ref layout_span); let mut layout = ArrayTrait::new(); layout.append(251); let mut layout_span = layout.span(); - let mut unpacked = core::array::ArrayTrait::new(); + let mut unpacked = ArrayTrait::new(); let mut packed_span = packed.span(); unpack(ref unpacked, ref packed_span, ref layout_span); let mut unpacked_span = unpacked.span(); diff --git a/crates/dojo-core/src/database/storage_test.cairo b/crates/dojo-core/src/tests/storage/storage.cairo similarity index 99% rename from crates/dojo-core/src/database/storage_test.cairo rename to crates/dojo-core/src/tests/storage/storage.cairo index 86eee00517..4870876a32 100644 --- a/crates/dojo-core/src/database/storage_test.cairo +++ b/crates/dojo-core/src/tests/storage/storage.cairo @@ -2,7 +2,7 @@ use core::array::ArrayTrait; use core::array::SpanTrait; use core::traits::Into; -use dojo::database::storage; +use dojo::storage::storage; #[test] #[available_gas(2000000)] diff --git a/crates/dojo-core/src/utils_test.cairo b/crates/dojo-core/src/tests/utils.cairo similarity index 54% rename from crates/dojo-core/src/utils_test.cairo rename to crates/dojo-core/src/tests/utils.cairo index a0a9c14744..2b9ac036c8 100644 --- a/crates/dojo-core/src/utils_test.cairo +++ b/crates/dojo-core/src/tests/utils.cairo @@ -1,3 +1,6 @@ +use dojo::model::Model; +use dojo::utils::bytearray_hash; + #[derive(Drop, Copy, Serde)] #[dojo::model(namespace: "my_namespace")] struct MyModel { @@ -10,8 +13,8 @@ struct MyModel { 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_hash = dojo::model::Model::::namespace_hash(); + let namespace = Model::::namespace(); + let namespace_hash = Model::::namespace_hash(); - assert(dojo::utils::hash(@namespace) == namespace_hash, 'invalid computed hash'); + assert(bytearray_hash(@namespace) == namespace_hash, 'invalid computed hash'); } diff --git a/crates/dojo-core/src/world_test.cairo b/crates/dojo-core/src/tests/world.cairo similarity index 77% rename from crates/dojo-core/src/world_test.cairo rename to crates/dojo-core/src/tests/world.cairo index fbfd779f32..a9eeb3ff03 100644 --- a/crates/dojo-core/src/world_test.cairo +++ b/crates/dojo-core/src/tests/world.cairo @@ -1,29 +1,30 @@ use core::array::{ArrayTrait, SpanTrait}; use core::clone::Clone; +use core::option::OptionTrait; use core::result::ResultTrait; use core::traits::{Into, TryInto}; -use core::option::OptionTrait; + use starknet::{contract_address_const, ContractAddress, ClassHash, get_caller_address}; use starknet::syscalls::deploy_syscall; -use dojo::benchmarks; -use dojo::config::interface::{IConfigDispatcher, IConfigDispatcherTrait}; +use dojo::world::config::Config::{ + DifferProgramHashUpdate, MergerProgramHashUpdate, FactsRegistryUpdate +}; +use dojo::world::config::{IConfigDispatcher, IConfigDispatcherTrait}; +use dojo::model::{ModelIndex, Layout, FieldLayout, Model, ResourceMetadata}; +use dojo::model::introspect::{Introspect}; +use dojo::utils::bytearray_hash; +use dojo::storage::database::MAX_ARRAY_LENGTH; +use dojo::utils::test::{spawn_test_world, deploy_with_world_address, assert_array, GasCounterTrait}; +use dojo::utils::entity_id_from_keys; use dojo::world::{ IWorldDispatcher, IWorldDispatcherTrait, world, IUpgradeableWorld, IUpgradeableWorldDispatcher, - IUpgradeableWorldDispatcherTrait, + IUpgradeableWorldDispatcherTrait }; 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}; -use dojo::config::component::Config::{ - DifferProgramHashUpdate, MergerProgramHashUpdate, FactsRegistryUpdate -}; -use dojo::model::Model; -use dojo::benchmarks::Character; -use dojo::test_utils::GasCounterTrait; -use dojo::utils::entity_id_from_keys; -use dojo::resource_metadata::ResourceMetadata; + +use super::benchmarks; +use super::benchmarks::Character; #[derive(Introspect, Copy, Drop, Serde)] enum OneEnum { @@ -267,13 +268,16 @@ trait IMetadataOnly { #[starknet::contract] mod resource_metadata_malicious { + use dojo::model::{Model, ResourceMetadata}; + use dojo::utils::bytearray_hash; + #[storage] struct Storage {} #[abi(embed_v0)] impl InvalidModelName of super::IMetadataOnly { fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() + Model::::selector() } fn namespace(self: @ContractState) -> ByteArray { @@ -281,7 +285,7 @@ mod resource_metadata_malicious { } fn namespace_hash(self: @ContractState) -> felt252 { - dojo::utils::hash(@Self::namespace(self)) + bytearray_hash(@Self::namespace(self)) } fn name(self: @ContractState) -> ByteArray { @@ -300,10 +304,13 @@ trait Ibar { #[starknet::contract] mod bar { - use super::{Foo, IWorldDispatcher, IWorldDispatcherTrait, Introspect}; - use super::benchmarks::{Character, Abilities, Stats, Weapon, Sword}; use core::traits::Into; use starknet::{get_caller_address, ContractAddress}; + use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess}; + use dojo::model::{Model, ModelIndex}; + + use super::{Foo, IWorldDispatcher, IWorldDispatcherTrait, Introspect}; + use super::benchmarks::{Character, Abilities, Stats, Weapon, Sword}; #[storage] struct Storage { @@ -325,9 +332,9 @@ mod bar { .world .read() .delete_entity( - dojo::model::Model::::selector(), - dojo::world::ModelIndex::Keys(array![get_caller_address().into()].span()), - dojo::model::Model::::layout() + Model::::selector(), + ModelIndex::Keys(array![get_caller_address().into()].span()), + Model::::layout() ); } @@ -447,7 +454,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(dojo::model::Model::::selector()); + let (foo_class_hash, _) = world.model(Model::::selector()); assert(foo_class_hash == foo::TEST_CLASS_HASH.try_into().unwrap(), 'foo wrong class hash'); } @@ -472,7 +479,7 @@ fn test_register_namespace() { drop_all_events(world.contract_address); let namespace = "namespace"; - let hash = dojo::utils::hash(@namespace); + let hash = bytearray_hash(@namespace); world.register_namespace(namespace); @@ -492,7 +499,7 @@ fn test_register_namespace_already_registered_same_caller() { starknet::testing::set_account_contract_address(caller); let namespace = "namespace"; - let hash = dojo::utils::hash(@namespace); + let hash = bytearray_hash(@namespace); world.register_namespace(namespace); @@ -597,7 +604,7 @@ fn test_set_metadata_model_writer() { contract_address: deploy_with_world_address(bar::TEST_CLASS_HASH, world) }; - world.grant_writer(dojo::model::Model::::selector(), bar_contract.contract_address); + world.grant_writer(Model::::selector(), bar_contract.contract_address); let bob = starknet::contract_address_const::<0xb0b>(); starknet::testing::set_account_contract_address(bob); @@ -606,13 +613,13 @@ fn test_set_metadata_model_writer() { bar_contract.set_foo(1337, 1337); let metadata = ResourceMetadata { - resource_id: dojo::model::Model::::selector(), metadata_uri: format!("ipfs:bob") + resource_id: 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(dojo::model::Model::::selector()) == metadata, 'bad metadata'); + assert(world.metadata(Model::::selector()) == metadata, 'bad metadata'); } #[test] @@ -643,7 +650,7 @@ 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")); + world.grant_owner(bob, bytearray_hash(@"dojo")); starknet::testing::set_account_contract_address(bob); @@ -655,7 +662,7 @@ fn test_metadata_update_owner_only() { 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 foo_selector = Model::::selector(); let alice = starknet::contract_address_const::<0x1337>(); let bob = starknet::contract_address_const::<0x1338>(); @@ -696,7 +703,7 @@ fn test_set_owner_fails_for_non_owner() { fn test_writer() { let world = deploy_world(); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - let foo_selector = dojo::model::Model::::selector(); + let foo_selector = Model::::selector(); assert(!world.is_writer(foo_selector, 69.try_into().unwrap()), 'should not be writer'); @@ -740,8 +747,8 @@ fn test_system_writer_access() { let bar_address = deploy_with_world_address(bar::TEST_CLASS_HASH, world); let bar_contract = IbarDispatcher { contract_address: bar_address }; - world.grant_writer(dojo::model::Model::::selector(), bar_address); - assert(world.is_writer(dojo::model::Model::::selector(), bar_address), 'should be writer'); + world.grant_writer(Model::::selector(), bar_address); + assert(world.is_writer(Model::::selector(), bar_address), 'should be writer'); // Caller is not owner now let caller = starknet::contract_address_const::<0x1337>(); @@ -848,6 +855,7 @@ trait IWorldUpgrade { #[starknet::contract] mod worldupgrade { use super::{IWorldUpgrade, IWorldDispatcher, ContractAddress}; + use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess}; #[storage] struct Storage { @@ -979,13 +987,13 @@ fn test_can_call_init() { fn test_set_entity_by_id() { let world = deploy_world(); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - let selector = dojo::model::Model::::selector(); + let selector = Model::::selector(); let entity_id = entity_id_from_keys(array![0x01234].span()); let values = create_foo(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Id(entity_id), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Id(entity_id), layout); + world.set_entity(selector, ModelIndex::Id(entity_id), values, layout); + let read_values = world.entity(selector, ModelIndex::Id(entity_id), layout); assert_array(read_values, values); } @@ -993,13 +1001,13 @@ fn test_set_entity_by_id() { fn test_set_entity_with_fixed_layout() { let world = deploy_world(); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - let selector = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_foo(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(get_key_test()), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.set_entity(selector, ModelIndex::Keys(get_key_test()), values, layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); } @@ -1008,14 +1016,14 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_simple_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); } @@ -1024,14 +1032,14 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_with_tuple(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); } @@ -1040,22 +1048,22 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_with_enum_first_variant(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); // test with the first variant - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); // then override with the second variant let values = create_struct_with_enum_second_variant(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); } @@ -1064,14 +1072,14 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_simple_array_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); } @@ -1080,14 +1088,14 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_complex_array_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); } @@ -1096,14 +1104,14 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_byte_array_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); } @@ -1112,14 +1120,14 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_nested_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); } @@ -1139,22 +1147,22 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_generic_first_variant(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); // test with the first variant - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); // then override with the second variant let values = create_struct_generic_second_variant(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert_array(read_values, values); } @@ -1162,16 +1170,16 @@ fn test_set_entity_with_struct_generics_enum_layout() { fn test_delete_entity_by_id() { let world = deploy_world(); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - let selector = dojo::model::Model::::selector(); + let selector = Model::::selector(); let entity_id = entity_id_from_keys(get_key_test()); let values = create_foo(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Id(entity_id), values, layout); + world.set_entity(selector, ModelIndex::Id(entity_id), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Id(entity_id), layout); + world.delete_entity(selector, ModelIndex::Id(entity_id), layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Id(entity_id), layout); + let read_values = world.entity(selector, ModelIndex::Id(entity_id), layout); assert!(read_values.len() == values.len()); assert_empty_array(read_values); @@ -1181,16 +1189,16 @@ fn test_delete_entity_by_id() { fn test_delete_entity_with_fixed_layout() { let world = deploy_world(); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - let selector = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_foo(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(get_key_test()), values, layout); + world.set_entity(selector, ModelIndex::Keys(get_key_test()), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.delete_entity(selector, ModelIndex::Keys(keys), layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert!(read_values.len() == values.len()); assert_empty_array(read_values); @@ -1201,16 +1209,16 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_simple_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.delete_entity(selector, ModelIndex::Keys(keys), layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert!(read_values.len() == values.len()); assert_empty_array(read_values); @@ -1221,16 +1229,16 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_simple_array_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.delete_entity(selector, ModelIndex::Keys(keys), layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); // array length set to 0, so the expected value span is shorter than the initial values let expected_values = array![0, 0, 0].span(); @@ -1244,17 +1252,17 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_complex_array_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.delete_entity(selector, ModelIndex::Keys(keys), layout); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); // array length set to 0, so the expected value span is shorter than the initial values let expected_values = array![0, 0, 0, 0, 0, 0, 0, 0, 0, 0].span(); @@ -1268,17 +1276,17 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_with_tuple(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.delete_entity(selector, ModelIndex::Keys(keys), layout); let expected_values = array![0, 0].span(); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert!(read_values.len() == expected_values.len()); assert_empty_array(read_values); @@ -1289,18 +1297,18 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_with_enum_first_variant(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); // test with the first variant - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.delete_entity(selector, ModelIndex::Keys(keys), layout); let expected_values = array![0, 0, 0].span(); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert!(read_values.len() == expected_values.len()); assert_empty_array(read_values); @@ -1311,17 +1319,17 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_byte_array_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.delete_entity(selector, ModelIndex::Keys(keys), layout); let expected_values = array![0, 0, 0, 0].span(); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert!(read_values.len() == expected_values.len()); assert_empty_array(read_values); @@ -1332,17 +1340,17 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_nested_model(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.delete_entity(selector, ModelIndex::Keys(keys), layout); let expected_values = array![0, 0, 0, 0, 0, 0, 0, 0, 0].span(); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert!(read_values.len() == expected_values.len()); assert_empty_array(read_values); @@ -1353,17 +1361,17 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values = create_struct_generic_first_variant(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); - world.delete_entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + world.delete_entity(selector, ModelIndex::Keys(keys), layout); let expected_values = array![0, 0].span(); - let read_values = world.entity(selector, dojo::world::ModelIndex::Keys(keys), layout); + let read_values = world.entity(selector, ModelIndex::Keys(keys), layout); assert!(read_values.len() == expected_values.len()); assert_empty_array(read_values); @@ -1375,14 +1383,12 @@ fn test_set_entity_with_unexpected_array_model_layout() { let world = deploy_world(); world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let layout = Layout::Array( - array![dojo::database::introspect::Introspect::::layout()].span() - ); + let layout = Layout::Array(array![Introspect::::layout()].span()); world .set_entity( - dojo::model::Model::::selector(), - dojo::world::ModelIndex::Keys(array![].span()), + Model::::selector(), + ModelIndex::Keys(array![].span()), array![].span(), layout ); @@ -1394,14 +1400,12 @@ fn test_set_entity_with_unexpected_tuple_model_layout() { let world = deploy_world(); world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let layout = Layout::Tuple( - array![dojo::database::introspect::Introspect::::layout()].span() - ); + let layout = Layout::Tuple(array![Introspect::::layout()].span()); world .set_entity( - dojo::model::Model::::selector(), - dojo::world::ModelIndex::Keys(array![].span()), + Model::::selector(), + ModelIndex::Keys(array![].span()), array![].span(), layout ); @@ -1413,15 +1417,11 @@ fn test_delete_entity_with_unexpected_array_model_layout() { let world = deploy_world(); world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let layout = Layout::Array( - array![dojo::database::introspect::Introspect::::layout()].span() - ); + let layout = Layout::Array(array![Introspect::::layout()].span()); world .delete_entity( - dojo::model::Model::::selector(), - dojo::world::ModelIndex::Keys(array![].span()), - layout + Model::::selector(), ModelIndex::Keys(array![].span()), layout ); } @@ -1431,15 +1431,11 @@ fn test_delete_entity_with_unexpected_tuple_model_layout() { let world = deploy_world(); world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let layout = Layout::Tuple( - array![dojo::database::introspect::Introspect::::layout()].span() - ); + let layout = Layout::Tuple(array![Introspect::::layout()].span()); world .delete_entity( - dojo::model::Model::::selector(), - dojo::world::ModelIndex::Keys(array![].span()), - layout + Model::::selector(), ModelIndex::Keys(array![].span()), layout ); } @@ -1449,15 +1445,11 @@ fn test_get_entity_with_unexpected_array_model_layout() { let world = deploy_world(); world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let layout = Layout::Array( - array![dojo::database::introspect::Introspect::::layout()].span() - ); + let layout = Layout::Array(array![Introspect::::layout()].span()); world .entity( - dojo::model::Model::::selector(), - dojo::world::ModelIndex::Keys(array![].span()), - layout + Model::::selector(), ModelIndex::Keys(array![].span()), layout ); } @@ -1467,15 +1459,11 @@ fn test_get_entity_with_unexpected_tuple_model_layout() { let world = deploy_world(); world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let layout = Layout::Tuple( - array![dojo::database::introspect::Introspect::::layout()].span() - ); + let layout = Layout::Tuple(array![Introspect::::layout()].span()); world .entity( - dojo::model::Model::::selector(), - dojo::world::ModelIndex::Keys(array![].span()), - layout + Model::::selector(), ModelIndex::Keys(array![].span()), layout ); } @@ -1486,11 +1474,11 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), array![1].span(), layout); + world.set_entity(selector, ModelIndex::Keys(keys), array![1].span(), layout); } #[test] @@ -1499,15 +1487,15 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values: Span = array![ 1, MAX_ARRAY_LENGTH.try_into().unwrap() + 1, 10, 20, 30, 40, 2 ] .span(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); } #[test] @@ -1516,15 +1504,15 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values: Span = array![ 1, MAX_ARRAY_LENGTH.try_into().unwrap(), 'first', 'second', 'third', 'pending', 7 ] .span(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); } #[test] @@ -1533,20 +1521,20 @@ 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 = dojo::model::Model::::selector(); + let selector = Model::::selector(); let keys = get_key_test(); let values: Span = array![1, 3, 'first', 'second', 'third', 'pending'].span(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(keys), values, layout); + world.set_entity(selector, ModelIndex::Keys(keys), values, layout); } -fn write_foo_record(world: dojo::world::IWorldDispatcher) { - let selector = dojo::model::Model::::selector(); +fn write_foo_record(world: IWorldDispatcher) { + let selector = Model::::selector(); let values = create_foo(); - let layout = dojo::model::Model::::layout(); + let layout = Model::::layout(); - world.set_entity(selector, dojo::world::ModelIndex::Keys(get_key_test()), values, layout); + world.set_entity(selector, ModelIndex::Keys(get_key_test()), values, layout); } #[test] @@ -1558,7 +1546,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_hash()); + world.grant_owner(account, Model::::namespace_hash()); starknet::testing::set_account_contract_address(account); starknet::testing::set_contract_address(contract); @@ -1574,7 +1562,7 @@ fn test_write_model_for_model_owner() { let account = starknet::contract_address_const::<0xb0b>(); let contract = starknet::contract_address_const::<0xdeadbeef>(); - world.grant_owner(account, dojo::model::Model::::selector()); + world.grant_owner(account, Model::::selector()); starknet::testing::set_account_contract_address(account); starknet::testing::set_contract_address(contract); @@ -1589,7 +1577,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_hash(), contract); + world.grant_writer(Model::::namespace_hash(), contract); // the account does not own anything starknet::testing::set_account_contract_address(account); @@ -1606,7 +1594,7 @@ fn test_write_model_for_model_writer() { let account = starknet::contract_address_const::<0xb0b>(); let contract = starknet::contract_address_const::<0xdeadbeef>(); - world.grant_writer(dojo::model::Model::::selector(), contract); + world.grant_writer(Model::::selector(), contract); // the account does not own anything starknet::testing::set_account_contract_address(account); @@ -1622,7 +1610,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_hash()); + world.grant_owner(account, Model::::namespace_hash()); // the account owns the Foo model namespace so it should be able to deploy // and register the model. @@ -1639,7 +1627,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_hash(), account); + world.grant_writer(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. @@ -1678,7 +1666,7 @@ 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")); + world.grant_owner(account, bytearray_hash(@"dojo")); // the account owns the 'test_contract' namespace so it should be able to deploy // and register the model. @@ -1695,7 +1683,7 @@ 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); + world.grant_writer(bytearray_hash(@"dojo"), account); // the account has write access to the 'test_contract' namespace so it should be able // to deploy and register the model. diff --git a/crates/dojo-core/src/utils.cairo b/crates/dojo-core/src/utils.cairo deleted file mode 100644 index ba9fb3f01b..0000000000 --- a/crates/dojo-core/src/utils.cairo +++ /dev/null @@ -1,56 +0,0 @@ -/// Compute the poseidon hash of a serialized ByteArray -pub fn hash(data: @ByteArray) -> felt252 { - let mut serialized = ArrayTrait::new(); - core::serde::Serde::serialize(data, ref serialized); - core::poseidon::poseidon_hash_span(serialized.span()) -} - -/// Computes the entity id from the keys. -/// -/// # Arguments -/// -/// * `keys` - The keys of the entity. -/// -/// # Returns -/// -/// The entity id. -pub fn entity_id_from_keys(keys: Span) -> felt252 { - core::poseidon::poseidon_hash_span(keys) -} - -/// Find the layout of a model field based on its selector. -/// -/// # Arguments -/// -/// * `model_layout` - The full model layout (must be a Layout::Struct). -/// * `member_selector` - The model field selector. -/// -/// # Returns -/// Some(Layout) if the field layout has been found, None otherwise. -pub fn find_model_field_layout( - model_layout: dojo::database::introspect::Layout, member_selector: felt252 -) -> Option { - match model_layout { - dojo::database::introspect::Layout::Struct(struct_layout) => { - let mut i = 0; - let layout = loop { - if i >= struct_layout.len() { - break Option::None; - } - - let field_layout = *struct_layout.at(i); - if field_layout.selector == member_selector { - break Option::Some(field_layout.layout); - } - i += 1; - }; - - layout - }, - _ => { - // should never happen as model layouts are always struct layouts. - core::panic_with_felt252('Unexpected model layout'); - Option::None - } - } -} diff --git a/crates/dojo-core/src/test_utils.cairo b/crates/dojo-core/src/utils/test.cairo similarity index 93% rename from crates/dojo-core/src/test_utils.cairo rename to crates/dojo-core/src/utils/test.cairo index 47093ba07a..db3975d89d 100644 --- a/crates/dojo-core/src/test_utils.cairo +++ b/crates/dojo-core/src/utils/test.cairo @@ -1,12 +1,14 @@ -use starknet::{ClassHash, ContractAddress, syscalls::deploy_syscall, get_caller_address}; use core::array::{ArrayTrait, SpanTrait}; -use core::traits::TryInto; use core::option::OptionTrait; -use core::{result::ResultTrait, traits::Into}; +use core::result::ResultTrait; +use core::traits::{Into, TryInto}; + +use starknet::{ClassHash, ContractAddress, syscalls::deploy_syscall, get_caller_address}; +use dojo::contract::base; +use dojo::model::resource_metadata; +use dojo::storage::packing::{shl, shr}; use dojo::world::{world, IWorldDispatcher, IWorldDispatcherTrait}; -use dojo::packing::{shl, shr}; -use dojo::resource_metadata::resource_metadata; /// Deploy classhash with calldata for constructor /// @@ -45,7 +47,7 @@ pub fn spawn_test_world(namespace: ByteArray, models: Array) -> IWorldD let (world_address, _) = deploy_syscall( world::TEST_CLASS_HASH.try_into().unwrap(), salt.into(), - array![dojo::base::base::TEST_CLASS_HASH].span(), + array![base::TEST_CLASS_HASH].span(), false ) .unwrap(); diff --git a/crates/dojo-core/src/utils/utils.cairo b/crates/dojo-core/src/utils/utils.cairo new file mode 100644 index 0000000000..bb43ef47fe --- /dev/null +++ b/crates/dojo-core/src/utils/utils.cairo @@ -0,0 +1,106 @@ +use core::num::traits::Zero; +use core::ops::AddAssign; +use core::option::Option; +use core::poseidon::poseidon_hash_span; +use core::serde::Serde; + +use dojo::model::{Layout, FieldLayout}; + +/// Compute the poseidon hash of a serialized ByteArray +pub fn bytearray_hash(data: @ByteArray) -> felt252 { + let mut serialized = ArrayTrait::new(); + Serde::serialize(data, ref serialized); + poseidon_hash_span(serialized.span()) +} + +/// Computes the entity id from the keys. +/// +/// # Arguments +/// +/// * `keys` - The keys of the entity. +/// +/// # Returns +/// +/// The entity id. +pub fn entity_id_from_keys(keys: Span) -> felt252 { + poseidon_hash_span(keys) +} + +/// find a field with its selector in a list of layouts +pub fn find_field_layout( + field_selector: felt252, field_layouts: Span +) -> Option { + let mut i = 0; + let layout = loop { + if i >= field_layouts.len() { + break Option::None; + } + + let field_layout = *field_layouts.at(i); + if field_selector == field_layout.selector { + break Option::Some(field_layout.layout); + } + + i += 1; + }; + + layout +} + +/// Find the layout of a model field based on its selector. +/// +/// # Arguments +/// +/// * `model_layout` - The full model layout (must be a Layout::Struct). +/// * `member_selector` - The model field selector. +/// +/// # Returns +/// Some(Layout) if the field layout has been found, None otherwise. +pub fn find_model_field_layout(model_layout: Layout, member_selector: felt252) -> Option { + match model_layout { + Layout::Struct(field_layouts) => { find_field_layout(member_selector, field_layouts) }, + _ => { + // should never happen as model layouts are always struct layouts. + core::panic_with_felt252('Unexpected model layout'); + Option::None + } + } +} + +/// Indicates if at least of array item is None. +pub fn any_none(arr: @Array>) -> bool { + let mut i = 0; + let mut res = false; + loop { + if i >= arr.len() { + break; + } + + if arr.at(i).is_none() { + res = true; + break; + } + i += 1; + }; + res +} + +/// Compute the sum of array items. +/// Note that there is no overflow check as we expect small array items. +pub fn sum, +Copy, +AddAssign, +Zero>(arr: Array>) -> T { + let mut i = 0; + let mut res = Zero::::zero(); + + loop { + if i >= arr.len() { + break res; + } + res += (*arr.at(i)).unwrap(); + i += 1; + } +} + +/// Combine parent and child keys to build one full key. +pub fn combine_key(parent_key: felt252, child_key: felt252) -> felt252 { + poseidon_hash_span(array![parent_key, child_key].span()) +} diff --git a/crates/dojo-core/src/config/component.cairo b/crates/dojo-core/src/world/config.cairo similarity index 69% rename from crates/dojo-core/src/config/component.cairo rename to crates/dojo-core/src/world/config.cairo index f0d7974938..5b97233360 100644 --- a/crates/dojo-core/src/config/component.cairo +++ b/crates/dojo-core/src/world/config.cairo @@ -1,16 +1,57 @@ +use starknet::ContractAddress; + pub mod errors { pub const INVALID_CALLER: felt252 = 'Config: not owner or operator'; pub const ALREADY_REGISTERED: felt252 = 'Config: already operator'; pub const NOT_OPERATOR: felt252 = 'Config: not operator'; } +#[starknet::interface] +pub trait IConfig { + /// Sets the information of the program that generates the + /// state transition trace (namely DojoOS). + /// + /// # Arguments + /// + /// * `program_hash` - The program hash. + /// * `config_hash` - The program's config hash. + 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). + /// + /// # Returns + /// + /// The program hash and it's configuration hash. + 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. + /// + /// # Arguments + /// + /// * `address` - The facts registry contract's address. + fn set_facts_registry(ref self: T, address: ContractAddress); + + /// Gets the facts registry contract address. + /// + /// # Returns + /// + /// The contract address of the facts registry. + fn get_facts_registry(self: @T) -> ContractAddress; +} + #[starknet::component] pub mod Config { - use dojo::config::interface::IConfig; use starknet::ContractAddress; - use super::errors; use starknet::get_caller_address; use starknet::event::EventEmitter; + use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess}; + + use super::errors; + use super::IConfig; #[event] #[derive(Drop, starknet::Event, Debug, PartialEq)] @@ -36,7 +77,7 @@ pub mod Config { } #[storage] - struct Storage { + pub struct Storage { differ_program_hash: felt252, merger_program_hash: felt252, facts_registry: ContractAddress, diff --git a/crates/dojo-core/src/interfaces.cairo b/crates/dojo-core/src/world/update.cairo similarity index 100% rename from crates/dojo-core/src/interfaces.cairo rename to crates/dojo-core/src/world/update.cairo diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world/world_contract.cairo similarity index 60% rename from crates/dojo-core/src/world.cairo rename to crates/dojo-core/src/world/world_contract.cairo index 7929bd59b4..5a9963eb1f 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world/world_contract.cairo @@ -1,15 +1,10 @@ -use starknet::{ContractAddress, ClassHash, storage_access::StorageBaseAddress, SyscallResult}; -use core::traits::{Into, TryInto}; use core::option::OptionTrait; -use dojo::resource_metadata::ResourceMetadata; - -#[derive(Copy, Drop, Serde, Debug, PartialEq)] -pub enum ModelIndex { - Keys: Span, - Id: felt252, - // (entity_id, member_id) - MemberId: (felt252, felt252) -} +use core::traits::{Into, TryInto}; +use starknet::{ContractAddress, ClassHash, storage_access::StorageBaseAddress, SyscallResult}; + +use dojo::model::{ModelIndex, ResourceMetadata}; +use dojo::model::{Layout}; +use dojo::utils::bytearray_hash; #[starknet::interface] pub trait IWorld { @@ -27,24 +22,16 @@ pub trait IWorld { fn emit(self: @T, keys: Array, values: Span); fn entity( - self: @T, - model_selector: felt252, - index: ModelIndex, - layout: dojo::database::introspect::Layout + self: @T, model_selector: felt252, index: ModelIndex, layout: Layout ) -> Span; fn set_entity( ref self: T, model_selector: felt252, index: ModelIndex, values: Span, - layout: dojo::database::introspect::Layout - ); - fn delete_entity( - ref self: T, - model_selector: felt252, - index: ModelIndex, - layout: dojo::database::introspect::Layout + layout: Layout ); + fn delete_entity(ref self: T, model_selector: felt252, index: ModelIndex, layout: Layout); fn base(self: @T) -> ClassHash; @@ -96,46 +83,48 @@ pub mod Errors { #[starknet::contract] pub mod world { - use dojo::config::interface::IConfig; - use core::to_byte_array::FormatAsByteArray; - use core::traits::TryInto; use core::array::{ArrayTrait, SpanTrait}; - use core::traits::Into; - use core::option::OptionTrait; use core::box::BoxTrait; - use starknet::event::EventEmitter; - use core::serde::Serde; use core::hash::{HashStateExTrait, HashStateTrait}; + use core::num::traits::Zero; + use core::option::OptionTrait; use core::pedersen::PedersenTrait; + use core::serde::Serde; + use core::to_byte_array::FormatAsByteArray; + use core::traits::TryInto; + use core::traits::Into; + + use starknet::event::EventEmitter; use starknet::{ contract_address_const, get_caller_address, get_contract_address, get_tx_info, ClassHash, ContractAddress, syscalls::{deploy_syscall, emit_event_syscall, replace_class_syscall}, SyscallResult, SyscallResultTrait, storage::Map, }; - use core::num::traits::Zero; + pub use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, + StoragePointerWriteAccess + }; - use dojo::database; - use dojo::database::introspect::{Introspect, Layout, FieldLayout}; - use dojo::components::upgradeable::{IUpgradeableDispatcher, IUpgradeableDispatcherTrait}; + use dojo::world::config::{Config, IConfig}; + use dojo::contract::upgradeable::{IUpgradeableDispatcher, IUpgradeableDispatcherTrait}; use dojo::contract::{IContractDispatcher, IContractDispatcherTrait}; - use dojo::config::component::Config; - use dojo::model::{Model, IModelDispatcher, IModelDispatcherTrait}; - use dojo::interfaces::{ + use dojo::world::update::{ IUpgradeableState, IFactRegistryDispatcher, IFactRegistryDispatcherTrait, StorageUpdate, ProgramOutput }; - use dojo::world::{IWorldDispatcher, IWorld, IUpgradeableWorld}; - use dojo::resource_metadata; - use dojo::resource_metadata::{ResourceMetadata, ResourceMetadataTrait}; - use dojo::utils::entity_id_from_keys; + use dojo::model::{ + Model, IModelDispatcher, IModelDispatcherTrait, Layout, ResourceMetadata, + ResourceMetadataTrait, metadata + }; + use dojo::storage; + use dojo::utils::{entity_id_from_keys, bytearray_hash}; - use super::{Errors, ModelIndex}; + use super::{ + Errors, ModelIndex, IWorldDispatcher, IWorldDispatcherTrait, IWorld, IUpgradeableWorld + }; const WORLD: felt252 = 0; - // 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); @@ -292,14 +281,12 @@ pub mod world { self .resources .write( - dojo::model::Model::::selector(), - ResourceData::Model( - (resource_metadata::initial_class_hash(), resource_metadata::initial_address()) - ) + Model::::selector(), + ResourceData::Model((metadata::initial_class_hash(), metadata::initial_address())) ); self.owners.write((WORLD, creator), true); - let dojo_namespace_hash = dojo::utils::hash(@"__DOJO__"); + let dojo_namespace_hash = bytearray_hash(@"__DOJO__"); self.resources.write(dojo_namespace_hash, ResourceData::Namespace); self.owners.write((dojo_namespace_hash, creator), true); @@ -318,10 +305,10 @@ pub mod world { /// `resource_id` - The resource id. fn metadata(self: @ContractState, resource_id: felt252) -> ResourceMetadata { let mut values = self - ._read_model_entity( - dojo::model::Model::::selector(), + .read_model_entity( + Model::::selector(), entity_id_from_keys(array![resource_id].span()), - dojo::model::Model::::layout() + Model::::layout() ); ResourceMetadataTrait::from_values(resource_id, ref values) @@ -339,7 +326,7 @@ pub mod world { ); self - ._write_model_entity( + .write_model_entity( metadata.instance_selector(), metadata.entity_id(), metadata.values(), @@ -368,9 +355,9 @@ pub 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. @@ -403,10 +390,10 @@ pub mod world { } /// 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. + /// + /// 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. /// @@ -441,7 +428,7 @@ pub mod world { } /// Revokes writer permission to the contract for the model. - /// Can only be called by an existing model writer, owner or the world admin. + /// Can only be called by an existing model owner or the world admin. /// /// Note that this resource must have been registered to the world first. /// @@ -451,19 +438,15 @@ pub mod world { /// * `contract` - The name of the contract. fn revoke_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); - let caller = get_caller_address(); - assert( - self.is_writer(resource, caller) || self.is_account_owner(resource), - Errors::NOT_OWNER_WRITER - ); self.writers.write((resource, contract), 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. @@ -481,20 +464,20 @@ pub mod world { ) -> bool { match self.resources.read(resource_id) { ResourceData::Model((_, model_address)) => self - ._check_model_write_access(resource_id, model_address, contract), + .check_model_write_access(resource_id, model_address, contract), ResourceData::Contract((_, contract_address)) => self - ._check_contract_write_access(resource_id, contract_address, contract), - ResourceData::Namespace => self._check_basic_write_access(resource_id, contract), - ResourceData::World => self._check_basic_write_access(WORLD, contract), + .check_contract_write_access(resource_id, contract_address, contract), + ResourceData::Namespace => self.check_basic_write_access(resource_id, contract), + ResourceData::World => self.check_basic_write_access(WORLD, contract), ResourceData::None => core::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. + /// + /// 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 /// @@ -509,16 +492,16 @@ pub mod world { ) -> bool { match self.resources.read(selector) { ResourceData::Model((_, model_address)) => self - ._check_model_write_access(selector, model_address, contract), + .check_model_write_access(selector, model_address, contract), _ => core::panic_with_felt252(Errors::INVALID_RESOURCE_SELECTOR) } } /// Checks if the provided contract can write to the contract. /// It panics if the resource selector is not a contract. - /// - /// Note: Contrary to `is_writer`, this function checks if the contract is a write/owner of the contract, - /// OR a write/owner of the namespace. + /// + /// Note: Contrary to `is_writer`, this function checks if the contract is a write/owner of + /// the contract, OR a write/owner of the namespace. /// /// # Arguments /// @@ -533,14 +516,14 @@ pub mod world { ) -> bool { match self.resources.read(selector) { ResourceData::Contract((_, contract_address)) => self - ._check_contract_write_access(selector, contract_address, contract), + .check_contract_write_access(selector, contract_address, contract), _ => core::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. /// @@ -556,7 +539,7 @@ pub mod world { self: @ContractState, selector: felt252, contract: ContractAddress ) -> bool { match self.resources.read(selector) { - ResourceData::Namespace => self._check_basic_write_access(selector, contract), + ResourceData::Namespace => self.check_basic_write_access(selector, contract), _ => core::panic_with_felt252(Errors::INVALID_RESOURCE_SELECTOR) } } @@ -583,7 +566,7 @@ pub mod world { core::num::traits::Zero::::zero(), ); - assert(self._is_namespace_registered(namespace_hash), Errors::NAMESPACE_NOT_REGISTERED); + assert(self.is_namespace_registered(namespace_hash), Errors::NAMESPACE_NOT_REGISTERED); assert( self.can_write_namespace(namespace_hash, get_caller_address()), Errors::NO_NAMESPACE_WRITE_ACCESS @@ -624,9 +607,9 @@ pub mod world { /// /// * `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 caller_account = self.get_account_address(); - let hash = dojo::utils::hash(@namespace); + let hash = bytearray_hash(@namespace); match self.resources.read(hash) { ResourceData::Namespace => { @@ -653,7 +636,8 @@ pub mod world { /// /// # Returns /// - /// * (`ClassHash`, `ContractAddress`) - The class hash and the contract address of the model. + /// * (`ClassHash`, `ContractAddress`) - The class hash and the contract address of the + /// model. fn model(self: @ContractState, selector: felt252) -> (ClassHash, ContractAddress) { match self.resources.read(selector) { ResourceData::Model(m) => m, @@ -697,7 +681,7 @@ pub mod world { let namespace = dispatcher.namespace(); let name = dispatcher.contract_name(); let namespace_hash = dispatcher.namespace_hash(); - assert(self._is_namespace_registered(namespace_hash), Errors::NAMESPACE_NOT_REGISTERED); + assert(self.is_namespace_registered(namespace_hash), Errors::NAMESPACE_NOT_REGISTERED); assert( self.can_write_namespace(namespace_hash, get_caller_address()), Errors::NO_NAMESPACE_WRITE_ACCESS @@ -786,22 +770,19 @@ pub mod world { /// /// * `Span` - The serialized value of the model, zero initialized if not set. fn entity( - self: @ContractState, - model_selector: felt252, - index: ModelIndex, - layout: dojo::database::introspect::Layout + self: @ContractState, model_selector: felt252, index: ModelIndex, layout: Layout ) -> Span { match index { ModelIndex::Keys(keys) => { let entity_id = entity_id_from_keys(keys); - self._read_model_entity(model_selector, entity_id, layout) + self.read_model_entity(model_selector, entity_id, layout) }, ModelIndex::Id(entity_id) => { - self._read_model_entity(model_selector, entity_id, layout) + self.read_model_entity(model_selector, entity_id, layout) }, ModelIndex::MemberId(( entity_id, member_id - )) => { self._read_model_member(model_selector, entity_id, member_id, layout) } + )) => { self.read_model_member(model_selector, entity_id, member_id, layout) } } } @@ -818,7 +799,7 @@ pub mod world { model_selector: felt252, index: ModelIndex, values: Span, - layout: dojo::database::introspect::Layout + layout: Layout ) { assert( self.can_write_model(model_selector, get_caller_address()), @@ -828,13 +809,13 @@ pub mod world { match index { ModelIndex::Keys(keys) => { let entity_id = entity_id_from_keys(keys); - self._write_model_entity(model_selector, entity_id, values, layout); + self.write_model_entity(model_selector, entity_id, values, layout); EventEmitter::emit( ref self, StoreSetRecord { table: model_selector, keys, values } ); }, ModelIndex::Id(entity_id) => { - self._write_model_entity(model_selector, entity_id, values, layout); + self.write_model_entity(model_selector, entity_id, values, layout); EventEmitter::emit( ref self, StoreUpdateRecord { table: model_selector, entity_id, values } ); @@ -842,8 +823,8 @@ pub mod world { ModelIndex::MemberId(( entity_id, member_id )) => { - self._write_model_member(model_selector, entity_id, member_id, values, layout); - // TODO: here we need a new event update and see how Torii can process that. + self.write_model_member(model_selector, entity_id, member_id, values, layout); + // TODO: here we need a new event update and see how Torii can process that. } } } @@ -857,10 +838,7 @@ pub mod world { /// * `index` - The index of the record/entity to delete. /// * `layout` - The memory layout of the model. fn delete_entity( - ref self: ContractState, - model_selector: felt252, - index: ModelIndex, - layout: dojo::database::introspect::Layout + ref self: ContractState, model_selector: felt252, index: ModelIndex, layout: Layout ) { assert( self.can_write_model(model_selector, get_caller_address()), @@ -870,13 +848,13 @@ pub mod world { match index { ModelIndex::Keys(keys) => { let entity_id = entity_id_from_keys(keys); - self._delete_model_entity(model_selector, entity_id, layout); + self.delete_model_entity(model_selector, entity_id, layout); EventEmitter::emit( ref self, StoreDelRecord { table: model_selector, entity_id } ); }, ModelIndex::Id(entity_id) => { - self._delete_model_entity(model_selector, entity_id, layout); + self.delete_model_entity(model_selector, entity_id, layout); EventEmitter::emit( ref self, StoreDelRecord { table: model_selector, entity_id } ); @@ -982,7 +960,7 @@ pub mod world { #[generate_trait] impl Self of SelfTrait { #[inline(always)] - fn _get_account_address(self: @ContractState) -> ContractAddress { + fn get_account_address(self: @ContractState) -> ContractAddress { get_tx_info().unbox().account_contract_address } @@ -995,11 +973,12 @@ pub mod world { /// /// # Returns /// - /// * `bool` - True if the calling account is the owner of the resource or the owner of the world, + /// * `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) + IWorld::is_owner(self, self.get_account_address(), resource) || self.is_account_world_owner() } @@ -1015,7 +994,7 @@ pub mod world { /// false otherwise. #[inline(always)] fn is_account_writer(self: @ContractState, resource: felt252) -> bool { - IWorld::is_writer(self, resource, self._get_account_address()) + IWorld::is_writer(self, resource, self.get_account_address()) } /// Verifies if the calling account is the world owner. @@ -1025,12 +1004,12 @@ pub mod world { /// * `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) + 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_hash: felt252) -> bool { + fn is_namespace_registered(self: @ContractState, namespace_hash: felt252) -> bool { match self.resources.read(namespace_hash) { ResourceData::Namespace => true, _ => false @@ -1043,16 +1022,16 @@ pub mod world { /// - 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_selector` - 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( + /// + fn check_model_write_access( self: @ContractState, model_selector: felt252, model_address: ContractAddress, @@ -1062,7 +1041,7 @@ pub mod world { && !self.is_account_owner(model_selector) && !self.is_account_writer(model_selector) { let model = IModelDispatcher { contract_address: model_address }; - self._check_basic_write_access(model.namespace_hash(), contract) + self.check_basic_write_access(model.namespace_hash(), contract) } else { true } @@ -1074,16 +1053,16 @@ pub mod world { /// - the calling account has the owner and/or writer role for the contract OR, /// - the calling contract has the writer role for the contract namespace OR /// - the calling account has the owner and/or writer role for the model namespace. - /// + /// /// # Arguments /// * `contract_selector` - the contract selector to check. /// * `contract_address` - the contract contract address. /// * `contract` - the calling contract. - /// + /// /// # Returns /// `true` if the write access is allowed, false otherwise. - /// - fn _check_contract_write_access( + /// + fn check_contract_write_access( self: @ContractState, contract_selector: felt252, contract_address: ContractAddress, @@ -1093,7 +1072,7 @@ pub mod world { && !self.is_account_owner(contract_selector) && !self.is_account_writer(contract_selector) { let dispatcher = IContractDispatcher { contract_address }; - self._check_basic_write_access(dispatcher.namespace_hash(), contract) + self.check_basic_write_access(dispatcher.namespace_hash(), contract) } else { true } @@ -1103,15 +1082,15 @@ pub mod world { /// 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( + /// + fn check_basic_write_access( self: @ContractState, resource_id: felt252, contract: ContractAddress ) -> bool { self.is_writer(resource_id, contract) @@ -1126,23 +1105,23 @@ pub mod world { /// * `entity_id` - the id used to identify the record /// * `values` - the field values of the record /// * `layout` - the model layout - fn _write_model_entity( + fn write_model_entity( ref self: ContractState, model_selector: felt252, entity_id: felt252, values: Span, - layout: dojo::database::introspect::Layout + layout: Layout ) { let mut offset = 0; match layout { Layout::Fixed(layout) => { - Self::_write_fixed_layout( + storage::layout::write_fixed_layout( model_selector, entity_id, values, ref offset, layout ); }, Layout::Struct(layout) => { - Self::_write_struct_layout( + storage::layout::write_struct_layout( model_selector, entity_id, values, ref offset, layout ); }, @@ -1156,18 +1135,15 @@ pub mod world { /// * `model_selector` - the model selector /// * `entity_id` - the ID of the entity to remove. /// * `layout` - the model layout - fn _delete_model_entity( - ref self: ContractState, - model_selector: felt252, - entity_id: felt252, - layout: dojo::database::introspect::Layout + fn delete_model_entity( + ref self: ContractState, model_selector: felt252, entity_id: felt252, layout: Layout ) { match layout { Layout::Fixed(layout) => { - Self::_delete_fixed_layout(model_selector, entity_id, layout); + storage::layout::delete_fixed_layout(model_selector, entity_id, layout); }, Layout::Struct(layout) => { - Self::_delete_struct_layout(model_selector, entity_id, layout); + storage::layout::delete_struct_layout(model_selector, entity_id, layout); }, _ => { panic!("Unexpected layout type for a model."); } }; @@ -1179,20 +1155,21 @@ pub mod world { /// * `model_selector` - the model selector /// * `entity_id` - the ID of the entity to read. /// * `layout` - the model layout - fn _read_model_entity( - self: @ContractState, - model_selector: felt252, - entity_id: felt252, - layout: dojo::database::introspect::Layout + fn read_model_entity( + self: @ContractState, model_selector: felt252, entity_id: felt252, layout: Layout ) -> Span { let mut read_data = ArrayTrait::::new(); match layout { Layout::Fixed(layout) => { - Self::_read_fixed_layout(model_selector, entity_id, ref read_data, layout); + storage::layout::read_fixed_layout( + model_selector, entity_id, ref read_data, layout + ); }, Layout::Struct(layout) => { - Self::_read_struct_layout(model_selector, entity_id, ref read_data, layout); + storage::layout::read_struct_layout( + model_selector, entity_id, ref read_data, layout + ); }, _ => { panic!("Unexpected layout type for a model."); } }; @@ -1205,18 +1182,21 @@ pub mod world { /// # Arguments /// * `model_selector` - the model selector /// * `entity_id` - the ID of the entity for which to read a member. - /// * `member_id` - the selector of the model member to read. + /// * `member_id` - the selector of the model member to read. /// * `layout` - the model layout - fn _read_model_member( + fn read_model_member( self: @ContractState, model_selector: felt252, entity_id: felt252, member_id: felt252, - layout: dojo::database::introspect::Layout + layout: Layout ) -> Span { let mut read_data = ArrayTrait::::new(); - Self::_read_layout( - model_selector, Self::_combine_key(entity_id, member_id), ref read_data, layout + storage::layout::read_layout( + model_selector, + dojo::utils::combine_key(entity_id, member_id), + ref read_data, + layout ); read_data.span() @@ -1228,559 +1208,24 @@ pub mod world { /// * `model_selector` - the model selector /// * `entity_id` - the ID of the entity for which to write a member. /// * `member_id` - the selector of the model member to write. - /// * `values` - the new member value. + /// * `values` - the new member value. /// * `layout` - the model layout - fn _write_model_member( + fn write_model_member( self: @ContractState, model_selector: felt252, entity_id: felt252, member_id: felt252, values: Span, - layout: dojo::database::introspect::Layout + layout: Layout ) { let mut offset = 0; - Self::_write_layout( - model_selector, Self::_combine_key(entity_id, member_id), values, ref offset, layout + storage::layout::write_layout( + model_selector, + dojo::utils::combine_key(entity_id, member_id), + values, + ref offset, + layout ) } - - /// Combine parent and child keys to build one full key. - fn _combine_key(parent_key: felt252, child_key: felt252) -> felt252 { - core::poseidon::poseidon_hash_span(array![parent_key, child_key].span()) - } - - /// Append some values to an array. - /// - /// # Arguments - /// * `dest` - the array to extend - /// * `values` - the values to append to the array - fn _append_array(ref dest: Array, values: Span) { - let mut i = 0; - loop { - if i >= values.len() { - break; - } - dest.append(*values.at(i)); - i += 1; - }; - } - - fn _find_variant_layout( - variant: felt252, variant_layouts: Span - ) -> Option { - let mut i = 0; - let layout = loop { - if i >= variant_layouts.len() { - break Option::None; - } - - let variant_layout = *variant_layouts.at(i); - if variant == variant_layout.selector { - break Option::Some(variant_layout.layout); - } - - i += 1; - }; - - layout - } - - /// Write values to the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the object key. - /// * `values` - the object values. - /// * `offset` - the start of object values in the `values` parameter. - /// * `layout` - the object values layout. - fn _write_layout( - model: felt252, key: felt252, values: Span, ref offset: u32, layout: Layout, - ) { - match layout { - Layout::Fixed(layout) => { - Self::_write_fixed_layout(model, key, values, ref offset, layout); - }, - Layout::Struct(layout) => { - Self::_write_struct_layout(model, key, values, ref offset, layout); - }, - Layout::Array(layout) => { - Self::_write_array_layout(model, key, values, ref offset, layout); - }, - Layout::Tuple(layout) => { - Self::_write_tuple_layout(model, key, values, ref offset, layout); - }, - Layout::ByteArray => { - Self::_write_byte_array_layout(model, key, values, ref offset); - }, - Layout::Enum(layout) => { - Self::_write_enum_layout(model, key, values, ref offset, layout); - } - } - } - - /// Write fixed layout model record to the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the model record key. - /// * `values` - the model record values. - /// * `offset` - the start of model record values in the `values` parameter. - /// * `layout` - the model record layout. - fn _write_fixed_layout( - model: felt252, key: felt252, values: Span, ref offset: u32, layout: Span - ) { - database::set(model, key, values, offset, layout); - offset += layout.len(); - } - - /// Write array layout model record to the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the model record key. - /// * `values` - the model record values. - /// * `offset` - the start of model record values in the `values` parameter. - /// * `item_layout` - the model record layout (temporary a Span because of type recursion issue). - fn _write_array_layout( - model: felt252, - key: felt252, - values: Span, - ref offset: u32, - item_layout: Span - ) { - assert((values.len() - offset) > 0, 'Invalid values length'); - - // first, read array size which is the first felt252 from values - let array_len = *values.at(offset); - assert(array_len.into() <= dojo::database::MAX_ARRAY_LENGTH, 'invalid array length'); - let array_len: u32 = array_len.try_into().unwrap(); - - // then, write the array size - database::set(model, key, values, offset, array![251].span()); - offset += 1; - - // and then, write array items - let item_layout = *item_layout.at(0); - - let mut i = 0; - loop { - if i >= array_len { - break; - } - let key = Self::_combine_key(key, i.into()); - - Self::_write_layout(model, key, values, ref offset, item_layout); - - i += 1; - }; - } - - /// - fn _write_byte_array_layout( - model: felt252, key: felt252, values: Span, ref offset: u32 - ) { - // The ByteArray internal structure is - // struct ByteArray { - // 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 - assert((values.len() - offset) >= MIN_BYTE_ARRAY_SIZE, 'Invalid values length'); - - let data_len = *values.at(offset); - assert( - data_len.into() <= (dojo::database::MAX_ARRAY_LENGTH - MIN_BYTE_ARRAY_SIZE.into()), - 'invalid array length' - ); - - let array_size: u32 = data_len.try_into().unwrap() + MIN_BYTE_ARRAY_SIZE.into(); - assert((values.len() - offset) >= array_size, 'Invalid values length'); - - database::set_array(model, key, values, offset, array_size); - offset += array_size; - } - - /// Write struct layout model record to the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the model record key. - /// * `values` - the model record values. - /// * `offset` - the start of model record values in the `values` parameter. - /// * `layout` - list of field layouts. - fn _write_struct_layout( - model: felt252, - key: felt252, - values: Span, - ref offset: u32, - layout: Span - ) { - let mut i = 0; - loop { - if i >= layout.len() { - break; - } - - let field_layout = *layout.at(i); - let field_key = Self::_combine_key(key, field_layout.selector); - - Self::_write_layout(model, field_key, values, ref offset, field_layout.layout); - - i += 1; - } - } - - /// Write tuple layout model record to the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the model record key. - /// * `values` - the model record values. - /// * `offset` - the start of model record values in the `values` parameter. - /// * `layout` - list of tuple item layouts. - fn _write_tuple_layout( - model: felt252, - key: felt252, - values: Span, - ref offset: u32, - layout: Span - ) { - let mut i = 0; - loop { - if i >= layout.len() { - break; - } - - let field_layout = *layout.at(i); - let key = Self::_combine_key(key, i.into()); - - Self::_write_layout(model, key, values, ref offset, field_layout); - - i += 1; - }; - } - - fn _write_enum_layout( - model: felt252, - key: felt252, - values: Span, - ref offset: u32, - variant_layouts: Span - ) { - // first, get the variant value from `values`` - 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::_combine_key(key, variant); - - match Self::_find_variant_layout(variant, variant_layouts) { - Option::Some(layout) => Self::_write_layout( - model, variant_data_key, values, ref offset, layout - ), - Option::None => panic!("Unable to find the variant layout") - }; - } - - /// Delete a fixed layout model record from the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the model record key. - /// * `layout` - the model layout - fn _delete_fixed_layout(model: felt252, key: felt252, layout: Span) { - database::delete(model, key, layout); - } - - /// Delete an array layout model record from the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the model record key. - fn _delete_array_layout(model: felt252, key: felt252) { - // just set the array length to 0 - database::delete(model, key, array![251].span()); - } - - /// - fn _delete_byte_array_layout(model: felt252, key: felt252) { - // The ByteArray internal structure is - // struct ByteArray { - // 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) - database::delete(model, key, array![251, 251, 251].span()); - } - - /// Delete a model record from the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the model record key. - /// * `layout` - the model layout - fn _delete_layout(model: felt252, key: felt252, layout: Layout) { - match layout { - Layout::Fixed(layout) => { Self::_delete_fixed_layout(model, key, layout); }, - Layout::Struct(layout) => { Self::_delete_struct_layout(model, key, layout); }, - Layout::Array(_) => { Self::_delete_array_layout(model, key); }, - Layout::Tuple(layout) => { Self::_delete_tuple_layout(model, key, layout); }, - Layout::ByteArray => { Self::_delete_byte_array_layout(model, key); }, - Layout::Enum(layout) => { Self::_delete_enum_layout(model, key, layout); } - } - } - - /// Delete a struct layout model record from the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the model record key. - /// * `layout` - list of field layouts. - fn _delete_struct_layout(model: felt252, key: felt252, layout: Span) { - let mut i = 0; - loop { - if i >= layout.len() { - break; - } - - let field_layout = *layout.at(i); - let key = Self::_combine_key(key, field_layout.selector); - - Self::_delete_layout(model, key, field_layout.layout); - - i += 1; - } - } - - /// Delete a tuple layout model record from the world storage. - /// - /// # Arguments - /// * `model` - the model selector. - /// * `key` - the model record key. - /// * `layout` - list of tuple item layouts. - fn _delete_tuple_layout(model: felt252, key: felt252, layout: Span) { - let mut i = 0; - loop { - if i >= layout.len() { - break; - } - - let field_layout = *layout.at(i); - let key = Self::_combine_key(key, i.into()); - - Self::_delete_layout(model, key, field_layout); - - i += 1; - } - } - - fn _delete_enum_layout(model: felt252, key: felt252, variant_layouts: Span) { - // 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::_combine_key(key, variant); - - match Self::_find_variant_layout(variant, variant_layouts) { - Option::Some(layout) => Self::_delete_layout(model, variant_data_key, layout), - Option::None => panic!("Unable to find the variant layout") - }; - } - - /// Read a model record. - /// - /// # Arguments - /// * `model` - the model selector - /// * `key` - model record key. - /// * `read_data` - the read data. - /// * `layout` - the model layout - fn _read_layout( - model: felt252, key: felt252, ref read_data: Array, layout: Layout - ) { - match layout { - Layout::Fixed(layout) => Self::_read_fixed_layout( - model, key, ref read_data, layout - ), - Layout::Struct(layout) => Self::_read_struct_layout( - model, key, ref read_data, layout - ), - Layout::Array(layout) => Self::_read_array_layout( - model, key, ref read_data, layout - ), - Layout::Tuple(layout) => Self::_read_tuple_layout( - model, key, ref read_data, layout - ), - Layout::ByteArray => Self::_read_byte_array_layout(model, key, ref read_data), - Layout::Enum(layout) => Self::_read_enum_layout(model, key, ref read_data, layout), - }; - } - - /// Read a fixed layout model record. - /// - /// # Arguments - /// * `model` - the model selector - /// * `key` - model record key. - /// * `read_data` - the read data. - /// * `layout` - the model layout - fn _read_fixed_layout( - model: felt252, key: felt252, ref read_data: Array, layout: Span - ) { - let data = database::get(model, key, layout); - Self::_append_array(ref read_data, data); - } - - /// Read an array layout model record. - /// - /// # Arguments - /// * `model` - the model selector - /// * `key` - model record key. - /// * `read_data` - the read data. - /// * `layout` - the array item layout - fn _read_array_layout( - model: felt252, key: felt252, ref read_data: Array, layout: Span - ) { - // read number of array items - let res = database::get(model, key, array![251].span()); - assert(res.len() == 1, 'internal database error'); - - let array_len = *res.at(0); - assert(array_len.into() <= dojo::database::MAX_ARRAY_LENGTH, 'invalid array length'); - - read_data.append(array_len); - - let item_layout = *layout.at(0); - let array_len: u32 = array_len.try_into().unwrap(); - - let mut i = 0; - loop { - if i >= array_len { - break; - } - - let field_key = Self::_combine_key(key, i.into()); - Self::_read_layout(model, field_key, ref read_data, item_layout); - - i += 1; - }; - } - - /// - fn _read_byte_array_layout(model: felt252, key: felt252, ref read_data: Array) { - // The ByteArray internal structure is - // struct ByteArray { - // data: Array, - // pending_word: felt252, - // pending_word_len: usize, - // } - // - // So, read the length of data and compute the full size to read - - let res = database::get(model, key, array![251].span()); - assert(res.len() == 1, 'internal database error'); - - let data_len = *res.at(0); - assert( - data_len.into() <= (dojo::database::MAX_ARRAY_LENGTH - MIN_BYTE_ARRAY_SIZE.into()), - 'invalid array length' - ); - - let array_size: u32 = data_len.try_into().unwrap() + MIN_BYTE_ARRAY_SIZE; - - let data = database::get_array(model, key, array_size); - - Self::_append_array(ref read_data, data); - } - - /// Read a struct layout model record. - /// - /// # Arguments - /// * `model` - the model selector - /// * `key` - model record key. - /// * `read_data` - the read data. - /// * `layout` - the list of field layouts. - fn _read_struct_layout( - model: felt252, key: felt252, ref read_data: Array, layout: Span - ) { - let mut i = 0; - loop { - if i >= layout.len() { - break; - } - - let field_layout = *layout.at(i); - let field_key = Self::_combine_key(key, field_layout.selector); - - Self::_read_layout(model, field_key, ref read_data, field_layout.layout); - - i += 1; - } - } - - /// Read a tuple layout model record. - /// - /// # Arguments - /// * `model` - the model selector - /// * `key` - model record key. - /// * `read_data` - the read data. - /// * `layout` - the tuple item layouts - fn _read_tuple_layout( - model: felt252, key: felt252, ref read_data: Array, layout: Span - ) { - let mut i = 0; - loop { - if i >= layout.len() { - break; - } - - let field_layout = *layout.at(i); - let field_key = Self::_combine_key(key, i.into()); - Self::_read_layout(model, field_key, ref read_data, field_layout); - - i += 1; - }; - } - - fn _read_enum_layout( - model: felt252, - key: felt252, - ref read_data: Array, - variant_layouts: 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'); - - read_data.append(variant); - - // find the corresponding layout and the read the variant data - let variant_data_key = Self::_combine_key(key, variant); - - match Self::_find_variant_layout(variant, variant_layouts) { - 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/contract.rs b/crates/dojo-lang/src/contract.rs index 4f8cca2aae..03644daf56 100644 --- a/crates/dojo-lang/src/contract.rs +++ b/crates/dojo-lang/src/contract.rs @@ -167,12 +167,16 @@ impl DojoContract { use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, \ + StoragePointerWriteAccess + }; - component!(path: dojo::components::upgradeable::upgradeable, storage: \ + component!(path: dojo::contract::upgradeable::upgradeable, storage: \ upgradeable, event: UpgradeableEvent); #[abi(embed_v0)] - impl ContractImpl of IContract { + pub impl ContractImpl of IContract { fn contract_name(self: @ContractState) -> ByteArray { \"$name$\" } @@ -207,7 +211,7 @@ impl DojoContract { #[abi(embed_v0)] impl UpgradableImpl = \ - dojo::components::upgradeable::upgradeable::UpgradableImpl; + dojo::contract::upgradeable::upgradeable::UpgradableImpl; $body$ } @@ -362,7 +366,7 @@ impl DojoContract { #[event] #[derive(Drop, starknet::Event)] enum Event { - UpgradeableEvent: dojo::components::upgradeable::upgradeable::Event, + UpgradeableEvent: dojo::contract::upgradeable::upgradeable::Event, $variants$ } ", @@ -377,7 +381,7 @@ impl DojoContract { #[event] #[derive(Drop, starknet::Event)] enum Event { - UpgradeableEvent: dojo::components::upgradeable::upgradeable::Event, + UpgradeableEvent: dojo::contract::upgradeable::upgradeable::Event, } " .to_string(), @@ -402,7 +406,7 @@ impl DojoContract { struct Storage { world_dispatcher: IWorldDispatcher, #[substorage(v0)] - upgradeable: dojo::components::upgradeable::upgradeable::Storage, + upgradeable: dojo::contract::upgradeable::upgradeable::Storage, $members$ } ", @@ -418,7 +422,7 @@ impl DojoContract { struct Storage { world_dispatcher: IWorldDispatcher, #[substorage(v0)] - upgradeable: dojo::components::upgradeable::upgradeable::Storage, + upgradeable: dojo::contract::upgradeable::upgradeable::Storage, } " .to_string(), diff --git a/crates/dojo-lang/src/introspect/layout.rs b/crates/dojo-lang/src/introspect/layout.rs index 9a8b929965..7d0edf781c 100644 --- a/crates/dojo-lang/src/introspect/layout.rs +++ b/crates/dojo-lang/src/introspect/layout.rs @@ -30,7 +30,7 @@ pub fn build_field_layouts( let field_selector = get_selector_from_name(&field_name.to_string()).unwrap(); let field_layout = get_layout_from_type_clause(db, diagnostics, &m.type_clause(db)); Some(format!( - "dojo::database::introspect::FieldLayout {{ + "dojo::model::FieldLayout {{ selector: {field_selector}, layout: {field_layout} }}" @@ -57,7 +57,7 @@ pub fn build_variant_layouts( let variant_layout = match v.type_clause(db) { OptionTypeClause::Empty(_) => { - "dojo::database::introspect::Layout::Fixed(array![].span())".to_string() + "dojo::model::Layout::Fixed(array![].span())".to_string() } OptionTypeClause::TypeClause(type_clause) => { get_layout_from_type_clause(db, diagnostics, &type_clause) @@ -65,7 +65,7 @@ pub fn build_variant_layouts( }; format!( - "dojo::database::introspect::FieldLayout {{ + "dojo::model::FieldLayout {{ selector: {selector}, layout: {variant_layout} }}" @@ -112,7 +112,7 @@ pub fn build_array_layout_from_type( if is_tuple(&array_item_type) { format!( - "dojo::database::introspect::Layout::Array( + "dojo::model::Layout::Array( array![ {} ].span() @@ -121,7 +121,7 @@ pub fn build_array_layout_from_type( ) } else if is_array(&array_item_type) { format!( - "dojo::database::introspect::Layout::Array( + "dojo::model::Layout::Array( array![ {} ].span() @@ -129,7 +129,7 @@ pub fn build_array_layout_from_type( build_array_layout_from_type(diagnostics, diagnostic_item, &array_item_type) ) } else { - format!("dojo::database::introspect::Introspect::<{}>::layout()", item_type) + format!("dojo::model::introspect::Introspect::<{}>::layout()", item_type) } } @@ -146,7 +146,7 @@ pub fn build_tuple_layout_from_type( .collect::>() .join(",\n"); format!( - "dojo::database::introspect::Layout::Tuple( + "dojo::model::Layout::Tuple( array![ {} ].span() @@ -176,12 +176,12 @@ pub fn build_item_layout_from_type( }); } - format!("dojo::database::introspect::Introspect::<{}>::layout()", item_type) + format!("dojo::model::introspect::Introspect::<{}>::layout()", item_type) } } pub fn is_custom_layout(layout: &str) -> bool { - layout.starts_with("dojo::database::introspect::Introspect::") + layout.starts_with("dojo::model::introspect::Introspect::") } pub fn build_packed_struct_layout( @@ -207,7 +207,7 @@ pub fn build_packed_struct_layout( generate_cairo_code_for_fixed_layout_with_custom_types(&layouts) } else { format!( - "dojo::database::introspect::Layout::Fixed( + "dojo::model::Layout::Fixed( array![ {} ].span() @@ -224,7 +224,7 @@ pub fn generate_cairo_code_for_fixed_layout_with_custom_types(layouts: &[String] if is_custom_layout(l) { l.to_string() } else { - format!("dojo::database::introspect::Layout::Fixed(array![{l}].span())") + format!("dojo::model::Layout::Fixed(array![{l}].span())") } }) .collect::>() @@ -240,7 +240,7 @@ pub fn generate_cairo_code_for_fixed_layout_with_custom_types(layouts: &[String] match ArrayTrait::pop_front(ref layouts) {{ Option::Some(mut layout) => {{ match layout {{ - dojo::database::introspect::Layout::Fixed(mut l) => {{ + dojo::model::Layout::Fixed(mut l) => {{ loop {{ match SpanTrait::pop_front(ref l) {{ Option::Some(x) => merged_layout.append(*x), @@ -255,7 +255,7 @@ pub fn generate_cairo_code_for_fixed_layout_with_custom_types(layouts: &[String] }}; }}; - dojo::database::introspect::Layout::Fixed(merged_layout.span()) + dojo::model::Layout::Fixed(merged_layout.span()) ", ) } @@ -288,7 +288,7 @@ pub fn build_packed_enum_layout( generate_cairo_code_for_fixed_layout_with_custom_types(&variant_layout) } else { format!( - "dojo::database::introspect::Layout::Fixed( + "dojo::model::Layout::Fixed( array![ {} ].span() @@ -352,7 +352,7 @@ pub fn get_packed_item_layout_from_type( // 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)] + vec![format!("dojo::model::introspect::Introspect::<{}>::layout()", item_type)] } } } diff --git a/crates/dojo-lang/src/introspect/mod.rs b/crates/dojo-lang/src/introspect/mod.rs index 856c3477e0..3fc4f244e7 100644 --- a/crates/dojo-lang/src/introspect/mod.rs +++ b/crates/dojo-lang/src/introspect/mod.rs @@ -28,7 +28,7 @@ pub fn handle_introspect_struct( layout::build_packed_struct_layout(db, diagnostics, &struct_ast) } else { format!( - "dojo::database::introspect::Layout::Struct( + "dojo::model::Layout::Struct( array![ {} ].span() @@ -66,7 +66,7 @@ pub fn handle_introspect_enum( } } else { format!( - "dojo::database::introspect::Layout::Enum( + "dojo::model::Layout::Enum( array![ {} ].span() @@ -94,19 +94,19 @@ fn generate_introspect( ) -> RewriteNode { RewriteNode::interpolate_patched( " -impl $name$Introspect<$generics$> of \ - dojo::database::introspect::Introspect<$name$<$generics_types$>> { +impl $name$Introspect<$generics$> of dojo::model::introspect::Introspect<$name$<$generics_types$>> \ + { #[inline(always)] fn size() -> Option { $size$ } - fn layout() -> dojo::database::introspect::Layout { + fn layout() -> dojo::model::Layout { $layout$ } #[inline(always)] - fn ty() -> dojo::database::introspect::Ty { + fn ty() -> dojo::model::introspect::Ty { $ty$ } } @@ -148,7 +148,7 @@ fn build_generic_types_and_impls( let generic_impls = generic_types .iter() - .map(|g| format!("{g}, impl {g}Introspect: dojo::database::introspect::Introspect<{g}>")) + .map(|g| format!("{g}, impl {g}Introspect: dojo::model::introspect::Introspect<{g}>")) .collect::>() .join(", "); diff --git a/crates/dojo-lang/src/introspect/size.rs b/crates/dojo-lang/src/introspect/size.rs index 9c056897bf..e1a49ca880 100644 --- a/crates/dojo-lang/src/introspect/size.rs +++ b/crates/dojo-lang/src/introspect/size.rs @@ -114,7 +114,7 @@ pub fn build_size_function_body( let none_check = if is_packed { "" } else { - "if dojo::database::utils::any_none(@sizes) { + "if dojo::utils::any_none(@sizes) { return Option::None; }" }; @@ -125,7 +125,7 @@ pub fn build_size_function_body( ]; {none_check} - Option::Some(dojo::database::utils::sum(sizes)) + Option::Some(dojo::utils::sum(sizes)) ", sizes.join(",\n") ) @@ -187,7 +187,7 @@ pub fn compute_item_size_from_type(item_type: &String) -> Vec { if let Some(p) = primitives.get(item_type) { vec![p.0.to_string()] } else { - vec![format!("dojo::database::introspect::Introspect::<{}>::size()", item_type)] + vec![format!("dojo::model::introspect::Introspect::<{}>::size()", item_type)] } } } diff --git a/crates/dojo-lang/src/introspect/ty.rs b/crates/dojo-lang/src/introspect/ty.rs index 85c7fbde72..8c87fc151f 100644 --- a/crates/dojo-lang/src/introspect/ty.rs +++ b/crates/dojo-lang/src/introspect/ty.rs @@ -16,8 +16,8 @@ pub fn build_struct_ty(db: &dyn SyntaxGroup, name: &String, struct_ast: &ItemStr .collect::>(); format!( - "dojo::database::introspect::Ty::Struct( - dojo::database::introspect::Struct {{ + "dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct {{ name: '{name}', attrs: array![].span(), children: array![ @@ -39,8 +39,8 @@ pub fn build_enum_ty(db: &dyn SyntaxGroup, name: &String, enum_ast: &ItemEnum) - }; format!( - "dojo::database::introspect::Ty::Enum( - dojo::database::introspect::Enum {{ + "dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum {{ name: '{name}', attrs: array![].span(), children: array![ @@ -56,7 +56,7 @@ pub fn build_member_ty(db: &dyn SyntaxGroup, member: &Member) -> String { let attrs = if member.has_attr(db, "key") { vec!["'key'"] } else { vec![] }; format!( - "dojo::database::introspect::Member {{ + "dojo::model::introspect::Member {{ name: '{name}', attrs: array![{}].span(), ty: {} @@ -71,7 +71,7 @@ pub fn build_variant_ty(db: &dyn SyntaxGroup, variant: &Variant) -> String { match variant.type_clause(db) { OptionTypeClause::Empty(_) => { // use an empty tuple if the variant has no data - format!("('{name}', dojo::database::introspect::Ty::Tuple(array![].span()))") + format!("('{name}', dojo::model::introspect::Ty::Tuple(array![].span()))") } OptionTypeClause::TypeClause(type_clause) => { format!("('{name}', {})", build_ty_from_type_clause(db, &type_clause)) @@ -100,7 +100,7 @@ pub fn build_item_ty_from_type(item_type: &String) -> String { if is_array(item_type) { let array_item_type = get_array_item_type(item_type); format!( - "dojo::database::introspect::Ty::Array( + "dojo::model::introspect::Ty::Array( array![ {} ].span() @@ -108,11 +108,11 @@ pub fn build_item_ty_from_type(item_type: &String) -> String { build_item_ty_from_type(&array_item_type) ) } else if is_byte_array(item_type) { - "dojo::database::introspect::Ty::ByteArray".to_string() + "dojo::model::introspect::Ty::ByteArray".to_string() } else if is_tuple(item_type) { build_tuple_ty_from_type(item_type) } else { - format!("dojo::database::introspect::Introspect::<{}>::ty()", item_type) + format!("dojo::model::introspect::Introspect::<{}>::ty()", item_type) } } @@ -123,7 +123,7 @@ pub fn build_tuple_ty_from_type(item_type: &str) -> String { .collect::>() .join(",\n"); format!( - "dojo::database::introspect::Ty::Tuple( + "dojo::model::introspect::Ty::Tuple( array![ {} ].span() diff --git a/crates/dojo-lang/src/manifest_test_data/cairo_v240 b/crates/dojo-lang/src/manifest_test_data/cairo_v240 index 95f527c50a..acedda39ab 100644 --- a/crates/dojo-lang/src/manifest_test_data/cairo_v240 +++ b/crates/dojo-lang/src/manifest_test_data/cairo_v240 @@ -27,7 +27,7 @@ test_compiler_cairo_v240 }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::resource_metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -78,7 +78,7 @@ test_compiler_cairo_v240 ], "outputs": [ { - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::resource_metadata::ResourceMetadata" } ], "state_mutability": "view" @@ -89,7 +89,7 @@ test_compiler_cairo_v240 "inputs": [ { "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::resource_metadata::ResourceMetadata" } ], "outputs": [], @@ -709,11 +709,11 @@ test_compiler_cairo_v240 { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -736,7 +736,7 @@ test_compiler_cairo_v240 }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -748,12 +748,12 @@ test_compiler_cairo_v240 }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -765,7 +765,7 @@ test_compiler_cairo_v240 "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] @@ -773,7 +773,7 @@ test_compiler_cairo_v240 ] }, "resource_metadata": { - "name": "dojo::resource_metadata::resource_metadata", + "name": "dojo::model::resource_metadata::resource_metadata", "address": null, "class_hash": "0x6a2f06cde4aad60e0b6dd595edebe8dca1fbefe5b36cfc2f46a1d1159757df9", "abi": [ @@ -853,7 +853,7 @@ test_compiler_cairo_v240 }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -881,7 +881,7 @@ test_compiler_cairo_v240 }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -899,7 +899,7 @@ test_compiler_cairo_v240 }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -907,11 +907,11 @@ test_compiler_cairo_v240 }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", @@ -929,14 +929,14 @@ test_compiler_cairo_v240 "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::resource_metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -954,7 +954,7 @@ test_compiler_cairo_v240 "inputs": [ { "name": "model", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::resource_metadata::ResourceMetadata" } ], "outputs": [], @@ -962,7 +962,7 @@ test_compiler_cairo_v240 }, { "type": "event", - "name": "dojo::resource_metadata::resource_metadata::Event", + "name": "dojo::model::resource_metadata::resource_metadata::Event", "kind": "enum", "variants": [] } 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 13344c00dc..009677738f 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 @@ -1,7 +1,7 @@ [package] name = "compiler_cairo" version = "0.1.0" -edition = "2023_11" +edition = "2024_07" cairo-version = "2.7.0-rc.3" # See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json index ee9ceaac66..4800464226 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json @@ -2,11 +2,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -16,7 +16,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -24,7 +24,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -34,11 +34,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -61,7 +61,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -73,24 +73,24 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::base::base::Event", + "name": "dojo::contract::base_contract::base::Event", "kind": "enum", "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "flat" } ] diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json index fe02b53f14..5620aa6fb5 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "World", - "interface_name": "dojo::world::IWorld" + "interface_name": "dojo::world::world_contract::IWorld" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -48,7 +48,7 @@ }, { "type": "enum", - "name": "dojo::world::ModelIndex", + "name": "dojo::model::model::ModelIndex", "variants": [ { "name": "Keys", @@ -76,7 +76,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -84,33 +84,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -118,15 +118,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -134,7 +134,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -154,7 +154,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorld", + "name": "dojo::world::world_contract::IWorld", "items": [ { "type": "function", @@ -167,7 +167,7 @@ ], "outputs": [ { - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "state_mutability": "view" @@ -178,7 +178,7 @@ "inputs": [ { "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "outputs": [], @@ -321,11 +321,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [ @@ -345,7 +345,7 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "values", @@ -353,7 +353,7 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -369,11 +369,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -579,11 +579,11 @@ { "type": "impl", "name": "UpgradeableWorld", - "interface_name": "dojo::world::IUpgradeableWorld" + "interface_name": "dojo::world::world_contract::IUpgradeableWorld" }, { "type": "interface", - "name": "dojo::world::IUpgradeableWorld", + "name": "dojo::world::world_contract::IUpgradeableWorld", "items": [ { "type": "function", @@ -602,11 +602,11 @@ { "type": "impl", "name": "UpgradeableState", - "interface_name": "dojo::interfaces::IUpgradeableState" + "interface_name": "dojo::world::update::IUpgradeableState" }, { "type": "struct", - "name": "dojo::interfaces::StorageUpdate", + "name": "dojo::world::update::StorageUpdate", "members": [ { "name": "key", @@ -620,17 +620,17 @@ }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::interfaces::ProgramOutput", + "name": "dojo::world::update::ProgramOutput", "members": [ { "name": "prev_state_root", @@ -668,7 +668,7 @@ }, { "type": "interface", - "name": "dojo::interfaces::IUpgradeableState", + "name": "dojo::world::update::IUpgradeableState", "items": [ { "type": "function", @@ -676,11 +676,11 @@ "inputs": [ { "name": "new_state", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "program_output", - "type": "dojo::interfaces::ProgramOutput" + "type": "dojo::world::update::ProgramOutput" }, { "name": "program_hash", @@ -695,11 +695,11 @@ { "type": "impl", "name": "ConfigImpl", - "interface_name": "dojo::config::interface::IConfig" + "interface_name": "dojo::world::config::IConfig" }, { "type": "interface", - "name": "dojo::config::interface::IConfig", + "name": "dojo::world::config::IConfig", "items": [ { "type": "function", @@ -784,7 +784,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldSpawned", + "name": "dojo::world::world_contract::world::WorldSpawned", "kind": "struct", "members": [ { @@ -801,7 +801,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractDeployed", + "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ { @@ -833,7 +833,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractUpgraded", + "name": "dojo::world::world_contract::world::ContractUpgraded", "kind": "struct", "members": [ { @@ -850,7 +850,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldUpgraded", + "name": "dojo::world::world_contract::world::WorldUpgraded", "kind": "struct", "members": [ { @@ -862,7 +862,7 @@ }, { "type": "event", - "name": "dojo::world::world::MetadataUpdate", + "name": "dojo::world::world_contract::world::MetadataUpdate", "kind": "struct", "members": [ { @@ -879,7 +879,7 @@ }, { "type": "event", - "name": "dojo::world::world::NamespaceRegistered", + "name": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "struct", "members": [ { @@ -896,7 +896,7 @@ }, { "type": "event", - "name": "dojo::world::world::ModelRegistered", + "name": "dojo::world::world_contract::world::ModelRegistered", "kind": "struct", "members": [ { @@ -933,7 +933,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreSetRecord", + "name": "dojo::world::world_contract::world::StoreSetRecord", "kind": "struct", "members": [ { @@ -955,7 +955,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreUpdateRecord", + "name": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "struct", "members": [ { @@ -977,7 +977,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreDelRecord", + "name": "dojo::world::world_contract::world::StoreDelRecord", "kind": "struct", "members": [ { @@ -994,7 +994,7 @@ }, { "type": "event", - "name": "dojo::world::world::WriterUpdated", + "name": "dojo::world::world_contract::world::WriterUpdated", "kind": "struct", "members": [ { @@ -1016,7 +1016,7 @@ }, { "type": "event", - "name": "dojo::world::world::OwnerUpdated", + "name": "dojo::world::world_contract::world::OwnerUpdated", "kind": "struct", "members": [ { @@ -1038,7 +1038,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "name": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "struct", "members": [ { @@ -1050,7 +1050,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "name": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -1062,7 +1062,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::FactsRegistryUpdate", + "name": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "struct", "members": [ { @@ -1074,29 +1074,29 @@ }, { "type": "event", - "name": "dojo::config::component::Config::Event", + "name": "dojo::world::config::Config::Event", "kind": "enum", "variants": [ { "name": "DifferProgramHashUpdate", - "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "type": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "nested" }, { "name": "MergerProgramHashUpdate", - "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "type": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "nested" }, { "name": "FactsRegistryUpdate", - "type": "dojo::config::component::Config::FactsRegistryUpdate", + "type": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::world::world::StateUpdated", + "name": "dojo::world::world_contract::world::StateUpdated", "kind": "struct", "members": [ { @@ -1108,77 +1108,77 @@ }, { "type": "event", - "name": "dojo::world::world::Event", + "name": "dojo::world::world_contract::world::Event", "kind": "enum", "variants": [ { "name": "WorldSpawned", - "type": "dojo::world::world::WorldSpawned", + "type": "dojo::world::world_contract::world::WorldSpawned", "kind": "nested" }, { "name": "ContractDeployed", - "type": "dojo::world::world::ContractDeployed", + "type": "dojo::world::world_contract::world::ContractDeployed", "kind": "nested" }, { "name": "ContractUpgraded", - "type": "dojo::world::world::ContractUpgraded", + "type": "dojo::world::world_contract::world::ContractUpgraded", "kind": "nested" }, { "name": "WorldUpgraded", - "type": "dojo::world::world::WorldUpgraded", + "type": "dojo::world::world_contract::world::WorldUpgraded", "kind": "nested" }, { "name": "MetadataUpdate", - "type": "dojo::world::world::MetadataUpdate", + "type": "dojo::world::world_contract::world::MetadataUpdate", "kind": "nested" }, { "name": "NamespaceRegistered", - "type": "dojo::world::world::NamespaceRegistered", + "type": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "nested" }, { "name": "ModelRegistered", - "type": "dojo::world::world::ModelRegistered", + "type": "dojo::world::world_contract::world::ModelRegistered", "kind": "nested" }, { "name": "StoreSetRecord", - "type": "dojo::world::world::StoreSetRecord", + "type": "dojo::world::world_contract::world::StoreSetRecord", "kind": "nested" }, { "name": "StoreUpdateRecord", - "type": "dojo::world::world::StoreUpdateRecord", + "type": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "nested" }, { "name": "StoreDelRecord", - "type": "dojo::world::world::StoreDelRecord", + "type": "dojo::world::world_contract::world::StoreDelRecord", "kind": "nested" }, { "name": "WriterUpdated", - "type": "dojo::world::world::WriterUpdated", + "type": "dojo::world::world_contract::world::WriterUpdated", "kind": "nested" }, { "name": "OwnerUpdated", - "type": "dojo::world::world::OwnerUpdated", + "type": "dojo::world::world_contract::world::OwnerUpdated", "kind": "nested" }, { "name": "ConfigEvent", - "type": "dojo::config::component::Config::Event", + "type": "dojo::world::config::Config::Event", "kind": "nested" }, { "name": "StateUpdated", - "type": "dojo::world::world::StateUpdated", + "type": "dojo::world::world_contract::world::StateUpdated", "kind": "nested" } ] 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 063a71b75a..44b3746b00 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 = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" -original_class_hash = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" +class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +original_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" 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 5df663d9cd..612934eb2e 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 = "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58" -original_class_hash = "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58" +class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" +original_class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/crates/dojo-lang/src/manifest_test_data/manifest b/crates/dojo-lang/src/manifest_test_data/manifest index 6460043254..d1a8d40f9f 100644 --- a/crates/dojo-lang/src/manifest_test_data/manifest +++ b/crates/dojo-lang/src/manifest_test_data/manifest @@ -27,7 +27,7 @@ test_manifest_file }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::resource_metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -78,7 +78,7 @@ test_manifest_file ], "outputs": [ { - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::resource_metadata::ResourceMetadata" } ], "state_mutability": "view" @@ -89,7 +89,7 @@ test_manifest_file "inputs": [ { "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::resource_metadata::ResourceMetadata" } ], "outputs": [], @@ -709,11 +709,11 @@ test_manifest_file { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -736,7 +736,7 @@ test_manifest_file }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -748,12 +748,12 @@ test_manifest_file }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -765,7 +765,7 @@ test_manifest_file "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] @@ -773,7 +773,7 @@ test_manifest_file ] }, "resource_metadata": { - "name": "dojo::resource_metadata::resource_metadata", + "name": "dojo::model::resource_metadata::resource_metadata", "address": null, "class_hash": "0x6a2f06cde4aad60e0b6dd595edebe8dca1fbefe5b36cfc2f46a1d1159757df9", "abi": [ @@ -853,7 +853,7 @@ test_manifest_file }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -881,7 +881,7 @@ test_manifest_file }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -899,7 +899,7 @@ test_manifest_file }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -907,11 +907,11 @@ test_manifest_file }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", @@ -929,14 +929,14 @@ test_manifest_file "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::resource_metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -954,7 +954,7 @@ test_manifest_file "inputs": [ { "name": "model", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::resource_metadata::ResourceMetadata" } ], "outputs": [], @@ -962,7 +962,7 @@ test_manifest_file }, { "type": "event", - "name": "dojo::resource_metadata::resource_metadata::Event", + "name": "dojo::model::resource_metadata::resource_metadata::Event", "kind": "enum", "variants": [] } @@ -1161,11 +1161,11 @@ test_manifest_file { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -1183,7 +1183,7 @@ test_manifest_file }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -1195,12 +1195,12 @@ test_manifest_file }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -1229,7 +1229,7 @@ test_manifest_file "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" }, { @@ -1286,7 +1286,7 @@ test_manifest_file }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -1314,7 +1314,7 @@ test_manifest_file }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -1332,7 +1332,7 @@ test_manifest_file }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -1340,11 +1340,11 @@ test_manifest_file }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", @@ -1410,7 +1410,7 @@ test_manifest_file "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -1537,7 +1537,7 @@ test_manifest_file }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -1565,7 +1565,7 @@ test_manifest_file }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -1583,7 +1583,7 @@ test_manifest_file }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -1591,11 +1591,11 @@ test_manifest_file }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", @@ -1661,7 +1661,7 @@ test_manifest_file "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" diff --git a/crates/dojo-lang/src/model.rs b/crates/dojo-lang/src/model.rs index 52145f5d3d..3de4909d5f 100644 --- a/crates/dojo-lang/src/model.rs +++ b/crates/dojo-lang/src/model.rs @@ -326,7 +326,7 @@ pub struct $type_name$Entity { } #[generate_trait] -pub impl $type_name$EntityImpl of $type_name$EntityTrait { +pub impl $type_name$EntityStoreImpl of $type_name$EntityStore { fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> $type_name$Entity { $type_name$ModelEntityImpl::get(world, entity_id) } @@ -335,7 +335,7 @@ pub impl $type_name$EntityImpl of $type_name$EntityTrait { } #[generate_trait] -pub impl $type_name$Impl of $type_name$Trait { +pub impl $type_name$StoreImpl of $type_name$Store { fn entity_id_from_keys($param_keys$) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); $serialized_param_keys$ @@ -381,14 +381,9 @@ pub impl $type_name$ModelEntityImpl of dojo::model::ModelEntity<$type_name$Entit core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, values: Span) -> $type_name$Entity { + fn from_values(entity_id: felt252, ref values: Span) -> $type_name$Entity { let mut serialized = array![entity_id]; - let mut i = 0; - loop { - if i >= values.len() { break; } - serialized.append(*values.at(i)); - i += 1; - }; + serialized.append_span(values); let mut serialized = core::array::ArrayTrait::span(@serialized); let entity_values = core::serde::Serde::<$type_name$Entity>::deserialize(ref serialized); @@ -401,20 +396,20 @@ pub impl $type_name$ModelEntityImpl of dojo::model::ModelEntity<$type_name$Entit } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> $type_name$Entity { - let values = dojo::world::IWorldDispatcherTrait::entity( + let mut values = dojo::world::IWorldDispatcherTrait::entity( world, dojo::model::Model::<$type_name$>::selector(), - dojo::world::ModelIndex::Id(entity_id), + dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::<$type_name$>::layout() ); - Self::from_values(entity_id, values) + Self::from_values(entity_id, ref values) } fn update(self: @$type_name$Entity, world: dojo::world::IWorldDispatcher) { dojo::world::IWorldDispatcherTrait::set_entity( world, dojo::model::Model::<$type_name$>::selector(), - dojo::world::ModelIndex::Id(self.id()), + dojo::model::ModelIndex::Id(self.id()), self.values(), dojo::model::Model::<$type_name$>::layout() ); @@ -424,7 +419,7 @@ pub impl $type_name$ModelEntityImpl of dojo::model::ModelEntity<$type_name$Entit dojo::world::IWorldDispatcherTrait::delete_entity( world, dojo::model::Model::<$type_name$>::selector(), - dojo::world::ModelIndex::Id(self.id()), + dojo::model::ModelIndex::Id(self.id()), dojo::model::Model::<$type_name$>::layout() ); } @@ -440,7 +435,7 @@ pub impl $type_name$ModelEntityImpl of dojo::model::ModelEntity<$type_name$Entit dojo::world::IWorldDispatcherTrait::entity( world, dojo::model::Model::<$type_name$>::selector(), - dojo::world::ModelIndex::MemberId((entity_id, member_id)), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), field_layout ) }, @@ -460,7 +455,7 @@ pub impl $type_name$ModelEntityImpl of dojo::model::ModelEntity<$type_name$Entit dojo::world::IWorldDispatcherTrait::set_entity( world, dojo::model::Model::<$type_name$>::selector(), - dojo::world::ModelIndex::MemberId((self.id(), member_id)), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), values, field_layout ) @@ -475,12 +470,12 @@ pub impl $type_name$ModelImpl of dojo::model::Model<$type_name$> { let mut values = dojo::world::IWorldDispatcherTrait::entity( world, Self::selector(), - dojo::world::ModelIndex::Keys(keys), + dojo::model::ModelIndex::Keys(keys), Self::layout() ); let mut _keys = keys; - $type_name$Trait::from_values(ref _keys, ref values) + $type_name$Store::from_values(ref _keys, ref values) } fn set( @@ -490,7 +485,7 @@ pub impl $type_name$ModelImpl of dojo::model::Model<$type_name$> { dojo::world::IWorldDispatcherTrait::set_entity( world, Self::selector(), - dojo::world::ModelIndex::Keys(Self::keys(self)), + dojo::model::ModelIndex::Keys(Self::keys(self)), Self::values(self), Self::layout() ); @@ -503,7 +498,7 @@ pub impl $type_name$ModelImpl of dojo::model::Model<$type_name$> { dojo::world::IWorldDispatcherTrait::delete_entity( world, Self::selector(), - dojo::world::ModelIndex::Keys(Self::keys(self)), + dojo::model::ModelIndex::Keys(Self::keys(self)), Self::layout() ); } @@ -519,7 +514,7 @@ pub impl $type_name$ModelImpl of dojo::model::Model<$type_name$> { dojo::world::IWorldDispatcherTrait::entity( world, Self::selector(), - dojo::world::ModelIndex::MemberId((entity_id, member_id)), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), field_layout ) }, @@ -538,7 +533,7 @@ pub impl $type_name$ModelImpl of dojo::model::Model<$type_name$> { dojo::world::IWorldDispatcherTrait::set_entity( world, Self::selector(), - dojo::world::ModelIndex::MemberId((self.entity_id(), member_id)), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), values, field_layout ) @@ -607,30 +602,18 @@ pub impl $type_name$ModelImpl of dojo::model::Model<$type_name$> { } #[inline(always)] - fn layout() -> dojo::database::introspect::Layout { - dojo::database::introspect::Introspect::<$type_name$>::layout() + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::<$type_name$>::layout() } #[inline(always)] - fn instance_layout(self: @$type_name$) -> dojo::database::introspect::Layout { + fn instance_layout(self: @$type_name$) -> dojo::model::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, - } + dojo::model::layout::compute_packed_size(Self::layout()) } } @@ -678,19 +661,19 @@ pub mod $contract_name$ { } fn unpacked_size(self: @ContractState) -> Option { - dojo::database::introspect::Introspect::<$type_name$>::size() + dojo::model::introspect::Introspect::<$type_name$>::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::<$type_name$>::packed_size() } - fn layout(self: @ContractState) -> dojo::database::introspect::Layout { + fn layout(self: @ContractState) -> dojo::model::Layout { dojo::model::Model::<$type_name$>::layout() } - fn schema(self: @ContractState) -> dojo::database::introspect::Ty { - dojo::database::introspect::Introspect::<$type_name$>::ty() + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::<$type_name$>::ty() } } diff --git a/crates/dojo-lang/src/plugin_test.rs b/crates/dojo-lang/src/plugin_test.rs index 1a8b0dae3b..9f75f5697a 100644 --- a/crates/dojo-lang/src/plugin_test.rs +++ b/crates/dojo-lang/src/plugin_test.rs @@ -106,13 +106,12 @@ pub fn test_expand_plugin_inner( // Create Scarb.toml file let scarb_toml_path = tmp_path.join("Scarb.toml"); - // Only write if the file doesn't exist. - if !scarb_toml_path.exists() { - std::fs::write( - scarb_toml_path, - r#" + std::fs::write( + scarb_toml_path, + r#" [package] cairo-version = "=2.6.4" +edition = "2024_07" name = "test_package" version = "0.7.3" @@ -125,9 +124,8 @@ sierra-replace-ids = true namespace = { default = "test_package" } seed = "test_package" "#, - ) - .expect("Failed to write Scarb.toml"); - } + ) + .expect("Failed to write Scarb.toml"); // Create src directory let src_dir = tmp_path.join("src"); @@ -135,10 +133,7 @@ seed = "test_package" // Create lib.cairo file let lib_cairo_path = src_dir.join("lib.cairo"); - - if !lib_cairo_path.exists() { - std::fs::write(lib_cairo_path, cairo_code).expect("Failed to write lib.cairo"); - } + std::fs::write(lib_cairo_path, cairo_code).expect("Failed to write lib.cairo"); let crate_id = db.intern_crate(CrateLongId::Real("test".into())); let root = Directory::Real(src_dir.to_path_buf()); diff --git a/crates/dojo-lang/src/plugin_test_data/introspect b/crates/dojo-lang/src/plugin_test_data/introspect index 9ae98554ab..3d941b5c0b 100644 --- a/crates/dojo-lang/src/plugin_test_data/introspect +++ b/crates/dojo-lang/src/plugin_test_data/introspect @@ -259,57 +259,2683 @@ enum EnumNotPackable1 { } //! > expanded_cairo_code -use serde::Serde; -use debug::PrintTrait; +use core::serde::Serde; + +#[derive(Copy, Drop, Serde, Introspect)] +struct Vec2 { + x: u32, + y: u32 +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum PlainEnum { + Left, + Right, +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumWithPrimitive { + Left: u32, + Right: u32, +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumWithStruct { + Left: Vec2, + Right: Vec2, +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumWithSimpleArray { + Left: Array, + Right: Array, +} -#[derive(Print)] -struct Position { +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumWithByteArray { + Left: ByteArray, + Right: ByteArray, +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumWithSimpleTuple { + Left: (u8, u256), + Right: (u8, u256), +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumWithComplexTuple { + Left: (u8, Vec2), + Right: (u8, Vec2), +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumWithPrimitive { + Left: u32, + Right: u32, +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumCustom { + Left: Vec2, + Right: Vec2, +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumTupleMix { + Left: (Vec2, u64, EnumCustom), + Right: (Vec2, u64, EnumCustom), +} + +#[derive(Serde, Copy, Drop, Introspect)] +enum EnumWithDifferentVariantData { + One, + Two: u32, + Three: (Vec2, u64), +} + +#[derive(Copy, Drop, Introspect)] +struct StructWithPrimitives { + #[key] + player: ContractAddress, + before: u8, + after: u16, +} + +#[derive(Copy, Drop, Introspect)] +struct StructWithStruct { + #[key] + player: ContractAddress, + before: u8, + after: Vec2, +} + +#[derive(Copy, Drop, Introspect)] +struct StructWithSimpleArray { + #[key] + player: ContractAddress, + before: u8, + after: Array, +} + +#[derive(Copy, Drop, Introspect)] +struct StructWithByteArray { + #[key] + player: ContractAddress, + before: u8, + after: ByteArray, +} + +#[derive(Copy, Drop, Introspect)] +struct StructWithComplexArray { #[key] - id: felt252, - x: felt252, - y: felt252 + player: ContractAddress, + before: u8, + after: Array, +} + +#[derive(Copy, Drop, Introspect)] +struct StructWithSimpleTuple { + #[key] + player: ContractAddress, + before: u8, + after: (u8, u256), +} + +#[derive(Copy, Drop, Introspect)] +struct StructWithComplexTuple { + #[key] + player: ContractAddress, + before: u8, + after: (u8, Vec2, EnumCustom), } -#[derive(Print)] -struct Roles { - role_ids: Array +#[derive(Copy, Drop, Introspect)] +struct StructWithNestedArrays { + #[key] + player: ContractAddress, + before: u8, + after: Array>>, } -use starknet::ContractAddress; +#[derive(Copy, Drop, Introspect)] +struct StructWithNestedTuples { + #[key] + player: ContractAddress, + before: u8, + after: ((u8, u32), (Vec2, EnumCustom)), +} -#[derive(Print)] -struct Player { +#[derive(Copy, Drop, Introspect)] +struct StructWithNestedTuplesAndByteArray { #[key] - game: felt252, + player: ContractAddress, + before: u8, + after: ((u8, u32), (Vec2, ByteArray)), +} + +#[derive(Copy, Drop, Introspect)] +struct StructWithNestedEverything { #[key] player: ContractAddress, - name: felt252, + before: u8, + after: ((u8, u32), (Vec2, EnumCustom), (Array<(u32, Vec2)>, EnumCustom), (u16,)) } -#[derive(Print)] -enum Enemy { - Unknown, - Bot: felt252, - OtherPlayer: ContractAddress, +#[derive(Copy, Drop, Serde, Introspect)] +struct GenericStruct { + t: T, +} + +#[derive(Copy, Drop, Serde, Introspect)] +struct StructWithBadOption { + x: Option<(u8, u16)> +} + +#[derive(Copy, Drop, Serde, Introspect)] +enum EnumWithBadOption { + first: Option<(u8, u16)>, +} + +#[derive(Introspect, IntrospectPacked)] +enum EnumIncompatibleAttrs {} + +#[derive(Introspect, IntrospectPacked)] +struct StructIncompatibleAttrs {} + +#[derive(Introspect)] +#[derive(IntrospectPacked)] +struct StructIncompatibleAttrs2 {} + +#[derive(Introspect)] +#[derive(IntrospectPacked)] +enum EnumIncompatibleAttrs2 {} + +#[derive(IntrospectPacked)] +struct StructPacked1 { + x: u8 +} + +#[derive(IntrospectPacked)] +struct StructPacked2 { + x: u8, + y: u256 +} + +#[derive(IntrospectPacked)] +struct StructPacked3 { + x: u256, + y: (u8, u32) +} + +#[derive(IntrospectPacked)] +struct StructNotPackable1 { + x: u8, + y: Array +} + +#[derive(IntrospectPacked)] +struct StructPackableWithInnerPacked { + x: u8, + y: StructPacked1 +} + +#[derive(IntrospectPacked)] +enum EnumPacked1 { + a, + b, + c +} + +#[derive(IntrospectPacked)] +enum EnumPacked2 { + a: u8, + b: u8, + c: u8 +} + +#[derive(IntrospectPacked)] +enum EnumPacked3 { + a: (u128, u128), + b: u256, +} + + +#[derive(IntrospectPacked)] +enum EnumPackableWithInnerPacked { + a: StructPacked1, + b: StructPacked1, +} + +#[derive(IntrospectPacked)] +enum EnumNotPackable1 { + a: u8, + b: u256, +}impl Vec2Copy of core::traits::Copy::; +impl Vec2Drop of core::traits::Drop::; +impl Vec2Serde of core::serde::Serde:: { + fn serialize(self: @Vec2, ref output: core::array::Array) { + core::serde::Serde::serialize(self.x, ref output); + core::serde::Serde::serialize(self.y, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Vec2 { + x: core::serde::Serde::deserialize(ref serialized)?, + y: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} + +impl Vec2Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(2) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'Vec2', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} +impl PlainEnumSerde of core::serde::Serde:: { + fn serialize(self: @PlainEnum, ref output: core::array::Array) { + match self { + PlainEnum::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + PlainEnum::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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => PlainEnum::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => PlainEnum::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl PlainEnumCopy of core::traits::Copy::; +impl PlainEnumDrop of core::traits::Drop::; + +impl PlainEnumIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(1) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::Layout::Fixed(array![].span()) + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::Layout::Fixed(array![].span()) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'PlainEnum', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Ty::Tuple(array![].span())), +('Right', dojo::model::introspect::Ty::Tuple(array![].span())) + + ].span() + } + ) + } +} +impl EnumWithPrimitiveSerde of core::serde::Serde:: { + fn serialize(self: @EnumWithPrimitive, ref output: core::array::Array) { + match self { + 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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => EnumWithPrimitive::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithPrimitive::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumWithPrimitiveCopy of core::traits::Copy::; +impl EnumWithPrimitiveDrop of core::traits::Drop::; + +impl EnumWithPrimitiveIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(2) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumWithPrimitive', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Introspect::::ty()), +('Right', dojo::model::introspect::Introspect::::ty()) + + ].span() + } + ) + } +} +impl EnumWithStructSerde of core::serde::Serde:: { + fn serialize(self: @EnumWithStruct, ref output: core::array::Array) { + match self { + EnumWithStruct::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithStruct::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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => EnumWithStruct::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithStruct::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumWithStructCopy of core::traits::Copy::; +impl EnumWithStructDrop of core::traits::Drop::; + +impl EnumWithStructIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +Option::Some(1) + ]; + + if dojo::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumWithStruct', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Introspect::::ty()), +('Right', dojo::model::introspect::Introspect::::ty()) + + ].span() + } + ) + } +} +impl EnumWithSimpleArraySerde of core::serde::Serde:: { + fn serialize(self: @EnumWithSimpleArray, ref output: core::array::Array) { + match self { + EnumWithSimpleArray::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithSimpleArray::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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => EnumWithSimpleArray::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithSimpleArray::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumWithSimpleArrayCopy of core::traits::Copy::; +impl EnumWithSimpleArrayDrop of core::traits::Drop::; + +impl EnumWithSimpleArrayIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::introspect::Introspect::>::layout() + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::introspect::Introspect::>::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumWithSimpleArray', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + )), +('Right', dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + )) + + ].span() + } + ) + } +} +impl EnumWithByteArraySerde of core::serde::Serde:: { + fn serialize(self: @EnumWithByteArray, ref output: core::array::Array) { + match self { + EnumWithByteArray::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithByteArray::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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => EnumWithByteArray::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithByteArray::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumWithByteArrayCopy of core::traits::Copy::; +impl EnumWithByteArrayDrop of core::traits::Drop::; + +impl EnumWithByteArrayIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumWithByteArray', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Ty::ByteArray), +('Right', dojo::model::introspect::Ty::ByteArray) + + ].span() + } + ) + } +} +impl EnumWithSimpleTupleSerde of core::serde::Serde:: { + fn serialize(self: @EnumWithSimpleTuple, ref output: core::array::Array) { + match self { + EnumWithSimpleTuple::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithSimpleTuple::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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => EnumWithSimpleTuple::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithSimpleTuple::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumWithSimpleTupleCopy of core::traits::Copy::; +impl EnumWithSimpleTupleDrop of core::traits::Drop::; + +impl EnumWithSimpleTupleIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(4) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumWithSimpleTuple', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + )), +('Right', dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + )) + + ].span() + } + ) + } +} +impl EnumWithComplexTupleSerde of core::serde::Serde:: { + fn serialize(self: @EnumWithComplexTuple, ref output: core::array::Array) { + match self { + EnumWithComplexTuple::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithComplexTuple::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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => EnumWithComplexTuple::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithComplexTuple::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumWithComplexTupleCopy of core::traits::Copy::; +impl EnumWithComplexTupleDrop of core::traits::Drop::; + +impl EnumWithComplexTupleIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +Option::Some(2) + ]; + + if dojo::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumWithComplexTuple', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + )), +('Right', dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + )) + + ].span() + } + ) + } +} +impl EnumWithPrimitiveSerde of core::serde::Serde:: { + fn serialize(self: @EnumWithPrimitive, ref output: core::array::Array) { + match self { + 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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => EnumWithPrimitive::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithPrimitive::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumWithPrimitiveCopy of core::traits::Copy::; +impl EnumWithPrimitiveDrop of core::traits::Drop::; + +impl EnumWithPrimitiveIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(2) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumWithPrimitive', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Introspect::::ty()), +('Right', dojo::model::introspect::Introspect::::ty()) + + ].span() + } + ) + } +} +impl EnumCustomSerde of core::serde::Serde:: { + fn serialize(self: @EnumCustom, ref output: core::array::Array) { + match self { + EnumCustom::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumCustom::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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => EnumCustom::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumCustom::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumCustomCopy of core::traits::Copy::; +impl EnumCustomDrop of core::traits::Drop::; + +impl EnumCustomIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +Option::Some(1) + ]; + + if dojo::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumCustom', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Introspect::::ty()), +('Right', dojo::model::introspect::Introspect::::ty()) + + ].span() + } + ) + } +} +impl EnumTupleMixSerde of core::serde::Serde:: { + fn serialize(self: @EnumTupleMix, ref output: core::array::Array) { + match self { + EnumTupleMix::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumTupleMix::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 { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + match idx { + 0 => EnumTupleMix::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumTupleMix::Right(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumTupleMixCopy of core::traits::Copy::; +impl EnumTupleMixDrop of core::traits::Drop::; + +impl EnumTupleMixIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +dojo::model::introspect::Introspect::::size(), +Option::Some(2) + ]; + + if dojo::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumTupleMix', + attrs: array![].span(), + children: array![ + ('Left', dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + )), +('Right', dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + )) + + ].span() + } + ) + } +} +impl EnumWithDifferentVariantDataSerde of core::serde::Serde:: { + fn serialize(self: @EnumWithDifferentVariantData, ref output: core::array::Array) { + match self { + EnumWithDifferentVariantData::One(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithDifferentVariantData::Two(x) => { core::serde::Serde::serialize(@1, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithDifferentVariantData::Three(x) => { core::serde::Serde::serialize(@2, ref output); core::serde::Serde::serialize(x, ref output); }, + } + } + 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 => EnumWithDifferentVariantData::One(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithDifferentVariantData::Two(core::serde::Serde::deserialize(ref serialized)?), + 2 => EnumWithDifferentVariantData::Three(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} +impl EnumWithDifferentVariantDataCopy of core::traits::Copy::; +impl EnumWithDifferentVariantDataDrop of core::traits::Drop::; + +impl EnumWithDifferentVariantDataIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::Layout::Fixed(array![].span()) + }, +dojo::model::FieldLayout { + selector: 1, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 2, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumWithDifferentVariantData', + attrs: array![].span(), + children: array![ + ('One', dojo::model::introspect::Ty::Tuple(array![].span())), +('Two', dojo::model::introspect::Introspect::::ty()), +('Three', dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + )) + + ].span() + } + ) + } +} +impl StructWithPrimitivesCopy of core::traits::Copy::; +impl StructWithPrimitivesDrop of core::traits::Drop::; + +impl StructWithPrimitivesIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(2) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithPrimitives', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} +impl StructWithStructCopy of core::traits::Copy::; +impl StructWithStructDrop of core::traits::Drop::; + +impl StructWithStructIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +Option::Some(1) + ]; + + if dojo::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithStruct', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} +impl StructWithSimpleArrayCopy of core::traits::Copy::; +impl StructWithSimpleArrayDrop of core::traits::Drop::; + +impl StructWithSimpleArrayIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::introspect::Introspect::>::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithSimpleArray', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} +impl StructWithByteArrayCopy of core::traits::Copy::; +impl StructWithByteArrayDrop of core::traits::Drop::; + +impl StructWithByteArrayIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithByteArray', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::ByteArray + } + + ].span() + } + ) + } +} +impl StructWithComplexArrayCopy of core::traits::Copy::; +impl StructWithComplexArrayDrop of core::traits::Drop::; + +impl StructWithComplexArrayIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::introspect::Introspect::>::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithComplexArray', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} +impl StructWithSimpleTupleCopy of core::traits::Copy::; +impl StructWithSimpleTupleDrop of core::traits::Drop::; + +impl StructWithSimpleTupleIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(4) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithSimpleTuple', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} +impl StructWithComplexTupleCopy of core::traits::Copy::; +impl StructWithComplexTupleDrop of core::traits::Drop::; + +impl StructWithComplexTupleIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +dojo::model::introspect::Introspect::::size(), +Option::Some(2) + ]; + + if dojo::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithComplexTuple', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} +impl StructWithNestedArraysCopy of core::traits::Copy::; +impl StructWithNestedArraysDrop of core::traits::Drop::; + +impl StructWithNestedArraysIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::Layout::Array( + array![ + dojo::model::Layout::Array( + array![ + dojo::model::introspect::Introspect::>::layout() + ].span() + ) + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithNestedArrays', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + ) + ].span() + ) + ].span() + ) + } + + ].span() + } + ) + } +} +impl StructWithNestedTuplesCopy of core::traits::Copy::; +impl StructWithNestedTuplesDrop of core::traits::Drop::; + +impl StructWithNestedTuplesIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +dojo::model::introspect::Introspect::::size(), +Option::Some(3) + ]; + + if dojo::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ), +dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithNestedTuples', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ), +dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ) + ].span() + ) + } + + ].span() + } + ) + } +} +impl StructWithNestedTuplesAndByteArrayCopy of core::traits::Copy::; +impl StructWithNestedTuplesAndByteArrayDrop of core::traits::Drop::; + +impl StructWithNestedTuplesAndByteArrayIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ), +dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithNestedTuplesAndByteArray', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ), +dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Ty::ByteArray + ].span() + ) + ].span() + ) + } + + ].span() + } + ) + } +} +impl StructWithNestedEverythingCopy of core::traits::Copy::; +impl StructWithNestedEverythingDrop of core::traits::Drop::; + +impl StructWithNestedEverythingIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ), +dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ), +dojo::model::Layout::Tuple( + array![ + dojo::model::Layout::Array( + array![ + dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + ].span() + ), +dojo::model::introspect::Introspect::::layout() + ].span() + ), +dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout() + ].span() + ) + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithNestedEverything', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'before', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'after', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ), +dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ), +dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ) + ].span() + ), +dojo::model::introspect::Introspect::::ty() + ].span() + ), +dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + ) + ].span() + ) + } + + ].span() + } + ) + } +} +impl GenericStructCopy> of core::traits::Copy::>; +impl GenericStructDrop> of core::traits::Drop::>; +impl GenericStructSerde, +core::traits::Destruct> of core::serde::Serde::> { + fn serialize(self: @GenericStruct, ref output: core::array::Array) { + core::serde::Serde::serialize(self.t, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option> { + core::option::Option::Some(GenericStruct { + t: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} + +impl GenericStructIntrospect> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 1246920879054256875300693562709339669009726288543267794550465531256469553289, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'GenericStruct', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 't', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} +impl StructWithBadOptionCopy of core::traits::Copy::; +impl StructWithBadOptionDrop of core::traits::Drop::; +impl StructWithBadOptionSerde of core::serde::Serde:: { + fn serialize(self: @StructWithBadOption, ref output: core::array::Array) { + core::serde::Serde::serialize(self.x, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(StructWithBadOption { + x: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} + +impl StructWithBadOptionIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::>::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, + layout: dojo::model::introspect::Introspect:: +>::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructWithBadOption', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::>::ty() + } + + ].span() + } + ) + } +} +impl EnumWithBadOptionCopy of core::traits::Copy::; +impl EnumWithBadOptionDrop of core::traits::Drop::; +impl EnumWithBadOptionSerde of core::serde::Serde:: { + fn serialize(self: @EnumWithBadOption, ref output: core::array::Array) { + match self { + EnumWithBadOption::first(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + } + } + 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 => EnumWithBadOption::first(core::serde::Serde::deserialize(ref serialized)?), + _ => { return core::option::Option::None; } + } + ) + } +} + +impl EnumWithBadOptionIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::>::size(), +Option::Some(1) + ]; + + if dojo::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + dojo::model::FieldLayout { + selector: 0, + layout: dojo::model::introspect::Introspect::>::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumWithBadOption', + attrs: array![].span(), + children: array![ + ('first', dojo::model::introspect::Introspect::>::ty()) + + ].span() + } + ) + } +} + +impl EnumIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumIncompatibleAttrs', + attrs: array![].span(), + children: array![ + + + ].span() + } + ) + } +} + +impl EnumIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + 8 + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumIncompatibleAttrs', + attrs: array![].span(), + children: array![ + + + ].span() + } + ) + } +} + +impl StructIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructIncompatibleAttrs', + attrs: array![].span(), + children: array![ + + + ].span() + } + ) + } +} + +impl StructIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructIncompatibleAttrs', + attrs: array![].span(), + children: array![ + + + ].span() + } + ) + } +} + +impl StructIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructIncompatibleAttrs2', + attrs: array![].span(), + children: array![ + + + ].span() + } + ) + } +} + +impl StructIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructIncompatibleAttrs2', + attrs: array![].span(), + children: array![ + + + ].span() + } + ) + } +} + +impl EnumIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Enum( + array![ + + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumIncompatibleAttrs2', + attrs: array![].span(), + children: array![ + + + ].span() + } + ) + } +} + +impl EnumIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + 8 + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumIncompatibleAttrs2', + attrs: array![].span(), + children: array![ + + + ].span() + } + ) + } +} + +impl StructPacked1Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(1) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + 8 + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructPacked1', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +impl StructPacked2Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(3) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + 8,128,128 + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructPacked2', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +impl StructPacked3Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(4) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + 128,128,8,32 + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructPacked3', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} + +impl StructNotPackable1Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + 8,ERROR + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructNotPackable1', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} + +impl StructPackableWithInnerPackedIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +Option::Some(1) + ]; + + + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + let mut layouts = array![ + dojo::model::Layout::Fixed(array![8].span()), +dojo::model::introspect::Introspect::::layout() + ]; + let mut merged_layout = ArrayTrait::::new(); + + loop { + match ArrayTrait::pop_front(ref layouts) { + Option::Some(mut layout) => { + match layout { + dojo::model::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::model::Layout::Fixed(merged_layout.span()) + + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'StructPackableWithInnerPacked', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +impl EnumPacked1Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(1) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + 8 + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumPacked1', + attrs: array![].span(), + children: array![ + ('a', dojo::model::introspect::Ty::Tuple(array![].span())), +('b', dojo::model::introspect::Ty::Tuple(array![].span())), +('c', dojo::model::introspect::Ty::Tuple(array![].span())) + + ].span() + } + ) + } +} + +impl EnumPacked2Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(2) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + 8,8 + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumPacked2', + attrs: array![].span(), + children: array![ + ('a', dojo::model::introspect::Introspect::::ty()), +('b', dojo::model::introspect::Introspect::::ty()), +('c', dojo::model::introspect::Introspect::::ty()) + + ].span() + } + ) + } +} + +impl EnumPacked3Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(3) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Fixed( + array![ + 8,128,128 + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumPacked3', + attrs: array![].span(), + children: array![ + ('a', dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + )), +('b', dojo::model::introspect::Introspect::::ty()) + + ].span() + } + ) + } +} + +impl EnumPackableWithInnerPackedIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +Option::Some(1) + ]; + + + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + let mut layouts = array![ + dojo::model::Layout::Fixed(array![8].span()), +dojo::model::introspect::Introspect::::layout() + ]; + let mut merged_layout = ArrayTrait::::new(); + + loop { + match ArrayTrait::pop_front(ref layouts) { + Option::Some(mut layout) => { + match layout { + dojo::model::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::model::Layout::Fixed(merged_layout.span()) + + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumPackableWithInnerPacked', + attrs: array![].span(), + children: array![ + ('a', dojo::model::introspect::Introspect::::ty()), +('b', dojo::model::introspect::Introspect::::ty()) + + ].span() + } + ) + } +} + +impl EnumNotPackable1Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + ERROR + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Enum( + dojo::model::introspect::Enum { + name: 'EnumNotPackable1', + attrs: array![].span(), + children: array![ + ('a', dojo::model::introspect::Introspect::::ty()), +('b', dojo::model::introspect::Introspect::::ty()) + + ].span() + } + ) + } } //! > expected_diagnostics -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:4:10 -#[derive(Print)] - ^***^ - -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:12:10 -#[derive(Print)] - ^***^ - -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:19:10 -#[derive(Print)] - ^***^ - -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:28:10 -#[derive(Print)] - ^***^ +error: Option cannot be used with tuples. Prefer using a struct. + --> /tmp/plugin_test/src/lib.cairo:171:6 + x: Option<(u8, u16)> + ^*****************^ + +error: Option cannot be used with tuples. Prefer using a struct. + --> /tmp/plugin_test/src/lib.cairo:176:10 + first: Option<(u8, u16)>, + ^*****************^ + +error: Introspect and IntrospectPacked attributes cannot be used at a same time. + --> /tmp/plugin_test/src/lib.cairo:180:6 +enum EnumIncompatibleAttrs {} + ^*******************^ + +error: Introspect and IntrospectPacked attributes cannot be used at a same time. + --> /tmp/plugin_test/src/lib.cairo:183:8 +struct StructIncompatibleAttrs {} + ^*********************^ + +error: Introspect and IntrospectPacked attributes cannot be used at a same time. + --> /tmp/plugin_test/src/lib.cairo:187:8 +struct StructIncompatibleAttrs2 {} + ^**********************^ + +error: Introspect and IntrospectPacked attributes cannot be used at a same time. + --> /tmp/plugin_test/src/lib.cairo:191:6 +enum EnumIncompatibleAttrs2 {} + ^********************^ + +error: Array field cannot be packed. + --> /tmp/plugin_test/src/lib.cairo:213:6 + y: Array + ^**********^ + +error: To be packed, all variants must have fixed layout of same size. + --> /tmp/plugin_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 5f6de6f1d7..b248e05a00 100644 --- a/crates/dojo-lang/src/plugin_test_data/model +++ b/crates/dojo-lang/src/plugin_test_data/model @@ -159,25 +159,109 @@ struct ModelWithTupleNoPrimitives { } //! > expanded_cairo_code -use serde::Serde; -use debug::PrintTrait; +#[dojo::model(version: 0)] +#[dojo::model(version: 0)] +struct BadModelMultipleAttr { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(version: 0, version: 0)] +struct BadModelMultipleVersions { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(version: hello)] +struct BadModelBadVersionType { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(version)] +struct BadModelNoVersionValue { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(my_arg: 1)] +struct BadModelUnexpectedArgWithValue { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(my_arg)] +struct BadModelUnexpectedArg { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(version: 2)] +struct BadModelNotSupportedVersion { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(version: 0)] +struct Modelv0 { + #[key] + id: felt252, + 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, +} -#[derive(Print)] +#[dojo::model] struct Position { #[key] id: felt252, - x: felt252, - y: felt252 + v: Vec3, } -#[derive(Print)] +#[dojo::model] struct Roles { role_ids: Array } -use starknet::ContractAddress; +#[dojo::model] +struct OnlyKeyModel { + #[key] + id: felt252 +} + +#[dojo::model] +struct U256KeyModel { + #[key] + id: u256 +} -#[derive(Print)] +#[dojo::model] struct Player { #[key] game: felt252, @@ -186,30 +270,25901 @@ struct Player { name: felt252, } -#[derive(Print)] -enum Enemy { - Unknown, - Bot: felt252, - OtherPlayer: ContractAddress, +#[dojo::model] +type OtherPlayer = Player; + +#[dojo::model] +struct ModelWithSimpleArray { + #[key] + player: ContractAddress, + x: u16, + y: Array +} + +#[dojo::model] +struct ModelWithByteArray { + #[key] + player: ContractAddress, + x: u16, + y: ByteArray } -//! > expected_diagnostics -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:4:10 -#[derive(Print)] - ^***^ - -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:12:10 -#[derive(Print)] - ^***^ - -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:19:10 -#[derive(Print)] - ^***^ - -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:28:10 -#[derive(Print)] - ^***^ +#[dojo::model] +struct ModelWithComplexArray { + #[key] + player: ContractAddress, + x: u16, + y: Array +} + +#[dojo::model] +struct ModelWithTuple { + #[key] + player: ContractAddress, + x: u16, + y: (u8, u16, u32) +} + +#[dojo::model] +struct ModelWithTupleNoPrimitives { + #[key] + player: ContractAddress, + x: u16, + y: (u8, Vec3, u32) +} +impl BadModelMultipleAttrIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'BadModelMultipleAttr', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +impl BadModelMultipleVersionsIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'BadModelMultipleVersions', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct BadModelMultipleVersionsEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl BadModelMultipleVersionsEntityStoreImpl of BadModelMultipleVersionsEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelMultipleVersionsEntity { + BadModelMultipleVersionsModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelMultipleVersions::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelMultipleVersionsEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl BadModelMultipleVersionsStoreImpl of BadModelMultipleVersionsStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> BadModelMultipleVersions { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `BadModelMultipleVersions`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelMultipleVersions { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelMultipleVersions::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelMultipleVersions, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl BadModelMultipleVersionsModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @BadModelMultipleVersionsEntity) -> felt252 { + *self.__id + } + + fn values(self: @BadModelMultipleVersionsEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> BadModelMultipleVersionsEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `BadModelMultipleVersionsEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelMultipleVersionsEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @BadModelMultipleVersionsEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @BadModelMultipleVersionsEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelMultipleVersionsEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl BadModelMultipleVersionsModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> BadModelMultipleVersions { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + BadModelMultipleVersionsStore::from_values(ref _keys, ref values) + } + + fn set( + self: @BadModelMultipleVersions, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @BadModelMultipleVersions, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelMultipleVersions, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "BadModelMultipleVersions" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-BadModelMultipleVersions" + } + + #[inline(always)] + fn version() -> u8 { + 0 + } + + #[inline(always)] + fn selector() -> felt252 { + "BadModelMultipleVersions" + } + + #[inline(always)] + fn instance_selector(self: @BadModelMultipleVersions) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 3538888628466873673221842373412072042558277047191927145880480325050722136660 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @BadModelMultipleVersions) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @BadModelMultipleVersions) -> 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: @BadModelMultipleVersions) -> 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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @BadModelMultipleVersions) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Ibad_model_multiple_versions { + fn ensure_abi(self: @T, model: BadModelMultipleVersions); +} + +#[starknet::contract] +pub mod bad_model_multiple_versions { + use super::BadModelMultipleVersions; + use super::Ibad_model_multiple_versions; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl bad_model_multiple_versionsImpl of Ibad_model_multiple_versions{ + fn ensure_abi(self: @ContractState, model: BadModelMultipleVersions) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__bad_model_multiple_versionsImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + bad_model_multiple_versionsImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__bad_model_multiple_versionsImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl BadModelBadVersionTypeIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'BadModelBadVersionType', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct BadModelBadVersionTypeEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl BadModelBadVersionTypeEntityStoreImpl of BadModelBadVersionTypeEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelBadVersionTypeEntity { + BadModelBadVersionTypeModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelBadVersionType::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelBadVersionTypeEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl BadModelBadVersionTypeStoreImpl of BadModelBadVersionTypeStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> BadModelBadVersionType { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `BadModelBadVersionType`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelBadVersionType { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelBadVersionType::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelBadVersionType, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl BadModelBadVersionTypeModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @BadModelBadVersionTypeEntity) -> felt252 { + *self.__id + } + + fn values(self: @BadModelBadVersionTypeEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> BadModelBadVersionTypeEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `BadModelBadVersionTypeEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelBadVersionTypeEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @BadModelBadVersionTypeEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @BadModelBadVersionTypeEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelBadVersionTypeEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl BadModelBadVersionTypeModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> BadModelBadVersionType { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + BadModelBadVersionTypeStore::from_values(ref _keys, ref values) + } + + fn set( + self: @BadModelBadVersionType, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @BadModelBadVersionType, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelBadVersionType, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "BadModelBadVersionType" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-BadModelBadVersionType" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 3424346430891629531332762252537876298286978002978132542474104837759156545171 + } + + #[inline(always)] + fn instance_selector(self: @BadModelBadVersionType) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 760683829940564015458541272487101565210915690045377810379189532484191344547 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @BadModelBadVersionType) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @BadModelBadVersionType) -> 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: @BadModelBadVersionType) -> 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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @BadModelBadVersionType) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Ibad_model_bad_version_type { + fn ensure_abi(self: @T, model: BadModelBadVersionType); +} + +#[starknet::contract] +pub mod bad_model_bad_version_type { + use super::BadModelBadVersionType; + use super::Ibad_model_bad_version_type; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl bad_model_bad_version_typeImpl of Ibad_model_bad_version_type{ + fn ensure_abi(self: @ContractState, model: BadModelBadVersionType) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__bad_model_bad_version_typeImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + bad_model_bad_version_typeImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__bad_model_bad_version_typeImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl BadModelNoVersionValueIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'BadModelNoVersionValue', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct BadModelNoVersionValueEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl BadModelNoVersionValueEntityStoreImpl of BadModelNoVersionValueEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelNoVersionValueEntity { + BadModelNoVersionValueModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelNoVersionValue::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelNoVersionValueEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl BadModelNoVersionValueStoreImpl of BadModelNoVersionValueStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> BadModelNoVersionValue { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `BadModelNoVersionValue`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelNoVersionValue { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelNoVersionValue::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelNoVersionValue, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl BadModelNoVersionValueModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @BadModelNoVersionValueEntity) -> felt252 { + *self.__id + } + + fn values(self: @BadModelNoVersionValueEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> BadModelNoVersionValueEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `BadModelNoVersionValueEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelNoVersionValueEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @BadModelNoVersionValueEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @BadModelNoVersionValueEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelNoVersionValueEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl BadModelNoVersionValueModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> BadModelNoVersionValue { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + BadModelNoVersionValueStore::from_values(ref _keys, ref values) + } + + fn set( + self: @BadModelNoVersionValue, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @BadModelNoVersionValue, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelNoVersionValue, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "BadModelNoVersionValue" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-BadModelNoVersionValue" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 3137507464979648719446085887369604472442296862296217793557428940425307809922 + } + + #[inline(always)] + fn instance_selector(self: @BadModelNoVersionValue) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 2459365230136118590954025890011480023818926626380754992635699340900694864996 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @BadModelNoVersionValue) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @BadModelNoVersionValue) -> 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: @BadModelNoVersionValue) -> 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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @BadModelNoVersionValue) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Ibad_model_no_version_value { + fn ensure_abi(self: @T, model: BadModelNoVersionValue); +} + +#[starknet::contract] +pub mod bad_model_no_version_value { + use super::BadModelNoVersionValue; + use super::Ibad_model_no_version_value; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl bad_model_no_version_valueImpl of Ibad_model_no_version_value{ + fn ensure_abi(self: @ContractState, model: BadModelNoVersionValue) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__bad_model_no_version_valueImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + bad_model_no_version_valueImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__bad_model_no_version_valueImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl BadModelUnexpectedArgWithValueIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'BadModelUnexpectedArgWithValue', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct BadModelUnexpectedArgWithValueEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl BadModelUnexpectedArgWithValueEntityStoreImpl of BadModelUnexpectedArgWithValueEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelUnexpectedArgWithValueEntity { + BadModelUnexpectedArgWithValueModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelUnexpectedArgWithValue::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelUnexpectedArgWithValueEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl BadModelUnexpectedArgWithValueStoreImpl of BadModelUnexpectedArgWithValueStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> BadModelUnexpectedArgWithValue { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `BadModelUnexpectedArgWithValue`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelUnexpectedArgWithValue { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelUnexpectedArgWithValue::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelUnexpectedArgWithValue, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl BadModelUnexpectedArgWithValueModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @BadModelUnexpectedArgWithValueEntity) -> felt252 { + *self.__id + } + + fn values(self: @BadModelUnexpectedArgWithValueEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> BadModelUnexpectedArgWithValueEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `BadModelUnexpectedArgWithValueEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelUnexpectedArgWithValueEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @BadModelUnexpectedArgWithValueEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @BadModelUnexpectedArgWithValueEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelUnexpectedArgWithValueEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl BadModelUnexpectedArgWithValueModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> BadModelUnexpectedArgWithValue { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + BadModelUnexpectedArgWithValueStore::from_values(ref _keys, ref values) + } + + fn set( + self: @BadModelUnexpectedArgWithValue, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @BadModelUnexpectedArgWithValue, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelUnexpectedArgWithValue, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "BadModelUnexpectedArgWithValue" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-BadModelUnexpectedArgWithValue" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 3162902274274075293574414479899149167035238805798288683939511839395372839584 + } + + #[inline(always)] + fn instance_selector(self: @BadModelUnexpectedArgWithValue) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 3586339245084542986020591057627093254376225984628310828088084183494435682971 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @BadModelUnexpectedArgWithValue) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @BadModelUnexpectedArgWithValue) -> 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: @BadModelUnexpectedArgWithValue) -> 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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @BadModelUnexpectedArgWithValue) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Ibad_model_unexpected_arg_with_value { + fn ensure_abi(self: @T, model: BadModelUnexpectedArgWithValue); +} + +#[starknet::contract] +pub mod bad_model_unexpected_arg_with_value { + use super::BadModelUnexpectedArgWithValue; + use super::Ibad_model_unexpected_arg_with_value; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl bad_model_unexpected_arg_with_valueImpl of Ibad_model_unexpected_arg_with_value{ + fn ensure_abi(self: @ContractState, model: BadModelUnexpectedArgWithValue) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__bad_model_unexpected_arg_with_valueImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + bad_model_unexpected_arg_with_valueImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__bad_model_unexpected_arg_with_valueImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl BadModelUnexpectedArgIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'BadModelUnexpectedArg', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct BadModelUnexpectedArgEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl BadModelUnexpectedArgEntityStoreImpl of BadModelUnexpectedArgEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelUnexpectedArgEntity { + BadModelUnexpectedArgModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelUnexpectedArg::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelUnexpectedArgEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl BadModelUnexpectedArgStoreImpl of BadModelUnexpectedArgStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> BadModelUnexpectedArg { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `BadModelUnexpectedArg`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelUnexpectedArg { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelUnexpectedArg::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelUnexpectedArg, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl BadModelUnexpectedArgModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @BadModelUnexpectedArgEntity) -> felt252 { + *self.__id + } + + fn values(self: @BadModelUnexpectedArgEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> BadModelUnexpectedArgEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `BadModelUnexpectedArgEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelUnexpectedArgEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @BadModelUnexpectedArgEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @BadModelUnexpectedArgEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelUnexpectedArgEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl BadModelUnexpectedArgModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> BadModelUnexpectedArg { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + BadModelUnexpectedArgStore::from_values(ref _keys, ref values) + } + + fn set( + self: @BadModelUnexpectedArg, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @BadModelUnexpectedArg, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelUnexpectedArg, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "BadModelUnexpectedArg" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-BadModelUnexpectedArg" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 2062327100205703339988289387876316143748074129748784084948535166252334131324 + } + + #[inline(always)] + fn instance_selector(self: @BadModelUnexpectedArg) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 246403407829267991441535935236143476032296881039254363860883767387993960270 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @BadModelUnexpectedArg) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @BadModelUnexpectedArg) -> 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: @BadModelUnexpectedArg) -> 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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @BadModelUnexpectedArg) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Ibad_model_unexpected_arg { + fn ensure_abi(self: @T, model: BadModelUnexpectedArg); +} + +#[starknet::contract] +pub mod bad_model_unexpected_arg { + use super::BadModelUnexpectedArg; + use super::Ibad_model_unexpected_arg; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl bad_model_unexpected_argImpl of Ibad_model_unexpected_arg{ + fn ensure_abi(self: @ContractState, model: BadModelUnexpectedArg) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__bad_model_unexpected_argImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + bad_model_unexpected_argImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__bad_model_unexpected_argImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl BadModelNotSupportedVersionIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'BadModelNotSupportedVersion', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct BadModelNotSupportedVersionEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl BadModelNotSupportedVersionEntityStoreImpl of BadModelNotSupportedVersionEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelNotSupportedVersionEntity { + BadModelNotSupportedVersionModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelNotSupportedVersion::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelNotSupportedVersionEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl BadModelNotSupportedVersionStoreImpl of BadModelNotSupportedVersionStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> BadModelNotSupportedVersion { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `BadModelNotSupportedVersion`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelNotSupportedVersion { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `BadModelNotSupportedVersion::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @BadModelNotSupportedVersion, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl BadModelNotSupportedVersionModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @BadModelNotSupportedVersionEntity) -> felt252 { + *self.__id + } + + fn values(self: @BadModelNotSupportedVersionEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> BadModelNotSupportedVersionEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `BadModelNotSupportedVersionEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelNotSupportedVersionEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @BadModelNotSupportedVersionEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @BadModelNotSupportedVersionEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelNotSupportedVersionEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl BadModelNotSupportedVersionModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> BadModelNotSupportedVersion { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + BadModelNotSupportedVersionStore::from_values(ref _keys, ref values) + } + + fn set( + self: @BadModelNotSupportedVersion, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @BadModelNotSupportedVersion, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @BadModelNotSupportedVersion, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "BadModelNotSupportedVersion" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-BadModelNotSupportedVersion" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 2399868061331388591523307843619168972583102717296603562171130686072940081207 + } + + #[inline(always)] + fn instance_selector(self: @BadModelNotSupportedVersion) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 1812257929012908024237871796629728977392496349235879470060252299886369485820 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @BadModelNotSupportedVersion) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @BadModelNotSupportedVersion) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Ibad_model_not_supported_version { + fn ensure_abi(self: @T, model: BadModelNotSupportedVersion); +} + +#[starknet::contract] +pub mod bad_model_not_supported_version { + use super::BadModelNotSupportedVersion; + use super::Ibad_model_not_supported_version; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::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) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__bad_model_not_supported_versionImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + bad_model_not_supported_versionImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__bad_model_not_supported_versionImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl Modelv0Introspect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'Modelv0', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct Modelv0Entity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl Modelv0EntityStoreImpl of Modelv0EntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Modelv0Entity { + Modelv0ModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `Modelv0::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @Modelv0Entity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl Modelv0StoreImpl of Modelv0Store { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> Modelv0 { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> Modelv0 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `Modelv0::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @Modelv0, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl Modelv0ModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @Modelv0Entity) -> felt252 { + *self.__id + } + + fn values(self: @Modelv0Entity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> Modelv0Entity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `Modelv0Entity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Modelv0Entity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @Modelv0Entity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @Modelv0Entity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @Modelv0Entity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl Modelv0ModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> Modelv0 { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + Modelv0Store::from_values(ref _keys, ref values) + } + + fn set( + self: @Modelv0, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @Modelv0, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @Modelv0, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "Modelv0" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-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 name_hash() -> felt252 { + 2212879130471315306779111820244908968466545702031328551192231795237740448313 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @Modelv0) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @Modelv0) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imodelv_0 { + fn ensure_abi(self: @T, model: Modelv0); +} + +#[starknet::contract] +pub mod modelv_0 { + use super::Modelv0; + use super::Imodelv_0; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl modelv_0Impl of Imodelv_0{ + fn ensure_abi(self: @ContractState, model: Modelv0) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__modelv_0Impl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + modelv_0Impl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__modelv_0Impl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl ModelWithBadNamespaceFormatIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'ModelWithBadNamespaceFormat', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct ModelWithBadNamespaceFormatEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl ModelWithBadNamespaceFormatEntityStoreImpl of ModelWithBadNamespaceFormatEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithBadNamespaceFormatEntity { + ModelWithBadNamespaceFormatModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithBadNamespaceFormat::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @ModelWithBadNamespaceFormatEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl ModelWithBadNamespaceFormatStoreImpl of ModelWithBadNamespaceFormatStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithBadNamespaceFormat { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithBadNamespaceFormat { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithBadNamespaceFormat::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @ModelWithBadNamespaceFormat, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl ModelWithBadNamespaceFormatModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @ModelWithBadNamespaceFormatEntity) -> felt252 { + *self.__id + } + + fn values(self: @ModelWithBadNamespaceFormatEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> ModelWithBadNamespaceFormatEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `ModelWithBadNamespaceFormatEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithBadNamespaceFormatEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @ModelWithBadNamespaceFormatEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @ModelWithBadNamespaceFormatEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithBadNamespaceFormatEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl ModelWithBadNamespaceFormatModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> ModelWithBadNamespaceFormat { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + ModelWithBadNamespaceFormatStore::from_values(ref _keys, ref values) + } + + fn set( + self: @ModelWithBadNamespaceFormat, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @ModelWithBadNamespaceFormat, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithBadNamespaceFormat, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "ModelWithBadNamespaceFormat" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-ModelWithBadNamespaceFormat" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 3059539413433693207383279334860020534329215374860715071558931541261069058621 + } + + #[inline(always)] + fn instance_selector(self: @ModelWithBadNamespaceFormat) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 513559242384681567568052881519197161166285694153303371154270254637843894159 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @ModelWithBadNamespaceFormat) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @ModelWithBadNamespaceFormat) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imodel_with_bad_namespace_format { + fn ensure_abi(self: @T, model: ModelWithBadNamespaceFormat); +} + +#[starknet::contract] +pub mod model_with_bad_namespace_format { + use super::ModelWithBadNamespaceFormat; + use super::Imodel_with_bad_namespace_format; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::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) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__model_with_bad_namespace_formatImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + model_with_bad_namespace_formatImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__model_with_bad_namespace_formatImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl ModelWithShortStringNamespaceIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'ModelWithShortStringNamespace', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct ModelWithShortStringNamespaceEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl ModelWithShortStringNamespaceEntityStoreImpl of ModelWithShortStringNamespaceEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithShortStringNamespaceEntity { + ModelWithShortStringNamespaceModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithShortStringNamespace::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @ModelWithShortStringNamespaceEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl ModelWithShortStringNamespaceStoreImpl of ModelWithShortStringNamespaceStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithShortStringNamespace { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithShortStringNamespace { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithShortStringNamespace::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @ModelWithShortStringNamespace, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl ModelWithShortStringNamespaceModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @ModelWithShortStringNamespaceEntity) -> felt252 { + *self.__id + } + + fn values(self: @ModelWithShortStringNamespaceEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> ModelWithShortStringNamespaceEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `ModelWithShortStringNamespaceEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithShortStringNamespaceEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @ModelWithShortStringNamespaceEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @ModelWithShortStringNamespaceEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithShortStringNamespaceEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl ModelWithShortStringNamespaceModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> ModelWithShortStringNamespace { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + ModelWithShortStringNamespaceStore::from_values(ref _keys, ref values) + } + + fn set( + self: @ModelWithShortStringNamespace, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @ModelWithShortStringNamespace, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithShortStringNamespace, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "ModelWithShortStringNamespace" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-ModelWithShortStringNamespace" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 516169310422367104631924468147010406642920381144711483043394373786075028578 + } + + #[inline(always)] + fn instance_selector(self: @ModelWithShortStringNamespace) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 4646597166239297873853881466258165424425132957303541470648153031188639878 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @ModelWithShortStringNamespace) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[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: @ModelWithShortStringNamespace) -> 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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @ModelWithShortStringNamespace) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imodel_with_short_string_namespace { + fn ensure_abi(self: @T, model: ModelWithShortStringNamespace); +} + +#[starknet::contract] +pub mod model_with_short_string_namespace { + use super::ModelWithShortStringNamespace; + use super::Imodel_with_short_string_namespace; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl model_with_short_string_namespaceImpl of Imodel_with_short_string_namespace{ + fn ensure_abi(self: @ContractState, model: ModelWithShortStringNamespace) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__model_with_short_string_namespaceImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + model_with_short_string_namespaceImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__model_with_short_string_namespaceImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl ModelWithStringNamespaceIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'ModelWithStringNamespace', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct ModelWithStringNamespaceEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl ModelWithStringNamespaceEntityStoreImpl of ModelWithStringNamespaceEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithStringNamespaceEntity { + ModelWithStringNamespaceModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithStringNamespace::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @ModelWithStringNamespaceEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl ModelWithStringNamespaceStoreImpl of ModelWithStringNamespaceStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithStringNamespace { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithStringNamespace { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithStringNamespace::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @ModelWithStringNamespace, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl ModelWithStringNamespaceModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @ModelWithStringNamespaceEntity) -> felt252 { + *self.__id + } + + fn values(self: @ModelWithStringNamespaceEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> ModelWithStringNamespaceEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `ModelWithStringNamespaceEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithStringNamespaceEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @ModelWithStringNamespaceEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @ModelWithStringNamespaceEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithStringNamespaceEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl ModelWithStringNamespaceModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> ModelWithStringNamespace { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + ModelWithStringNamespaceStore::from_values(ref _keys, ref values) + } + + fn set( + self: @ModelWithStringNamespace, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @ModelWithStringNamespace, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithStringNamespace, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "ModelWithStringNamespace" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-ModelWithStringNamespace" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 2244952983831849087562617629161882602941157493177409459461888999685738447838 + } + + #[inline(always)] + fn instance_selector(self: @ModelWithStringNamespace) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 36187013840655350498900857372670392628596870210415176261336407419317644423 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @ModelWithStringNamespace) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[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: @ModelWithStringNamespace) -> 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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @ModelWithStringNamespace) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imodel_with_string_namespace { + fn ensure_abi(self: @T, model: ModelWithStringNamespace); +} + +#[starknet::contract] +pub mod model_with_string_namespace { + use super::ModelWithStringNamespace; + use super::Imodel_with_string_namespace; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl model_with_string_namespaceImpl of Imodel_with_string_namespace{ + fn ensure_abi(self: @ContractState, model: ModelWithStringNamespace) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__model_with_string_namespaceImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + model_with_string_namespaceImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__model_with_string_namespaceImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl PositionIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'Position', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct PositionEntity { + __id: felt252, // private field + pub v: Vec3, + +} + +#[generate_trait] +pub impl PositionEntityStoreImpl of PositionEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> PositionEntity { + PositionModelEntityImpl::get(world, entity_id) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `Position::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @PositionEntity, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl PositionStoreImpl of PositionStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> Position { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `Position`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> Position { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 578691550836206188651404750433984985630363913126316857592149308417275000080 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `Position::v`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_v(self: @Position, world: dojo::world::IWorldDispatcher, value: Vec3) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 578691550836206188651404750433984985630363913126316857592149308417275000080, + serialized.span() + ); + } + +} + +pub impl PositionModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @PositionEntity) -> felt252 { + *self.__id + } + + fn values(self: @PositionEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> PositionEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `PositionEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> PositionEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @PositionEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @PositionEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @PositionEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl PositionModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> Position { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + PositionStore::from_values(ref _keys, ref values) + } + + fn set( + self: @Position, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @Position, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @Position, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "Position" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-Position" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 2583140722357655302813194934296353271867745884944715988664292532004552033294 + } + + #[inline(always)] + fn instance_selector(self: @Position) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 2899920299641094436341712346886623904698864491830316325765258522168980161362 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @Position) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @Position) -> 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: @Position) -> 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::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @Position) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Iposition { + fn ensure_abi(self: @T, model: Position); +} + +#[starknet::contract] +pub mod position { + use super::Position; + use super::Iposition; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl positionImpl of Iposition{ + fn ensure_abi(self: @ContractState, model: Position) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__positionImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + positionImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__positionImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl RolesIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 387776731289756409274549987067854286905927440612427426920343953432870065647, + layout: dojo::model::introspect::Introspect:: +>::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'Roles', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'role_ids', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct RolesEntity { + __id: felt252, // private field + pub role_ids: Array, + +} + +#[generate_trait] +pub impl RolesEntityStoreImpl of RolesEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> RolesEntity { + RolesModelEntityImpl::get(world, entity_id) + } + + + fn get_role_ids(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Array { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 387776731289756409274549987067854286905927440612427426920343953432870065647 + ); + let field_value = core::serde::Serde::>::deserialize(ref values); + + if core::option::OptionTrait::>::is_none(@field_value) { + panic!( + "Field `Roles::role_ids`: deserialization failed." + ); + } + + core::option::OptionTrait::>::unwrap(field_value) + } + + fn set_role_ids(self: @RolesEntity, world: dojo::world::IWorldDispatcher, value: Array) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 387776731289756409274549987067854286905927440612427426920343953432870065647, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl RolesStoreImpl of RolesStore { + fn entity_id_from_keys() -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> Roles { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `Roles`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, ) -> Roles { + let mut serialized = core::array::ArrayTrait::new(); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_role_ids(world: dojo::world::IWorldDispatcher, ) -> Array { + let mut serialized = core::array::ArrayTrait::new(); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 387776731289756409274549987067854286905927440612427426920343953432870065647 + ); + + let field_value = core::serde::Serde::>::deserialize(ref values); + + if core::option::OptionTrait::>::is_none(@field_value) { + panic!( + "Field `Roles::role_ids`: deserialization failed." + ); + } + + core::option::OptionTrait::>::unwrap(field_value) + } + + fn set_role_ids(self: @Roles, world: dojo::world::IWorldDispatcher, value: Array) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 387776731289756409274549987067854286905927440612427426920343953432870065647, + serialized.span() + ); + } + +} + +pub impl RolesModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @RolesEntity) -> felt252 { + *self.__id + } + + fn values(self: @RolesEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.role_ids, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> RolesEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `RolesEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> RolesEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @RolesEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @RolesEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @RolesEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl RolesModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> Roles { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + RolesStore::from_values(ref _keys, ref values) + } + + fn set( + self: @Roles, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @Roles, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @Roles, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "Roles" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-Roles" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 2381319068167303801085530774544728044506110381004500761927797648058170896946 + } + + #[inline(always)] + fn instance_selector(self: @Roles) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 2030971736961612564423689930729061756599290850089001157163423482274886199516 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @Roles) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @Roles) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @Roles) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.role_ids, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @Roles) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Iroles { + fn ensure_abi(self: @T, model: Roles); +} + +#[starknet::contract] +pub mod roles { + use super::Roles; + use super::Iroles; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl rolesImpl of Iroles{ + fn ensure_abi(self: @ContractState, model: Roles) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__rolesImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + rolesImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__rolesImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl OnlyKeyModelIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'OnlyKeyModel', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct OnlyKeyModelEntity { + __id: felt252, // private field + +} + +#[generate_trait] +pub impl OnlyKeyModelEntityStoreImpl of OnlyKeyModelEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> OnlyKeyModelEntity { + OnlyKeyModelModelEntityImpl::get(world, entity_id) + } + + +} + +#[generate_trait] +pub impl OnlyKeyModelStoreImpl of OnlyKeyModelStore { + fn entity_id_from_keys(id: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> OnlyKeyModel { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `OnlyKeyModel`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> OnlyKeyModel { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, id); + + + dojo::model::Model::::get(world, serialized.span()) + } + + +} + +pub impl OnlyKeyModelModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @OnlyKeyModelEntity) -> felt252 { + *self.__id + } + + fn values(self: @OnlyKeyModelEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> OnlyKeyModelEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `OnlyKeyModelEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> OnlyKeyModelEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @OnlyKeyModelEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @OnlyKeyModelEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @OnlyKeyModelEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl OnlyKeyModelModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> OnlyKeyModel { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + OnlyKeyModelStore::from_values(ref _keys, ref values) + } + + fn set( + self: @OnlyKeyModel, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @OnlyKeyModel, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @OnlyKeyModel, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "OnlyKeyModel" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-OnlyKeyModel" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 399971050958024375507922651483187108363916132710819632852036528607645634778 + } + + #[inline(always)] + fn instance_selector(self: @OnlyKeyModel) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 1001826121797570811408809643478760373535949956555931325019299477987282578617 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @OnlyKeyModel) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @OnlyKeyModel) -> 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: @OnlyKeyModel) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @OnlyKeyModel) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Ionly_key_model { + fn ensure_abi(self: @T, model: OnlyKeyModel); +} + +#[starknet::contract] +pub mod only_key_model { + use super::OnlyKeyModel; + use super::Ionly_key_model; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl only_key_modelImpl of Ionly_key_model{ + fn ensure_abi(self: @ContractState, model: OnlyKeyModel) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__only_key_modelImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + only_key_modelImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__only_key_modelImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl U256KeyModelIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'U256KeyModel', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct U256KeyModelEntity { + __id: felt252, // private field + +} + +#[generate_trait] +pub impl U256KeyModelEntityStoreImpl of U256KeyModelEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> U256KeyModelEntity { + U256KeyModelModelEntityImpl::get(world, entity_id) + } + + +} + +#[generate_trait] +pub impl U256KeyModelStoreImpl of U256KeyModelStore { + fn entity_id_from_keys(id: u256) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@id, ref serialized); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> U256KeyModel { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `U256KeyModel`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, id: u256) -> U256KeyModel { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@id, ref serialized); + + + dojo::model::Model::::get(world, serialized.span()) + } + + +} + +pub impl U256KeyModelModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @U256KeyModelEntity) -> felt252 { + *self.__id + } + + fn values(self: @U256KeyModelEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> U256KeyModelEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `U256KeyModelEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> U256KeyModelEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @U256KeyModelEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @U256KeyModelEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @U256KeyModelEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl U256KeyModelModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> U256KeyModel { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + U256KeyModelStore::from_values(ref _keys, ref values) + } + + fn set( + self: @U256KeyModel, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @U256KeyModel, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @U256KeyModel, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "U256KeyModel" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-U256KeyModel" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 3403346971723769227042162502675592040860576799654783499419654467804113799823 + } + + #[inline(always)] + fn instance_selector(self: @U256KeyModel) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 1848733002266458148515852001373055968326209639346734967305014900020806934517 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @U256KeyModel) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @U256KeyModel) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.id, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @U256KeyModel) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @U256KeyModel) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Iu_256_key_model { + fn ensure_abi(self: @T, model: U256KeyModel); +} + +#[starknet::contract] +pub mod u_256_key_model { + use super::U256KeyModel; + use super::Iu_256_key_model; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl u_256_key_modelImpl of Iu_256_key_model{ + fn ensure_abi(self: @ContractState, model: U256KeyModel) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__u_256_key_modelImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + u_256_key_modelImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__u_256_key_modelImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl PlayerIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(1) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 1528802474226268325865027367859591458315299653151958663884057507666229546336, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'Player', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'game', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'name', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct PlayerEntity { + __id: felt252, // private field + pub name: felt252, + +} + +#[generate_trait] +pub impl PlayerEntityStoreImpl of PlayerEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> PlayerEntity { + PlayerModelEntityImpl::get(world, entity_id) + } + + + fn get_name(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> felt252 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 1528802474226268325865027367859591458315299653151958663884057507666229546336 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `Player::name`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_name(self: @PlayerEntity, world: dojo::world::IWorldDispatcher, value: felt252) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1528802474226268325865027367859591458315299653151958663884057507666229546336, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl PlayerStoreImpl of PlayerStore { + fn entity_id_from_keys(game: felt252, player: ContractAddress) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, game); +core::serde::Serde::serialize(@player, ref serialized); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> Player { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `Player`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, game: felt252, player: ContractAddress) -> Player { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, game); +core::serde::Serde::serialize(@player, ref serialized); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_name(world: dojo::world::IWorldDispatcher, game: felt252, player: ContractAddress) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, game); +core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 1528802474226268325865027367859591458315299653151958663884057507666229546336 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `Player::name`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_name(self: @Player, world: dojo::world::IWorldDispatcher, value: felt252) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1528802474226268325865027367859591458315299653151958663884057507666229546336, + serialized.span() + ); + } + +} + +pub impl PlayerModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @PlayerEntity) -> felt252 { + *self.__id + } + + fn values(self: @PlayerEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, *self.name); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> PlayerEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `PlayerEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> PlayerEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @PlayerEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @PlayerEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @PlayerEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl PlayerModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> Player { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + PlayerStore::from_values(ref _keys, ref values) + } + + fn set( + self: @Player, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @Player, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @Player, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "Player" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-Player" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 3068209845672224878774101526910835120619854456556690065951127565061014675679 + } + + #[inline(always)] + fn instance_selector(self: @Player) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 1073075359926275415180704315933677548333097210683379121732618306925003101845 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @Player) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @Player) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, *self.game); +core::serde::Serde::serialize(self.player, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @Player) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, *self.name); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @Player) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Iplayer { + fn ensure_abi(self: @T, model: Player); +} + +#[starknet::contract] +pub mod player { + use super::Player; + use super::Iplayer; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl playerImpl of Iplayer{ + fn ensure_abi(self: @ContractState, model: Player) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__playerImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + playerImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__playerImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl ModelWithSimpleArrayIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, + layout: dojo::model::introspect::Introspect:: +>::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'ModelWithSimpleArray', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct ModelWithSimpleArrayEntity { + __id: felt252, // private field + pub x: u16, +pub y: Array, + +} + +#[generate_trait] +pub impl ModelWithSimpleArrayEntityStoreImpl of ModelWithSimpleArrayEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithSimpleArrayEntity { + ModelWithSimpleArrayModelEntityImpl::get(world, entity_id) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithSimpleArray::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithSimpleArrayEntity, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Array { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + let field_value = core::serde::Serde::>::deserialize(ref values); + + if core::option::OptionTrait::>::is_none(@field_value) { + panic!( + "Field `ModelWithSimpleArray::y`: deserialization failed." + ); + } + + core::option::OptionTrait::>::unwrap(field_value) + } + + fn set_y(self: @ModelWithSimpleArrayEntity, world: dojo::world::IWorldDispatcher, value: Array) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl ModelWithSimpleArrayStoreImpl of ModelWithSimpleArrayStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithSimpleArray { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `ModelWithSimpleArray`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithSimpleArray { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithSimpleArray::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithSimpleArray, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> Array { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + + let field_value = core::serde::Serde::>::deserialize(ref values); + + if core::option::OptionTrait::>::is_none(@field_value) { + panic!( + "Field `ModelWithSimpleArray::y`: deserialization failed." + ); + } + + core::option::OptionTrait::>::unwrap(field_value) + } + + fn set_y(self: @ModelWithSimpleArray, world: dojo::world::IWorldDispatcher, value: Array) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +pub impl ModelWithSimpleArrayModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @ModelWithSimpleArrayEntity) -> felt252 { + *self.__id + } + + fn values(self: @ModelWithSimpleArrayEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> ModelWithSimpleArrayEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `ModelWithSimpleArrayEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithSimpleArrayEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @ModelWithSimpleArrayEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @ModelWithSimpleArrayEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithSimpleArrayEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl ModelWithSimpleArrayModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> ModelWithSimpleArray { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + ModelWithSimpleArrayStore::from_values(ref _keys, ref values) + } + + fn set( + self: @ModelWithSimpleArray, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @ModelWithSimpleArray, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithSimpleArray, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "ModelWithSimpleArray" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-ModelWithSimpleArray" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 516248842335934132822768408262411488579427278776919857986291389606250466377 + } + + #[inline(always)] + fn instance_selector(self: @ModelWithSimpleArray) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 173141902001925402715103859951360389436088950156916962046507357841237663931 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @ModelWithSimpleArray) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @ModelWithSimpleArray) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.player, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @ModelWithSimpleArray) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @ModelWithSimpleArray) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imodel_with_simple_array { + fn ensure_abi(self: @T, model: ModelWithSimpleArray); +} + +#[starknet::contract] +pub mod model_with_simple_array { + use super::ModelWithSimpleArray; + use super::Imodel_with_simple_array; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl model_with_simple_arrayImpl of Imodel_with_simple_array{ + fn ensure_abi(self: @ContractState, model: ModelWithSimpleArray) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__model_with_simple_arrayImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + model_with_simple_arrayImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__model_with_simple_arrayImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl ModelWithByteArrayIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, + layout: dojo::model::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'ModelWithByteArray', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::ByteArray + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct ModelWithByteArrayEntity { + __id: felt252, // private field + pub x: u16, +pub y: ByteArray, + +} + +#[generate_trait] +pub impl ModelWithByteArrayEntityStoreImpl of ModelWithByteArrayEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithByteArrayEntity { + ModelWithByteArrayModelEntityImpl::get(world, entity_id) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithByteArray::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithByteArrayEntity, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ByteArray { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithByteArray::y`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_y(self: @ModelWithByteArrayEntity, world: dojo::world::IWorldDispatcher, value: ByteArray) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl ModelWithByteArrayStoreImpl of ModelWithByteArrayStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithByteArray { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `ModelWithByteArray`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithByteArray { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithByteArray::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithByteArray, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ByteArray { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithByteArray::y`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_y(self: @ModelWithByteArray, world: dojo::world::IWorldDispatcher, value: ByteArray) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +pub impl ModelWithByteArrayModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @ModelWithByteArrayEntity) -> felt252 { + *self.__id + } + + fn values(self: @ModelWithByteArrayEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> ModelWithByteArrayEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `ModelWithByteArrayEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithByteArrayEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @ModelWithByteArrayEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @ModelWithByteArrayEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithByteArrayEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl ModelWithByteArrayModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> ModelWithByteArray { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + ModelWithByteArrayStore::from_values(ref _keys, ref values) + } + + fn set( + self: @ModelWithByteArray, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @ModelWithByteArray, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithByteArray, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "ModelWithByteArray" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-ModelWithByteArray" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 858867864009207556499907034628308336720989886132468668210801974294049151990 + } + + #[inline(always)] + fn instance_selector(self: @ModelWithByteArray) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 2176409715042145900636260236501596599545103472111273072320531220776338338674 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @ModelWithByteArray) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @ModelWithByteArray) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.player, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @ModelWithByteArray) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @ModelWithByteArray) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imodel_with_byte_array { + fn ensure_abi(self: @T, model: ModelWithByteArray); +} + +#[starknet::contract] +pub mod model_with_byte_array { + use super::ModelWithByteArray; + use super::Imodel_with_byte_array; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl model_with_byte_arrayImpl of Imodel_with_byte_array{ + fn ensure_abi(self: @ContractState, model: ModelWithByteArray) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__model_with_byte_arrayImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + model_with_byte_arrayImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__model_with_byte_arrayImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl ModelWithComplexArrayIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, + layout: dojo::model::introspect::Introspect:: +>::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'ModelWithComplexArray', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Array( + array![ + dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct ModelWithComplexArrayEntity { + __id: felt252, // private field + pub x: u16, +pub y: Array, + +} + +#[generate_trait] +pub impl ModelWithComplexArrayEntityStoreImpl of ModelWithComplexArrayEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithComplexArrayEntity { + ModelWithComplexArrayModelEntityImpl::get(world, entity_id) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithComplexArray::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithComplexArrayEntity, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Array { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + let field_value = core::serde::Serde::>::deserialize(ref values); + + if core::option::OptionTrait::>::is_none(@field_value) { + panic!( + "Field `ModelWithComplexArray::y`: deserialization failed." + ); + } + + core::option::OptionTrait::>::unwrap(field_value) + } + + fn set_y(self: @ModelWithComplexArrayEntity, world: dojo::world::IWorldDispatcher, value: Array) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl ModelWithComplexArrayStoreImpl of ModelWithComplexArrayStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithComplexArray { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `ModelWithComplexArray`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithComplexArray { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithComplexArray::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithComplexArray, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> Array { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + + let field_value = core::serde::Serde::>::deserialize(ref values); + + if core::option::OptionTrait::>::is_none(@field_value) { + panic!( + "Field `ModelWithComplexArray::y`: deserialization failed." + ); + } + + core::option::OptionTrait::>::unwrap(field_value) + } + + fn set_y(self: @ModelWithComplexArray, world: dojo::world::IWorldDispatcher, value: Array) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +pub impl ModelWithComplexArrayModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @ModelWithComplexArrayEntity) -> felt252 { + *self.__id + } + + fn values(self: @ModelWithComplexArrayEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> ModelWithComplexArrayEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `ModelWithComplexArrayEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithComplexArrayEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @ModelWithComplexArrayEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @ModelWithComplexArrayEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithComplexArrayEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl ModelWithComplexArrayModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> ModelWithComplexArray { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + ModelWithComplexArrayStore::from_values(ref _keys, ref values) + } + + fn set( + self: @ModelWithComplexArray, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @ModelWithComplexArray, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithComplexArray, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "ModelWithComplexArray" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-ModelWithComplexArray" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 298653312264896693167501639402458085580783343254117966446641652721994965516 + } + + #[inline(always)] + fn instance_selector(self: @ModelWithComplexArray) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 2866472224509756243720005045848892642397514372569303051745174230372637769655 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @ModelWithComplexArray) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @ModelWithComplexArray) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.player, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @ModelWithComplexArray) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @ModelWithComplexArray) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imodel_with_complex_array { + fn ensure_abi(self: @T, model: ModelWithComplexArray); +} + +#[starknet::contract] +pub mod model_with_complex_array { + use super::ModelWithComplexArray; + use super::Imodel_with_complex_array; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl model_with_complex_arrayImpl of Imodel_with_complex_array{ + fn ensure_abi(self: @ContractState, model: ModelWithComplexArray) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__model_with_complex_arrayImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + model_with_complex_arrayImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__model_with_complex_arrayImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl ModelWithTupleIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::Some(4) + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'ModelWithTuple', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct ModelWithTupleEntity { + __id: felt252, // private field + pub x: u16, +pub y: (u8, u16, u32), + +} + +#[generate_trait] +pub impl ModelWithTupleEntityStoreImpl of ModelWithTupleEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithTupleEntity { + ModelWithTupleModelEntityImpl::get(world, entity_id) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithTuple::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithTupleEntity, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> (u8, u16, u32) { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + let field_value = core::serde::Serde::<(u8, u16, u32)>::deserialize(ref values); + + if core::option::OptionTrait::<(u8, u16, u32)>::is_none(@field_value) { + panic!( + "Field `ModelWithTuple::y`: deserialization failed." + ); + } + + core::option::OptionTrait::<(u8, u16, u32)>::unwrap(field_value) + } + + fn set_y(self: @ModelWithTupleEntity, world: dojo::world::IWorldDispatcher, value: (u8, u16, u32)) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl ModelWithTupleStoreImpl of ModelWithTupleStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithTuple { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `ModelWithTuple`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithTuple { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithTuple::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithTuple, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> (u8, u16, u32) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + + let field_value = core::serde::Serde::<(u8, u16, u32)>::deserialize(ref values); + + if core::option::OptionTrait::<(u8, u16, u32)>::is_none(@field_value) { + panic!( + "Field `ModelWithTuple::y`: deserialization failed." + ); + } + + core::option::OptionTrait::<(u8, u16, u32)>::unwrap(field_value) + } + + fn set_y(self: @ModelWithTuple, world: dojo::world::IWorldDispatcher, value: (u8, u16, u32)) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +pub impl ModelWithTupleModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @ModelWithTupleEntity) -> felt252 { + *self.__id + } + + fn values(self: @ModelWithTupleEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> ModelWithTupleEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `ModelWithTupleEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithTupleEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @ModelWithTupleEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @ModelWithTupleEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithTupleEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl ModelWithTupleModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> ModelWithTuple { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + ModelWithTupleStore::from_values(ref _keys, ref values) + } + + fn set( + self: @ModelWithTuple, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @ModelWithTuple, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithTuple, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "ModelWithTuple" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-ModelWithTuple" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 3520389162382437315776520663535583701836688108885454850509972628400715241 + } + + #[inline(always)] + fn instance_selector(self: @ModelWithTuple) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 3222351670132870101782632958288197874250493316621507272653773018669253981260 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @ModelWithTuple) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @ModelWithTuple) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.player, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @ModelWithTuple) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @ModelWithTuple) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imodel_with_tuple { + fn ensure_abi(self: @T, model: ModelWithTuple); +} + +#[starknet::contract] +pub mod model_with_tuple { + use super::ModelWithTuple; + use super::Imodel_with_tuple; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl model_with_tupleImpl of Imodel_with_tuple{ + fn ensure_abi(self: @ContractState, model: ModelWithTuple) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__model_with_tupleImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + model_with_tupleImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__model_with_tupleImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} + +impl ModelWithTupleNoPrimitivesIntrospect<> of dojo::model::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::model::introspect::Introspect::::size(), +Option::Some(3) + ]; + + if dojo::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::utils::sum(sizes)) + + } + + fn layout() -> dojo::model::Layout { + dojo::model::Layout::Struct( + array![ + dojo::model::FieldLayout { + selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, + layout: dojo::model::introspect::Introspect::::layout() + }, +dojo::model::FieldLayout { + selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, + layout: dojo::model::Layout::Tuple( + array![ + dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout(), +dojo::model::introspect::Introspect::::layout() + ].span() + ) + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::model::introspect::Ty { + dojo::model::introspect::Ty::Struct( + dojo::model::introspect::Struct { + name: 'ModelWithTupleNoPrimitives', + attrs: array![].span(), + children: array![ + dojo::model::introspect::Member { + name: 'player', + attrs: array!['key'].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'x', + attrs: array![].span(), + ty: dojo::model::introspect::Introspect::::ty() + }, +dojo::model::introspect::Member { + name: 'y', + attrs: array![].span(), + ty: dojo::model::introspect::Ty::Tuple( + array![ + dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty(), +dojo::model::introspect::Introspect::::ty() + ].span() + ) + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct ModelWithTupleNoPrimitivesEntity { + __id: felt252, // private field + pub x: u16, +pub y: (u8, Vec3, u32), + +} + +#[generate_trait] +pub impl ModelWithTupleNoPrimitivesEntityStoreImpl of ModelWithTupleNoPrimitivesEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithTupleNoPrimitivesEntity { + ModelWithTupleNoPrimitivesModelEntityImpl::get(world, entity_id) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16 { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithTupleNoPrimitives::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithTupleNoPrimitivesEntity, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> (u8, Vec3, u32) { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + let field_value = core::serde::Serde::<(u8, Vec3, u32)>::deserialize(ref values); + + if core::option::OptionTrait::<(u8, Vec3, u32)>::is_none(@field_value) { + panic!( + "Field `ModelWithTupleNoPrimitives::y`: deserialization failed." + ); + } + + core::option::OptionTrait::<(u8, Vec3, u32)>::unwrap(field_value) + } + + fn set_y(self: @ModelWithTupleNoPrimitivesEntity, world: dojo::world::IWorldDispatcher, value: (u8, Vec3, u32)) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl ModelWithTupleNoPrimitivesStoreImpl of ModelWithTupleNoPrimitivesStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithTupleNoPrimitives { + let mut serialized = core::array::ArrayTrait::new(); + serialized.append_span(keys); + serialized.append_span(values); + 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 `ModelWithTupleNoPrimitives`: 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) + } + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithTupleNoPrimitives { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + dojo::model::Model::::get(world, serialized.span()) + } + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 512066735765477566404754172672287371265995314501343422459174036873487219331 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `ModelWithTupleNoPrimitives::x`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_x(self: @ModelWithTupleNoPrimitives, world: dojo::world::IWorldDispatcher, value: u16) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 512066735765477566404754172672287371265995314501343422459174036873487219331, + serialized.span() + ); + } + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> (u8, Vec3, u32) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@player, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 1591024729085637502504777720563487898377940395575083379770417352976841400819 + ); + + let field_value = core::serde::Serde::<(u8, Vec3, u32)>::deserialize(ref values); + + if core::option::OptionTrait::<(u8, Vec3, u32)>::is_none(@field_value) { + panic!( + "Field `ModelWithTupleNoPrimitives::y`: deserialization failed." + ); + } + + core::option::OptionTrait::<(u8, Vec3, u32)>::unwrap(field_value) + } + + fn set_y(self: @ModelWithTupleNoPrimitives, world: dojo::world::IWorldDispatcher, value: (u8, Vec3, u32)) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1591024729085637502504777720563487898377940395575083379770417352976841400819, + serialized.span() + ); + } + +} + +pub impl ModelWithTupleNoPrimitivesModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @ModelWithTupleNoPrimitivesEntity) -> felt252 { + *self.__id + } + + fn values(self: @ModelWithTupleNoPrimitivesEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> ModelWithTupleNoPrimitivesEntity { + let mut serialized = array![entity_id]; + serialized.append_span(values); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity_values = core::serde::Serde::::deserialize(ref serialized); + if core::option::OptionTrait::::is_none(@entity_values) { + panic!( + "ModelEntity `ModelWithTupleNoPrimitivesEntity`: deserialization failed." + ); + } + core::option::OptionTrait::::unwrap(entity_values) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithTupleNoPrimitivesEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + Self::from_values(entity_id, ref values) + } + + fn update(self: @ModelWithTupleNoPrimitivesEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete(self: @ModelWithTupleNoPrimitivesEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithTupleNoPrimitivesEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl ModelWithTupleNoPrimitivesModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> ModelWithTupleNoPrimitives { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + ModelWithTupleNoPrimitivesStore::from_values(ref _keys, ref values) + } + + fn set( + self: @ModelWithTupleNoPrimitives, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete( + self: @ModelWithTupleNoPrimitives, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @ModelWithTupleNoPrimitives, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "ModelWithTupleNoPrimitives" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "test_package" + } + + #[inline(always)] + fn tag() -> ByteArray { + "test_package-ModelWithTupleNoPrimitives" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 2133652848391750418502705747419625263797079439106286994977255727801602328040 + } + + #[inline(always)] + fn instance_selector(self: @ModelWithTupleNoPrimitives) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 157059227407493660591195028728750607977045261142495925435047270200565107096 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + #[inline(always)] + fn entity_id(self: @ModelWithTupleNoPrimitives) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @ModelWithTupleNoPrimitives) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.player, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @ModelWithTupleNoPrimitives) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.x, ref serialized); +core::serde::Serde::serialize(self.y, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::model::Layout { + dojo::model::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @ModelWithTupleNoPrimitives) -> dojo::model::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::model::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imodel_with_tuple_no_primitives { + fn ensure_abi(self: @T, model: ModelWithTupleNoPrimitives); +} + +#[starknet::contract] +pub mod model_with_tuple_no_primitives { + use super::ModelWithTupleNoPrimitives; + use super::Imodel_with_tuple_no_primitives; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + 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 selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::model::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::model::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::model::introspect::Ty { + dojo::model::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl model_with_tuple_no_primitivesImpl of Imodel_with_tuple_no_primitives{ + fn ensure_abi(self: @ContractState, model: ModelWithTupleNoPrimitives) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + } + } +} +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__model_with_tuple_no_primitivesImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + model_with_tuple_no_primitivesImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__model_with_tuple_no_primitivesImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +} +impl BadModelMultipleVersionsEntityDrop of core::traits::Drop::; +impl BadModelMultipleVersionsEntitySerde of core::serde::Serde:: { + fn serialize(self: @BadModelMultipleVersionsEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(BadModelMultipleVersionsEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait BadModelMultipleVersionsEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelMultipleVersionsEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @BadModelMultipleVersionsEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait BadModelMultipleVersionsStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> BadModelMultipleVersions; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelMultipleVersions; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @BadModelMultipleVersions, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Ibad_model_multiple_versionsDispatcherTrait { + fn ensure_abi(self: T, model: BadModelMultipleVersions); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_multiple_versionsDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_multiple_versionsDispatcherImpl of Ibad_model_multiple_versionsDispatcherTrait { + fn ensure_abi(self: Ibad_model_multiple_versionsDispatcher, model: BadModelMultipleVersions) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_multiple_versionsLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_multiple_versionsLibraryDispatcherImpl of Ibad_model_multiple_versionsDispatcherTrait { + fn ensure_abi(self: Ibad_model_multiple_versionsLibraryDispatcher, model: BadModelMultipleVersions) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Ibad_model_multiple_versionsSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: BadModelMultipleVersions) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_multiple_versionsSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_multiple_versionsSafeLibraryDispatcherImpl of Ibad_model_multiple_versionsSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_multiple_versionsSafeLibraryDispatcher, model: BadModelMultipleVersions) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_multiple_versionsSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_multiple_versionsSafeDispatcherImpl of Ibad_model_multiple_versionsSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_multiple_versionsSafeDispatcher, model: BadModelMultipleVersions) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl BadModelBadVersionTypeEntityDrop of core::traits::Drop::; +impl BadModelBadVersionTypeEntitySerde of core::serde::Serde:: { + fn serialize(self: @BadModelBadVersionTypeEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(BadModelBadVersionTypeEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait BadModelBadVersionTypeEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelBadVersionTypeEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @BadModelBadVersionTypeEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait BadModelBadVersionTypeStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> BadModelBadVersionType; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelBadVersionType; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @BadModelBadVersionType, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Ibad_model_bad_version_typeDispatcherTrait { + fn ensure_abi(self: T, model: BadModelBadVersionType); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_bad_version_typeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_bad_version_typeDispatcherImpl of Ibad_model_bad_version_typeDispatcherTrait { + fn ensure_abi(self: Ibad_model_bad_version_typeDispatcher, model: BadModelBadVersionType) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_bad_version_typeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_bad_version_typeLibraryDispatcherImpl of Ibad_model_bad_version_typeDispatcherTrait { + fn ensure_abi(self: Ibad_model_bad_version_typeLibraryDispatcher, model: BadModelBadVersionType) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Ibad_model_bad_version_typeSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: BadModelBadVersionType) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_bad_version_typeSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_bad_version_typeSafeLibraryDispatcherImpl of Ibad_model_bad_version_typeSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_bad_version_typeSafeLibraryDispatcher, model: BadModelBadVersionType) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_bad_version_typeSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_bad_version_typeSafeDispatcherImpl of Ibad_model_bad_version_typeSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_bad_version_typeSafeDispatcher, model: BadModelBadVersionType) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl BadModelNoVersionValueEntityDrop of core::traits::Drop::; +impl BadModelNoVersionValueEntitySerde of core::serde::Serde:: { + fn serialize(self: @BadModelNoVersionValueEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(BadModelNoVersionValueEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait BadModelNoVersionValueEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelNoVersionValueEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @BadModelNoVersionValueEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait BadModelNoVersionValueStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> BadModelNoVersionValue; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelNoVersionValue; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @BadModelNoVersionValue, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Ibad_model_no_version_valueDispatcherTrait { + fn ensure_abi(self: T, model: BadModelNoVersionValue); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_no_version_valueDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_no_version_valueDispatcherImpl of Ibad_model_no_version_valueDispatcherTrait { + fn ensure_abi(self: Ibad_model_no_version_valueDispatcher, model: BadModelNoVersionValue) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_no_version_valueLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_no_version_valueLibraryDispatcherImpl of Ibad_model_no_version_valueDispatcherTrait { + fn ensure_abi(self: Ibad_model_no_version_valueLibraryDispatcher, model: BadModelNoVersionValue) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Ibad_model_no_version_valueSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: BadModelNoVersionValue) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_no_version_valueSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_no_version_valueSafeLibraryDispatcherImpl of Ibad_model_no_version_valueSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_no_version_valueSafeLibraryDispatcher, model: BadModelNoVersionValue) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_no_version_valueSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_no_version_valueSafeDispatcherImpl of Ibad_model_no_version_valueSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_no_version_valueSafeDispatcher, model: BadModelNoVersionValue) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl BadModelUnexpectedArgWithValueEntityDrop of core::traits::Drop::; +impl BadModelUnexpectedArgWithValueEntitySerde of core::serde::Serde:: { + fn serialize(self: @BadModelUnexpectedArgWithValueEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(BadModelUnexpectedArgWithValueEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait BadModelUnexpectedArgWithValueEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelUnexpectedArgWithValueEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @BadModelUnexpectedArgWithValueEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait BadModelUnexpectedArgWithValueStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> BadModelUnexpectedArgWithValue; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelUnexpectedArgWithValue; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @BadModelUnexpectedArgWithValue, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Ibad_model_unexpected_arg_with_valueDispatcherTrait { + fn ensure_abi(self: T, model: BadModelUnexpectedArgWithValue); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_unexpected_arg_with_valueDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_unexpected_arg_with_valueDispatcherImpl of Ibad_model_unexpected_arg_with_valueDispatcherTrait { + fn ensure_abi(self: Ibad_model_unexpected_arg_with_valueDispatcher, model: BadModelUnexpectedArgWithValue) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_unexpected_arg_with_valueLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_unexpected_arg_with_valueLibraryDispatcherImpl of Ibad_model_unexpected_arg_with_valueDispatcherTrait { + fn ensure_abi(self: Ibad_model_unexpected_arg_with_valueLibraryDispatcher, model: BadModelUnexpectedArgWithValue) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Ibad_model_unexpected_arg_with_valueSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: BadModelUnexpectedArgWithValue) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherImpl of Ibad_model_unexpected_arg_with_valueSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcher, model: BadModelUnexpectedArgWithValue) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_unexpected_arg_with_valueSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_unexpected_arg_with_valueSafeDispatcherImpl of Ibad_model_unexpected_arg_with_valueSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_unexpected_arg_with_valueSafeDispatcher, model: BadModelUnexpectedArgWithValue) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl BadModelUnexpectedArgEntityDrop of core::traits::Drop::; +impl BadModelUnexpectedArgEntitySerde of core::serde::Serde:: { + fn serialize(self: @BadModelUnexpectedArgEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(BadModelUnexpectedArgEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait BadModelUnexpectedArgEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelUnexpectedArgEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @BadModelUnexpectedArgEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait BadModelUnexpectedArgStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> BadModelUnexpectedArg; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelUnexpectedArg; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @BadModelUnexpectedArg, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Ibad_model_unexpected_argDispatcherTrait { + fn ensure_abi(self: T, model: BadModelUnexpectedArg); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_unexpected_argDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_unexpected_argDispatcherImpl of Ibad_model_unexpected_argDispatcherTrait { + fn ensure_abi(self: Ibad_model_unexpected_argDispatcher, model: BadModelUnexpectedArg) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_unexpected_argLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_unexpected_argLibraryDispatcherImpl of Ibad_model_unexpected_argDispatcherTrait { + fn ensure_abi(self: Ibad_model_unexpected_argLibraryDispatcher, model: BadModelUnexpectedArg) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Ibad_model_unexpected_argSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: BadModelUnexpectedArg) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_unexpected_argSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_unexpected_argSafeLibraryDispatcherImpl of Ibad_model_unexpected_argSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_unexpected_argSafeLibraryDispatcher, model: BadModelUnexpectedArg) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_unexpected_argSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_unexpected_argSafeDispatcherImpl of Ibad_model_unexpected_argSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_unexpected_argSafeDispatcher, model: BadModelUnexpectedArg) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl BadModelNotSupportedVersionEntityDrop of core::traits::Drop::; +impl BadModelNotSupportedVersionEntitySerde of core::serde::Serde:: { + fn serialize(self: @BadModelNotSupportedVersionEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(BadModelNotSupportedVersionEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait BadModelNotSupportedVersionEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelNotSupportedVersionEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @BadModelNotSupportedVersionEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait BadModelNotSupportedVersionStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> BadModelNotSupportedVersion; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelNotSupportedVersion; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @BadModelNotSupportedVersion, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Ibad_model_not_supported_versionDispatcherTrait { + fn ensure_abi(self: T, model: BadModelNotSupportedVersion); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_not_supported_versionDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_not_supported_versionDispatcherImpl of Ibad_model_not_supported_versionDispatcherTrait { + fn ensure_abi(self: Ibad_model_not_supported_versionDispatcher, model: BadModelNotSupportedVersion) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_not_supported_versionLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_not_supported_versionLibraryDispatcherImpl of Ibad_model_not_supported_versionDispatcherTrait { + fn ensure_abi(self: Ibad_model_not_supported_versionLibraryDispatcher, model: BadModelNotSupportedVersion) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Ibad_model_not_supported_versionSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: BadModelNotSupportedVersion) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_not_supported_versionSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ibad_model_not_supported_versionSafeLibraryDispatcherImpl of Ibad_model_not_supported_versionSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_not_supported_versionSafeLibraryDispatcher, model: BadModelNotSupportedVersion) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ibad_model_not_supported_versionSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ibad_model_not_supported_versionSafeDispatcherImpl of Ibad_model_not_supported_versionSafeDispatcherTrait { + fn ensure_abi(self: Ibad_model_not_supported_versionSafeDispatcher, model: BadModelNotSupportedVersion) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl Modelv0EntityDrop of core::traits::Drop::; +impl Modelv0EntitySerde of core::serde::Serde:: { + fn serialize(self: @Modelv0Entity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Modelv0Entity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait Modelv0EntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Modelv0Entity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @Modelv0Entity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Modelv0Store { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> Modelv0; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> Modelv0; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @Modelv0, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Imodelv_0DispatcherTrait { + fn ensure_abi(self: T, model: Modelv0); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodelv_0Dispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodelv_0DispatcherImpl of Imodelv_0DispatcherTrait { + fn ensure_abi(self: Imodelv_0Dispatcher, model: Modelv0) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodelv_0LibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodelv_0LibraryDispatcherImpl of Imodelv_0DispatcherTrait { + fn ensure_abi(self: Imodelv_0LibraryDispatcher, model: Modelv0) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Imodelv_0SafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: Modelv0) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodelv_0SafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodelv_0SafeLibraryDispatcherImpl of Imodelv_0SafeDispatcherTrait { + fn ensure_abi(self: Imodelv_0SafeLibraryDispatcher, model: Modelv0) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodelv_0SafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodelv_0SafeDispatcherImpl of Imodelv_0SafeDispatcherTrait { + fn ensure_abi(self: Imodelv_0SafeDispatcher, model: Modelv0) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ModelWithBadNamespaceFormatEntityDrop of core::traits::Drop::; +impl ModelWithBadNamespaceFormatEntitySerde of core::serde::Serde:: { + fn serialize(self: @ModelWithBadNamespaceFormatEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ModelWithBadNamespaceFormatEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait ModelWithBadNamespaceFormatEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithBadNamespaceFormatEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @ModelWithBadNamespaceFormatEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait ModelWithBadNamespaceFormatStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithBadNamespaceFormat; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithBadNamespaceFormat; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @ModelWithBadNamespaceFormat, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Imodel_with_bad_namespace_formatDispatcherTrait { + fn ensure_abi(self: T, model: ModelWithBadNamespaceFormat); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_bad_namespace_formatDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_bad_namespace_formatDispatcherImpl of Imodel_with_bad_namespace_formatDispatcherTrait { + fn ensure_abi(self: Imodel_with_bad_namespace_formatDispatcher, model: ModelWithBadNamespaceFormat) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_bad_namespace_formatLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_bad_namespace_formatLibraryDispatcherImpl of Imodel_with_bad_namespace_formatDispatcherTrait { + fn ensure_abi(self: Imodel_with_bad_namespace_formatLibraryDispatcher, model: ModelWithBadNamespaceFormat) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Imodel_with_bad_namespace_formatSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: ModelWithBadNamespaceFormat) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_bad_namespace_formatSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_bad_namespace_formatSafeLibraryDispatcherImpl of Imodel_with_bad_namespace_formatSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_bad_namespace_formatSafeLibraryDispatcher, model: ModelWithBadNamespaceFormat) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_bad_namespace_formatSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_bad_namespace_formatSafeDispatcherImpl of Imodel_with_bad_namespace_formatSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_bad_namespace_formatSafeDispatcher, model: ModelWithBadNamespaceFormat) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ModelWithShortStringNamespaceEntityDrop of core::traits::Drop::; +impl ModelWithShortStringNamespaceEntitySerde of core::serde::Serde:: { + fn serialize(self: @ModelWithShortStringNamespaceEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ModelWithShortStringNamespaceEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait ModelWithShortStringNamespaceEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithShortStringNamespaceEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @ModelWithShortStringNamespaceEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait ModelWithShortStringNamespaceStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithShortStringNamespace; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithShortStringNamespace; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @ModelWithShortStringNamespace, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Imodel_with_short_string_namespaceDispatcherTrait { + fn ensure_abi(self: T, model: ModelWithShortStringNamespace); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_short_string_namespaceDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_short_string_namespaceDispatcherImpl of Imodel_with_short_string_namespaceDispatcherTrait { + fn ensure_abi(self: Imodel_with_short_string_namespaceDispatcher, model: ModelWithShortStringNamespace) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_short_string_namespaceLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_short_string_namespaceLibraryDispatcherImpl of Imodel_with_short_string_namespaceDispatcherTrait { + fn ensure_abi(self: Imodel_with_short_string_namespaceLibraryDispatcher, model: ModelWithShortStringNamespace) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Imodel_with_short_string_namespaceSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: ModelWithShortStringNamespace) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_short_string_namespaceSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_short_string_namespaceSafeLibraryDispatcherImpl of Imodel_with_short_string_namespaceSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_short_string_namespaceSafeLibraryDispatcher, model: ModelWithShortStringNamespace) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_short_string_namespaceSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_short_string_namespaceSafeDispatcherImpl of Imodel_with_short_string_namespaceSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_short_string_namespaceSafeDispatcher, model: ModelWithShortStringNamespace) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ModelWithStringNamespaceEntityDrop of core::traits::Drop::; +impl ModelWithStringNamespaceEntitySerde of core::serde::Serde:: { + fn serialize(self: @ModelWithStringNamespaceEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ModelWithStringNamespaceEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait ModelWithStringNamespaceEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithStringNamespaceEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @ModelWithStringNamespaceEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait ModelWithStringNamespaceStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithStringNamespace; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithStringNamespace; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @ModelWithStringNamespace, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait Imodel_with_string_namespaceDispatcherTrait { + fn ensure_abi(self: T, model: ModelWithStringNamespace); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_string_namespaceDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_string_namespaceDispatcherImpl of Imodel_with_string_namespaceDispatcherTrait { + fn ensure_abi(self: Imodel_with_string_namespaceDispatcher, model: ModelWithStringNamespace) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_string_namespaceLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_string_namespaceLibraryDispatcherImpl of Imodel_with_string_namespaceDispatcherTrait { + fn ensure_abi(self: Imodel_with_string_namespaceLibraryDispatcher, model: ModelWithStringNamespace) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Imodel_with_string_namespaceSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: ModelWithStringNamespace) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_string_namespaceSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_string_namespaceSafeLibraryDispatcherImpl of Imodel_with_string_namespaceSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_string_namespaceSafeLibraryDispatcher, model: ModelWithStringNamespace) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_string_namespaceSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_string_namespaceSafeDispatcherImpl of Imodel_with_string_namespaceSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_string_namespaceSafeDispatcher, model: ModelWithStringNamespace) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl PositionEntityDrop of core::traits::Drop::; +impl PositionEntitySerde of core::serde::Serde:: { + fn serialize(self: @PositionEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(PositionEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait PositionEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> PositionEntity; + + + fn get_v(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Vec3; + + fn set_v(self: @PositionEntity, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait PositionStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> Position; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> Position; + + + fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3; + + fn set_v(self: @Position, world: dojo::world::IWorldDispatcher, value: Vec3); + +} +pub trait IpositionDispatcherTrait { + fn ensure_abi(self: T, model: Position); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IpositionDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IpositionDispatcherImpl of IpositionDispatcherTrait { + fn ensure_abi(self: IpositionDispatcher, model: Position) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IpositionLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IpositionLibraryDispatcherImpl of IpositionDispatcherTrait { + fn ensure_abi(self: IpositionLibraryDispatcher, model: Position) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait IpositionSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: Position) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IpositionSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IpositionSafeLibraryDispatcherImpl of IpositionSafeDispatcherTrait { + fn ensure_abi(self: IpositionSafeLibraryDispatcher, model: Position) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IpositionSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IpositionSafeDispatcherImpl of IpositionSafeDispatcherTrait { + fn ensure_abi(self: IpositionSafeDispatcher, model: Position) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl RolesEntityDrop of core::traits::Drop::; +impl RolesEntitySerde of core::serde::Serde:: { + fn serialize(self: @RolesEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.role_ids, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(RolesEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + role_ids: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait RolesEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> RolesEntity; + + + fn get_role_ids(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Array; + + fn set_role_ids(self: @RolesEntity, world: dojo::world::IWorldDispatcher, value: Array); + +} +pub trait RolesStore { + fn entity_id_from_keys() -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> Roles; + + fn get(world: dojo::world::IWorldDispatcher, ) -> Roles; + + + fn get_role_ids(world: dojo::world::IWorldDispatcher, ) -> Array; + + fn set_role_ids(self: @Roles, world: dojo::world::IWorldDispatcher, value: Array); + +} +pub trait IrolesDispatcherTrait { + fn ensure_abi(self: T, model: Roles); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IrolesDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IrolesDispatcherImpl of IrolesDispatcherTrait { + fn ensure_abi(self: IrolesDispatcher, model: Roles) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IrolesLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IrolesLibraryDispatcherImpl of IrolesDispatcherTrait { + fn ensure_abi(self: IrolesLibraryDispatcher, model: Roles) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait IrolesSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: Roles) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IrolesSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IrolesSafeLibraryDispatcherImpl of IrolesSafeDispatcherTrait { + fn ensure_abi(self: IrolesSafeLibraryDispatcher, model: Roles) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IrolesSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IrolesSafeDispatcherImpl of IrolesSafeDispatcherTrait { + fn ensure_abi(self: IrolesSafeDispatcher, model: Roles) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl OnlyKeyModelEntityDrop of core::traits::Drop::; +impl OnlyKeyModelEntitySerde of core::serde::Serde:: { + fn serialize(self: @OnlyKeyModelEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(OnlyKeyModelEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait OnlyKeyModelEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> OnlyKeyModelEntity; + + +} +pub trait OnlyKeyModelStore { + fn entity_id_from_keys(id: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> OnlyKeyModel; + + fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> OnlyKeyModel; + + +} +pub trait Ionly_key_modelDispatcherTrait { + fn ensure_abi(self: T, model: OnlyKeyModel); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ionly_key_modelDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ionly_key_modelDispatcherImpl of Ionly_key_modelDispatcherTrait { + fn ensure_abi(self: Ionly_key_modelDispatcher, model: OnlyKeyModel) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ionly_key_modelLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ionly_key_modelLibraryDispatcherImpl of Ionly_key_modelDispatcherTrait { + fn ensure_abi(self: Ionly_key_modelLibraryDispatcher, model: OnlyKeyModel) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Ionly_key_modelSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: OnlyKeyModel) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ionly_key_modelSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Ionly_key_modelSafeLibraryDispatcherImpl of Ionly_key_modelSafeDispatcherTrait { + fn ensure_abi(self: Ionly_key_modelSafeLibraryDispatcher, model: OnlyKeyModel) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Ionly_key_modelSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Ionly_key_modelSafeDispatcherImpl of Ionly_key_modelSafeDispatcherTrait { + fn ensure_abi(self: Ionly_key_modelSafeDispatcher, model: OnlyKeyModel) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl U256KeyModelEntityDrop of core::traits::Drop::; +impl U256KeyModelEntitySerde of core::serde::Serde:: { + fn serialize(self: @U256KeyModelEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(U256KeyModelEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait U256KeyModelEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> U256KeyModelEntity; + + +} +pub trait U256KeyModelStore { + fn entity_id_from_keys(id: u256) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> U256KeyModel; + + fn get(world: dojo::world::IWorldDispatcher, id: u256) -> U256KeyModel; + + +} +pub trait Iu_256_key_modelDispatcherTrait { + fn ensure_abi(self: T, model: U256KeyModel); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Iu_256_key_modelDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Iu_256_key_modelDispatcherImpl of Iu_256_key_modelDispatcherTrait { + fn ensure_abi(self: Iu_256_key_modelDispatcher, model: U256KeyModel) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Iu_256_key_modelLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Iu_256_key_modelLibraryDispatcherImpl of Iu_256_key_modelDispatcherTrait { + fn ensure_abi(self: Iu_256_key_modelLibraryDispatcher, model: U256KeyModel) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Iu_256_key_modelSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: U256KeyModel) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Iu_256_key_modelSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Iu_256_key_modelSafeLibraryDispatcherImpl of Iu_256_key_modelSafeDispatcherTrait { + fn ensure_abi(self: Iu_256_key_modelSafeLibraryDispatcher, model: U256KeyModel) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Iu_256_key_modelSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Iu_256_key_modelSafeDispatcherImpl of Iu_256_key_modelSafeDispatcherTrait { + fn ensure_abi(self: Iu_256_key_modelSafeDispatcher, model: U256KeyModel) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl PlayerEntityDrop of core::traits::Drop::; +impl PlayerEntitySerde of core::serde::Serde:: { + fn serialize(self: @PlayerEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.name, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(PlayerEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + name: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait PlayerEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> PlayerEntity; + + + fn get_name(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> felt252; + + fn set_name(self: @PlayerEntity, world: dojo::world::IWorldDispatcher, value: felt252); + +} +pub trait PlayerStore { + fn entity_id_from_keys(game: felt252, player: ContractAddress) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> Player; + + fn get(world: dojo::world::IWorldDispatcher, game: felt252, player: ContractAddress) -> Player; + + + fn get_name(world: dojo::world::IWorldDispatcher, game: felt252, player: ContractAddress) -> felt252; + + fn set_name(self: @Player, world: dojo::world::IWorldDispatcher, value: felt252); + +} +pub trait IplayerDispatcherTrait { + fn ensure_abi(self: T, model: Player); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IplayerDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IplayerDispatcherImpl of IplayerDispatcherTrait { + fn ensure_abi(self: IplayerDispatcher, model: Player) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IplayerLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IplayerLibraryDispatcherImpl of IplayerDispatcherTrait { + fn ensure_abi(self: IplayerLibraryDispatcher, model: Player) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait IplayerSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: Player) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IplayerSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IplayerSafeLibraryDispatcherImpl of IplayerSafeDispatcherTrait { + fn ensure_abi(self: IplayerSafeLibraryDispatcher, model: Player) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct IplayerSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IplayerSafeDispatcherImpl of IplayerSafeDispatcherTrait { + fn ensure_abi(self: IplayerSafeDispatcher, model: Player) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ModelWithSimpleArrayEntityDrop of core::traits::Drop::; +impl ModelWithSimpleArrayEntitySerde of core::serde::Serde:: { + fn serialize(self: @ModelWithSimpleArrayEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.x, ref output); + core::serde::Serde::serialize(self.y, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ModelWithSimpleArrayEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + x: core::serde::Serde::deserialize(ref serialized)?, + y: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait ModelWithSimpleArrayEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithSimpleArrayEntity; + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16; + + fn set_x(self: @ModelWithSimpleArrayEntity, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Array; + + fn set_y(self: @ModelWithSimpleArrayEntity, world: dojo::world::IWorldDispatcher, value: Array); + +} +pub trait ModelWithSimpleArrayStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithSimpleArray; + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithSimpleArray; + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16; + + fn set_x(self: @ModelWithSimpleArray, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> Array; + + fn set_y(self: @ModelWithSimpleArray, world: dojo::world::IWorldDispatcher, value: Array); + +} +pub trait Imodel_with_simple_arrayDispatcherTrait { + fn ensure_abi(self: T, model: ModelWithSimpleArray); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_simple_arrayDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_simple_arrayDispatcherImpl of Imodel_with_simple_arrayDispatcherTrait { + fn ensure_abi(self: Imodel_with_simple_arrayDispatcher, model: ModelWithSimpleArray) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_simple_arrayLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_simple_arrayLibraryDispatcherImpl of Imodel_with_simple_arrayDispatcherTrait { + fn ensure_abi(self: Imodel_with_simple_arrayLibraryDispatcher, model: ModelWithSimpleArray) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Imodel_with_simple_arraySafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: ModelWithSimpleArray) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_simple_arraySafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_simple_arraySafeLibraryDispatcherImpl of Imodel_with_simple_arraySafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_simple_arraySafeLibraryDispatcher, model: ModelWithSimpleArray) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_simple_arraySafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_simple_arraySafeDispatcherImpl of Imodel_with_simple_arraySafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_simple_arraySafeDispatcher, model: ModelWithSimpleArray) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ModelWithByteArrayEntityDrop of core::traits::Drop::; +impl ModelWithByteArrayEntitySerde of core::serde::Serde:: { + fn serialize(self: @ModelWithByteArrayEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.x, ref output); + core::serde::Serde::serialize(self.y, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ModelWithByteArrayEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + x: core::serde::Serde::deserialize(ref serialized)?, + y: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait ModelWithByteArrayEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithByteArrayEntity; + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16; + + fn set_x(self: @ModelWithByteArrayEntity, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ByteArray; + + fn set_y(self: @ModelWithByteArrayEntity, world: dojo::world::IWorldDispatcher, value: ByteArray); + +} +pub trait ModelWithByteArrayStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithByteArray; + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithByteArray; + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16; + + fn set_x(self: @ModelWithByteArray, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ByteArray; + + fn set_y(self: @ModelWithByteArray, world: dojo::world::IWorldDispatcher, value: ByteArray); + +} +pub trait Imodel_with_byte_arrayDispatcherTrait { + fn ensure_abi(self: T, model: ModelWithByteArray); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_byte_arrayDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_byte_arrayDispatcherImpl of Imodel_with_byte_arrayDispatcherTrait { + fn ensure_abi(self: Imodel_with_byte_arrayDispatcher, model: ModelWithByteArray) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_byte_arrayLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_byte_arrayLibraryDispatcherImpl of Imodel_with_byte_arrayDispatcherTrait { + fn ensure_abi(self: Imodel_with_byte_arrayLibraryDispatcher, model: ModelWithByteArray) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Imodel_with_byte_arraySafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: ModelWithByteArray) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_byte_arraySafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_byte_arraySafeLibraryDispatcherImpl of Imodel_with_byte_arraySafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_byte_arraySafeLibraryDispatcher, model: ModelWithByteArray) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_byte_arraySafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_byte_arraySafeDispatcherImpl of Imodel_with_byte_arraySafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_byte_arraySafeDispatcher, model: ModelWithByteArray) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ModelWithComplexArrayEntityDrop of core::traits::Drop::; +impl ModelWithComplexArrayEntitySerde of core::serde::Serde:: { + fn serialize(self: @ModelWithComplexArrayEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.x, ref output); + core::serde::Serde::serialize(self.y, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ModelWithComplexArrayEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + x: core::serde::Serde::deserialize(ref serialized)?, + y: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait ModelWithComplexArrayEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithComplexArrayEntity; + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16; + + fn set_x(self: @ModelWithComplexArrayEntity, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Array; + + fn set_y(self: @ModelWithComplexArrayEntity, world: dojo::world::IWorldDispatcher, value: Array); + +} +pub trait ModelWithComplexArrayStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithComplexArray; + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithComplexArray; + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16; + + fn set_x(self: @ModelWithComplexArray, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> Array; + + fn set_y(self: @ModelWithComplexArray, world: dojo::world::IWorldDispatcher, value: Array); + +} +pub trait Imodel_with_complex_arrayDispatcherTrait { + fn ensure_abi(self: T, model: ModelWithComplexArray); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_complex_arrayDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_complex_arrayDispatcherImpl of Imodel_with_complex_arrayDispatcherTrait { + fn ensure_abi(self: Imodel_with_complex_arrayDispatcher, model: ModelWithComplexArray) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_complex_arrayLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_complex_arrayLibraryDispatcherImpl of Imodel_with_complex_arrayDispatcherTrait { + fn ensure_abi(self: Imodel_with_complex_arrayLibraryDispatcher, model: ModelWithComplexArray) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Imodel_with_complex_arraySafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: ModelWithComplexArray) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_complex_arraySafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_complex_arraySafeLibraryDispatcherImpl of Imodel_with_complex_arraySafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_complex_arraySafeLibraryDispatcher, model: ModelWithComplexArray) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_complex_arraySafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_complex_arraySafeDispatcherImpl of Imodel_with_complex_arraySafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_complex_arraySafeDispatcher, model: ModelWithComplexArray) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ModelWithTupleEntityDrop of core::traits::Drop::; +impl ModelWithTupleEntitySerde of core::serde::Serde:: { + fn serialize(self: @ModelWithTupleEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.x, ref output); + core::serde::Serde::serialize(self.y, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ModelWithTupleEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + x: core::serde::Serde::deserialize(ref serialized)?, + y: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait ModelWithTupleEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithTupleEntity; + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16; + + fn set_x(self: @ModelWithTupleEntity, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> (u8, u16, u32); + + fn set_y(self: @ModelWithTupleEntity, world: dojo::world::IWorldDispatcher, value: (u8, u16, u32)); + +} +pub trait ModelWithTupleStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithTuple; + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithTuple; + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16; + + fn set_x(self: @ModelWithTuple, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> (u8, u16, u32); + + fn set_y(self: @ModelWithTuple, world: dojo::world::IWorldDispatcher, value: (u8, u16, u32)); + +} +pub trait Imodel_with_tupleDispatcherTrait { + fn ensure_abi(self: T, model: ModelWithTuple); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_tupleDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_tupleDispatcherImpl of Imodel_with_tupleDispatcherTrait { + fn ensure_abi(self: Imodel_with_tupleDispatcher, model: ModelWithTuple) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_tupleLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_tupleLibraryDispatcherImpl of Imodel_with_tupleDispatcherTrait { + fn ensure_abi(self: Imodel_with_tupleLibraryDispatcher, model: ModelWithTuple) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Imodel_with_tupleSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: ModelWithTuple) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_tupleSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_tupleSafeLibraryDispatcherImpl of Imodel_with_tupleSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_tupleSafeLibraryDispatcher, model: ModelWithTuple) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_tupleSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_tupleSafeDispatcherImpl of Imodel_with_tupleSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_tupleSafeDispatcher, model: ModelWithTuple) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ModelWithTupleNoPrimitivesEntityDrop of core::traits::Drop::; +impl ModelWithTupleNoPrimitivesEntitySerde of core::serde::Serde:: { + fn serialize(self: @ModelWithTupleNoPrimitivesEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.x, ref output); + core::serde::Serde::serialize(self.y, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ModelWithTupleNoPrimitivesEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + x: core::serde::Serde::deserialize(ref serialized)?, + y: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait ModelWithTupleNoPrimitivesEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithTupleNoPrimitivesEntity; + + + fn get_x(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> u16; + + fn set_x(self: @ModelWithTupleNoPrimitivesEntity, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> (u8, Vec3, u32); + + fn set_y(self: @ModelWithTupleNoPrimitivesEntity, world: dojo::world::IWorldDispatcher, value: (u8, Vec3, u32)); + +} +pub trait ModelWithTupleNoPrimitivesStore { + fn entity_id_from_keys(player: ContractAddress) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> ModelWithTupleNoPrimitives; + + fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithTupleNoPrimitives; + + + fn get_x(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> u16; + + fn set_x(self: @ModelWithTupleNoPrimitives, world: dojo::world::IWorldDispatcher, value: u16); + + fn get_y(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> (u8, Vec3, u32); + + fn set_y(self: @ModelWithTupleNoPrimitives, world: dojo::world::IWorldDispatcher, value: (u8, Vec3, u32)); + +} +pub trait Imodel_with_tuple_no_primitivesDispatcherTrait { + fn ensure_abi(self: T, model: ModelWithTupleNoPrimitives); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_tuple_no_primitivesDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_tuple_no_primitivesDispatcherImpl of Imodel_with_tuple_no_primitivesDispatcherTrait { + fn ensure_abi(self: Imodel_with_tuple_no_primitivesDispatcher, model: ModelWithTupleNoPrimitives) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_tuple_no_primitivesLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_tuple_no_primitivesLibraryDispatcherImpl of Imodel_with_tuple_no_primitivesDispatcherTrait { + fn ensure_abi(self: Imodel_with_tuple_no_primitivesLibraryDispatcher, model: ModelWithTupleNoPrimitives) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait Imodel_with_tuple_no_primitivesSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: ModelWithTupleNoPrimitives) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_tuple_no_primitivesSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl Imodel_with_tuple_no_primitivesSafeLibraryDispatcherImpl of Imodel_with_tuple_no_primitivesSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_tuple_no_primitivesSafeLibraryDispatcher, model: ModelWithTupleNoPrimitives) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct Imodel_with_tuple_no_primitivesSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl Imodel_with_tuple_no_primitivesSafeDispatcherImpl of Imodel_with_tuple_no_primitivesSafeDispatcherTrait { + fn ensure_abi(self: Imodel_with_tuple_no_primitivesSafeDispatcher, model: ModelWithTupleNoPrimitives) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl Ibad_model_multiple_versionsDispatcherCopy of core::traits::Copy::; +impl Ibad_model_multiple_versionsDispatcherDrop of core::traits::Drop::; +impl Ibad_model_multiple_versionsDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_multiple_versionsDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_multiple_versionsDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_multiple_versionsDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_multiple_versionsDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_multiple_versionsDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_multiple_versionsDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_multiple_versionsDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_multiple_versionsDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_multiple_versionsDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_multiple_versionsDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_multiple_versionsDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_multiple_versionsDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_multiple_versionsDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_multiple_versionsDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_multiple_versionsDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_multiple_versionsDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_multiple_versionsDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_multiple_versionsLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_multiple_versionsLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_multiple_versionsLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_multiple_versionsLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_multiple_versionsLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_multiple_versionsLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_multiple_versionsLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_multiple_versionsLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_multiple_versionsLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_multiple_versionsLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_multiple_versionsLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_multiple_versionsLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_multiple_versionsLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_multiple_versionsLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_multiple_versionsLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_multiple_versionsLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_multiple_versionsLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_multiple_versionsLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_multiple_versionsLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_multiple_versionsLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_multiple_versionsSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_multiple_versionsSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_multiple_versionsSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_multiple_versionsSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_multiple_versionsSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_multiple_versionsSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_multiple_versionsSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_multiple_versionsSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_multiple_versionsSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_multiple_versionsSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_multiple_versionsSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_multiple_versionsSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_multiple_versionsSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_multiple_versionsSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_multiple_versionsSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_multiple_versionsSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_multiple_versionsSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_multiple_versionsSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_multiple_versionsSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_multiple_versionsSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_multiple_versionsSafeDispatcherCopy of core::traits::Copy::; +impl Ibad_model_multiple_versionsSafeDispatcherDrop of core::traits::Drop::; +impl Ibad_model_multiple_versionsSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_multiple_versionsSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_multiple_versionsSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_multiple_versionsSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_multiple_versionsSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_multiple_versionsSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_multiple_versionsSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_multiple_versionsSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_multiple_versionsSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_multiple_versionsSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_multiple_versionsSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_multiple_versionsSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_multiple_versionsSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_multiple_versionsSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_multiple_versionsSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_multiple_versionsSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_multiple_versionsSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_multiple_versionsSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_bad_version_typeDispatcherCopy of core::traits::Copy::; +impl Ibad_model_bad_version_typeDispatcherDrop of core::traits::Drop::; +impl Ibad_model_bad_version_typeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_bad_version_typeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_bad_version_typeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_bad_version_typeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_bad_version_typeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_bad_version_typeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_bad_version_typeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_bad_version_typeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_bad_version_typeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_bad_version_typeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_bad_version_typeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_bad_version_typeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_bad_version_typeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_bad_version_typeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_bad_version_typeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_bad_version_typeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_bad_version_typeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_bad_version_typeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_bad_version_typeLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_bad_version_typeLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_bad_version_typeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_bad_version_typeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_bad_version_typeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_bad_version_typeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_bad_version_typeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_bad_version_typeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_bad_version_typeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_bad_version_typeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_bad_version_typeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_bad_version_typeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_bad_version_typeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_bad_version_typeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_bad_version_typeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_bad_version_typeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_bad_version_typeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_bad_version_typeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_bad_version_typeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_bad_version_typeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_bad_version_typeSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_bad_version_typeSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_bad_version_typeSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_bad_version_typeSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_bad_version_typeSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_bad_version_typeSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_bad_version_typeSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_bad_version_typeSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_bad_version_typeSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_bad_version_typeSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_bad_version_typeSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_bad_version_typeSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_bad_version_typeSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_bad_version_typeSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_bad_version_typeSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_bad_version_typeSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_bad_version_typeSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_bad_version_typeSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_bad_version_typeSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_bad_version_typeSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_bad_version_typeSafeDispatcherCopy of core::traits::Copy::; +impl Ibad_model_bad_version_typeSafeDispatcherDrop of core::traits::Drop::; +impl Ibad_model_bad_version_typeSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_bad_version_typeSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_bad_version_typeSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_bad_version_typeSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_bad_version_typeSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_bad_version_typeSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_bad_version_typeSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_bad_version_typeSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_bad_version_typeSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_bad_version_typeSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_bad_version_typeSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_bad_version_typeSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_bad_version_typeSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_bad_version_typeSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_bad_version_typeSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_bad_version_typeSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_bad_version_typeSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_bad_version_typeSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_no_version_valueDispatcherCopy of core::traits::Copy::; +impl Ibad_model_no_version_valueDispatcherDrop of core::traits::Drop::; +impl Ibad_model_no_version_valueDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_no_version_valueDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_no_version_valueDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_no_version_valueDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_no_version_valueDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_no_version_valueDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_no_version_valueDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_no_version_valueDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_no_version_valueDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_no_version_valueDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_no_version_valueDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_no_version_valueDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_no_version_valueDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_no_version_valueDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_no_version_valueDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_no_version_valueDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_no_version_valueDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_no_version_valueDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_no_version_valueLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_no_version_valueLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_no_version_valueLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_no_version_valueLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_no_version_valueLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_no_version_valueLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_no_version_valueLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_no_version_valueLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_no_version_valueLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_no_version_valueLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_no_version_valueLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_no_version_valueLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_no_version_valueLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_no_version_valueLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_no_version_valueLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_no_version_valueLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_no_version_valueLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_no_version_valueLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_no_version_valueLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_no_version_valueLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_no_version_valueSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_no_version_valueSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_no_version_valueSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_no_version_valueSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_no_version_valueSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_no_version_valueSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_no_version_valueSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_no_version_valueSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_no_version_valueSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_no_version_valueSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_no_version_valueSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_no_version_valueSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_no_version_valueSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_no_version_valueSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_no_version_valueSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_no_version_valueSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_no_version_valueSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_no_version_valueSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_no_version_valueSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_no_version_valueSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_no_version_valueSafeDispatcherCopy of core::traits::Copy::; +impl Ibad_model_no_version_valueSafeDispatcherDrop of core::traits::Drop::; +impl Ibad_model_no_version_valueSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_no_version_valueSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_no_version_valueSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_no_version_valueSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_no_version_valueSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_no_version_valueSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_no_version_valueSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_no_version_valueSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_no_version_valueSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_no_version_valueSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_no_version_valueSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_no_version_valueSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_no_version_valueSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_no_version_valueSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_no_version_valueSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_no_version_valueSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_no_version_valueSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_no_version_valueSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_unexpected_arg_with_valueDispatcherCopy of core::traits::Copy::; +impl Ibad_model_unexpected_arg_with_valueDispatcherDrop of core::traits::Drop::; +impl Ibad_model_unexpected_arg_with_valueDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_unexpected_arg_with_valueDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_unexpected_arg_with_valueDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_unexpected_arg_with_valueDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_arg_with_valueDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_unexpected_arg_with_valueDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_arg_with_valueDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_unexpected_arg_with_valueDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_unexpected_arg_with_valueDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_unexpected_arg_with_valueDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_unexpected_arg_with_valueDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_unexpected_arg_with_valueDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_unexpected_arg_with_valueDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_unexpected_arg_with_valueDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_unexpected_arg_with_valueDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_unexpected_arg_with_valueDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_unexpected_arg_with_valueDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_unexpected_arg_with_valueDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_unexpected_arg_with_valueLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_unexpected_arg_with_valueLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_unexpected_arg_with_valueLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_unexpected_arg_with_valueLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_unexpected_arg_with_valueLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_unexpected_arg_with_valueLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_arg_with_valueLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_unexpected_arg_with_valueLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_arg_with_valueLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_unexpected_arg_with_valueLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_unexpected_arg_with_valueLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_unexpected_arg_with_valueLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_unexpected_arg_with_valueLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_unexpected_arg_with_valueLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_unexpected_arg_with_valueLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_unexpected_arg_with_valueLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_unexpected_arg_with_valueLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_unexpected_arg_with_valueLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_unexpected_arg_with_valueLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_unexpected_arg_with_valueLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_unexpected_arg_with_valueSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_unexpected_arg_with_valueSafeDispatcherCopy of core::traits::Copy::; +impl Ibad_model_unexpected_arg_with_valueSafeDispatcherDrop of core::traits::Drop::; +impl Ibad_model_unexpected_arg_with_valueSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_unexpected_arg_with_valueSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_unexpected_arg_with_valueSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_unexpected_arg_with_valueSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_arg_with_valueSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_unexpected_arg_with_valueSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_arg_with_valueSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_unexpected_arg_with_valueSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_unexpected_arg_with_valueSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_unexpected_arg_with_valueSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_unexpected_arg_with_valueSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_unexpected_arg_with_valueSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_unexpected_arg_with_valueSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_unexpected_arg_with_valueSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_unexpected_arg_with_valueSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_unexpected_arg_with_valueSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_unexpected_arg_with_valueSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_unexpected_arg_with_valueSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_unexpected_argDispatcherCopy of core::traits::Copy::; +impl Ibad_model_unexpected_argDispatcherDrop of core::traits::Drop::; +impl Ibad_model_unexpected_argDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_unexpected_argDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_unexpected_argDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_unexpected_argDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_argDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_unexpected_argDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_argDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_unexpected_argDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_unexpected_argDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_unexpected_argDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_unexpected_argDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_unexpected_argDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_unexpected_argDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_unexpected_argDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_unexpected_argDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_unexpected_argDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_unexpected_argDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_unexpected_argDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_unexpected_argLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_unexpected_argLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_unexpected_argLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_unexpected_argLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_unexpected_argLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_unexpected_argLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_argLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_unexpected_argLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_argLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_unexpected_argLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_unexpected_argLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_unexpected_argLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_unexpected_argLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_unexpected_argLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_unexpected_argLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_unexpected_argLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_unexpected_argLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_unexpected_argLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_unexpected_argLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_unexpected_argLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_unexpected_argSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_unexpected_argSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_unexpected_argSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_unexpected_argSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_unexpected_argSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_unexpected_argSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_argSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_unexpected_argSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_argSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_unexpected_argSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_unexpected_argSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_unexpected_argSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_unexpected_argSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_unexpected_argSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_unexpected_argSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_unexpected_argSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_unexpected_argSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_unexpected_argSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_unexpected_argSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_unexpected_argSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_unexpected_argSafeDispatcherCopy of core::traits::Copy::; +impl Ibad_model_unexpected_argSafeDispatcherDrop of core::traits::Drop::; +impl Ibad_model_unexpected_argSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_unexpected_argSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_unexpected_argSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_unexpected_argSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_argSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_unexpected_argSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_unexpected_argSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_unexpected_argSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_unexpected_argSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_unexpected_argSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_unexpected_argSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_unexpected_argSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_unexpected_argSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_unexpected_argSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_unexpected_argSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_unexpected_argSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_unexpected_argSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_unexpected_argSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_not_supported_versionDispatcherCopy of core::traits::Copy::; +impl Ibad_model_not_supported_versionDispatcherDrop of core::traits::Drop::; +impl Ibad_model_not_supported_versionDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_not_supported_versionDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_not_supported_versionDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_not_supported_versionDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_not_supported_versionDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_not_supported_versionDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_not_supported_versionDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_not_supported_versionDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_not_supported_versionDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_not_supported_versionDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_not_supported_versionDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_not_supported_versionDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_not_supported_versionDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_not_supported_versionDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_not_supported_versionDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_not_supported_versionDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_not_supported_versionDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_not_supported_versionDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_not_supported_versionLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_not_supported_versionLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_not_supported_versionLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_not_supported_versionLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_not_supported_versionLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_not_supported_versionLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_not_supported_versionLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_not_supported_versionLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_not_supported_versionLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_not_supported_versionLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_not_supported_versionLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_not_supported_versionLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_not_supported_versionLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_not_supported_versionLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_not_supported_versionLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_not_supported_versionLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_not_supported_versionLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_not_supported_versionLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_not_supported_versionLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_not_supported_versionLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_not_supported_versionSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Ibad_model_not_supported_versionSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Ibad_model_not_supported_versionSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_not_supported_versionSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_not_supported_versionSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_not_supported_versionSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_not_supported_versionSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_not_supported_versionSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_not_supported_versionSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_not_supported_versionSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_not_supported_versionSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ibad_model_not_supported_versionSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_not_supported_versionSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_not_supported_versionSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_not_supported_versionSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_not_supported_versionSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_not_supported_versionSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_not_supported_versionSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_not_supported_versionSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_not_supported_versionSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ibad_model_not_supported_versionSafeDispatcherCopy of core::traits::Copy::; +impl Ibad_model_not_supported_versionSafeDispatcherDrop of core::traits::Drop::; +impl Ibad_model_not_supported_versionSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ibad_model_not_supported_versionSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ibad_model_not_supported_versionSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIbad_model_not_supported_versionSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ibad_model_not_supported_versionSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ibad_model_not_supported_versionSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ibad_model_not_supported_versionSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ibad_model_not_supported_versionSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ibad_model_not_supported_versionSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ibad_model_not_supported_versionSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ibad_model_not_supported_versionSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ibad_model_not_supported_versionSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ibad_model_not_supported_versionSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIbad_model_not_supported_versionSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIbad_model_not_supported_versionSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIbad_model_not_supported_versionSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIbad_model_not_supported_versionSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIbad_model_not_supported_versionSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodelv_0DispatcherCopy of core::traits::Copy::; +impl Imodelv_0DispatcherDrop of core::traits::Drop::; +impl Imodelv_0DispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodelv_0Dispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodelv_0Dispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodelv_0Dispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodelv_0Dispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodelv_0Dispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodelv_0Dispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodelv_0Dispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodelv_0DispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodelv_0DispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodelv_0DispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodelv_0DispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodelv_0DispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodelv_0DispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodelv_0DispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodelv_0DispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodelv_0DispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodelv_0DispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodelv_0LibraryDispatcherCopy of core::traits::Copy::; +impl Imodelv_0LibraryDispatcherDrop of core::traits::Drop::; +impl Imodelv_0LibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodelv_0LibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodelv_0LibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodelv_0LibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodelv_0LibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodelv_0LibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodelv_0LibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodelv_0LibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodelv_0LibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodelv_0LibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodelv_0LibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodelv_0LibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodelv_0LibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodelv_0LibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodelv_0LibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodelv_0LibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodelv_0LibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodelv_0LibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodelv_0SafeLibraryDispatcherCopy of core::traits::Copy::; +impl Imodelv_0SafeLibraryDispatcherDrop of core::traits::Drop::; +impl Imodelv_0SafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodelv_0SafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodelv_0SafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodelv_0SafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodelv_0SafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodelv_0SafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodelv_0SafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodelv_0SafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodelv_0SafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodelv_0SafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodelv_0SafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodelv_0SafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodelv_0SafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodelv_0SafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodelv_0SafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodelv_0SafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodelv_0SafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodelv_0SafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodelv_0SafeDispatcherCopy of core::traits::Copy::; +impl Imodelv_0SafeDispatcherDrop of core::traits::Drop::; +impl Imodelv_0SafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodelv_0SafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodelv_0SafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodelv_0SafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodelv_0SafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodelv_0SafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodelv_0SafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodelv_0SafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodelv_0SafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodelv_0SafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodelv_0SafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodelv_0SafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodelv_0SafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodelv_0SafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodelv_0SafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodelv_0SafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodelv_0SafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodelv_0SafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_bad_namespace_formatDispatcherCopy of core::traits::Copy::; +impl Imodel_with_bad_namespace_formatDispatcherDrop of core::traits::Drop::; +impl Imodel_with_bad_namespace_formatDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_bad_namespace_formatDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_bad_namespace_formatDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_bad_namespace_formatDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_bad_namespace_formatDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_bad_namespace_formatDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_bad_namespace_formatDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_bad_namespace_formatDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_bad_namespace_formatDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_bad_namespace_formatDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_bad_namespace_formatDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_bad_namespace_formatDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_bad_namespace_formatDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_bad_namespace_formatDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_bad_namespace_formatDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_bad_namespace_formatDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_bad_namespace_formatDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_bad_namespace_formatDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_bad_namespace_formatLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_bad_namespace_formatLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_bad_namespace_formatLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_bad_namespace_formatLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_bad_namespace_formatLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_bad_namespace_formatLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_bad_namespace_formatLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_bad_namespace_formatLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_bad_namespace_formatLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_bad_namespace_formatLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_bad_namespace_formatLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_bad_namespace_formatLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_bad_namespace_formatLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_bad_namespace_formatLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_bad_namespace_formatLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_bad_namespace_formatLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_bad_namespace_formatLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_bad_namespace_formatLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_bad_namespace_formatLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_bad_namespace_formatLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_bad_namespace_formatSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_bad_namespace_formatSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_bad_namespace_formatSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_bad_namespace_formatSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_bad_namespace_formatSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_bad_namespace_formatSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_bad_namespace_formatSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_bad_namespace_formatSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_bad_namespace_formatSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_bad_namespace_formatSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_bad_namespace_formatSafeDispatcherCopy of core::traits::Copy::; +impl Imodel_with_bad_namespace_formatSafeDispatcherDrop of core::traits::Drop::; +impl Imodel_with_bad_namespace_formatSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_bad_namespace_formatSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_bad_namespace_formatSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_bad_namespace_formatSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_bad_namespace_formatSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_bad_namespace_formatSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_bad_namespace_formatSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_bad_namespace_formatSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_bad_namespace_formatSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_bad_namespace_formatSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_bad_namespace_formatSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_bad_namespace_formatSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_bad_namespace_formatSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_bad_namespace_formatSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_bad_namespace_formatSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_bad_namespace_formatSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_bad_namespace_formatSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_bad_namespace_formatSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_short_string_namespaceDispatcherCopy of core::traits::Copy::; +impl Imodel_with_short_string_namespaceDispatcherDrop of core::traits::Drop::; +impl Imodel_with_short_string_namespaceDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_short_string_namespaceDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_short_string_namespaceDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_short_string_namespaceDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_short_string_namespaceDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_short_string_namespaceDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_short_string_namespaceDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_short_string_namespaceDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_short_string_namespaceDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_short_string_namespaceDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_short_string_namespaceDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_short_string_namespaceDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_short_string_namespaceDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_short_string_namespaceDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_short_string_namespaceDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_short_string_namespaceDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_short_string_namespaceDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_short_string_namespaceDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_short_string_namespaceLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_short_string_namespaceLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_short_string_namespaceLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_short_string_namespaceLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_short_string_namespaceLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_short_string_namespaceLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_short_string_namespaceLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_short_string_namespaceLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_short_string_namespaceLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_short_string_namespaceLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_short_string_namespaceLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_short_string_namespaceLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_short_string_namespaceLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_short_string_namespaceLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_short_string_namespaceLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_short_string_namespaceLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_short_string_namespaceLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_short_string_namespaceLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_short_string_namespaceLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_short_string_namespaceLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_short_string_namespaceSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_short_string_namespaceSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_short_string_namespaceSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_short_string_namespaceSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_short_string_namespaceSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_short_string_namespaceSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_short_string_namespaceSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_short_string_namespaceSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_short_string_namespaceSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_short_string_namespaceSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_short_string_namespaceSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_short_string_namespaceSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_short_string_namespaceSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_short_string_namespaceSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_short_string_namespaceSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_short_string_namespaceSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_short_string_namespaceSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_short_string_namespaceSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_short_string_namespaceSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_short_string_namespaceSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_short_string_namespaceSafeDispatcherCopy of core::traits::Copy::; +impl Imodel_with_short_string_namespaceSafeDispatcherDrop of core::traits::Drop::; +impl Imodel_with_short_string_namespaceSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_short_string_namespaceSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_short_string_namespaceSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_short_string_namespaceSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_short_string_namespaceSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_short_string_namespaceSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_short_string_namespaceSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_short_string_namespaceSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_short_string_namespaceSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_short_string_namespaceSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_short_string_namespaceSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_short_string_namespaceSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_short_string_namespaceSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_short_string_namespaceSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_short_string_namespaceSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_short_string_namespaceSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_short_string_namespaceSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_short_string_namespaceSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_string_namespaceDispatcherCopy of core::traits::Copy::; +impl Imodel_with_string_namespaceDispatcherDrop of core::traits::Drop::; +impl Imodel_with_string_namespaceDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_string_namespaceDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_string_namespaceDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_string_namespaceDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_string_namespaceDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_string_namespaceDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_string_namespaceDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_string_namespaceDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_string_namespaceDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_string_namespaceDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_string_namespaceDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_string_namespaceDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_string_namespaceDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_string_namespaceDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_string_namespaceDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_string_namespaceDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_string_namespaceDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_string_namespaceDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_string_namespaceLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_string_namespaceLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_string_namespaceLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_string_namespaceLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_string_namespaceLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_string_namespaceLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_string_namespaceLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_string_namespaceLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_string_namespaceLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_string_namespaceLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_string_namespaceLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_string_namespaceLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_string_namespaceLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_string_namespaceLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_string_namespaceLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_string_namespaceLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_string_namespaceLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_string_namespaceLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_string_namespaceLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_string_namespaceLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_string_namespaceSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_string_namespaceSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_string_namespaceSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_string_namespaceSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_string_namespaceSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_string_namespaceSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_string_namespaceSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_string_namespaceSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_string_namespaceSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_string_namespaceSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_string_namespaceSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_string_namespaceSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_string_namespaceSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_string_namespaceSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_string_namespaceSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_string_namespaceSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_string_namespaceSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_string_namespaceSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_string_namespaceSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_string_namespaceSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_string_namespaceSafeDispatcherCopy of core::traits::Copy::; +impl Imodel_with_string_namespaceSafeDispatcherDrop of core::traits::Drop::; +impl Imodel_with_string_namespaceSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_string_namespaceSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_string_namespaceSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_string_namespaceSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_string_namespaceSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_string_namespaceSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_string_namespaceSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_string_namespaceSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_string_namespaceSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_string_namespaceSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_string_namespaceSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_string_namespaceSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_string_namespaceSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_string_namespaceSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_string_namespaceSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_string_namespaceSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_string_namespaceSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_string_namespaceSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IpositionDispatcherCopy of core::traits::Copy::; +impl IpositionDispatcherDrop of core::traits::Drop::; +impl IpositionDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IpositionDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IpositionDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIpositionDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IpositionDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IpositionDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IpositionDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IpositionDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IpositionDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IpositionDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IpositionDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IpositionDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IpositionDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIpositionDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIpositionDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIpositionDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIpositionDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIpositionDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IpositionLibraryDispatcherCopy of core::traits::Copy::; +impl IpositionLibraryDispatcherDrop of core::traits::Drop::; +impl IpositionLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IpositionLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IpositionLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIpositionLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IpositionLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IpositionLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IpositionLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IpositionLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IpositionLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IpositionLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IpositionLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IpositionLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IpositionLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIpositionLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIpositionLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIpositionLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIpositionLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIpositionLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IpositionSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IpositionSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IpositionSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IpositionSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IpositionSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIpositionSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IpositionSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IpositionSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IpositionSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IpositionSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IpositionSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IpositionSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IpositionSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IpositionSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IpositionSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIpositionSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIpositionSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIpositionSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIpositionSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIpositionSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IpositionSafeDispatcherCopy of core::traits::Copy::; +impl IpositionSafeDispatcherDrop of core::traits::Drop::; +impl IpositionSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IpositionSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IpositionSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIpositionSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IpositionSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IpositionSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IpositionSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IpositionSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IpositionSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IpositionSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IpositionSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IpositionSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IpositionSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIpositionSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIpositionSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIpositionSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIpositionSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIpositionSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IrolesDispatcherCopy of core::traits::Copy::; +impl IrolesDispatcherDrop of core::traits::Drop::; +impl IrolesDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IrolesDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IrolesDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIrolesDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IrolesDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IrolesDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IrolesDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IrolesDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IrolesDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IrolesDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IrolesDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IrolesDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IrolesDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIrolesDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIrolesDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIrolesDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIrolesDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIrolesDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IrolesLibraryDispatcherCopy of core::traits::Copy::; +impl IrolesLibraryDispatcherDrop of core::traits::Drop::; +impl IrolesLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IrolesLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IrolesLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIrolesLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IrolesLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IrolesLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IrolesLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IrolesLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IrolesLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IrolesLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IrolesLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IrolesLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IrolesLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIrolesLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIrolesLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIrolesLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIrolesLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIrolesLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IrolesSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IrolesSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IrolesSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IrolesSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IrolesSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIrolesSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IrolesSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IrolesSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IrolesSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IrolesSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IrolesSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IrolesSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IrolesSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IrolesSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IrolesSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIrolesSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIrolesSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIrolesSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIrolesSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIrolesSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IrolesSafeDispatcherCopy of core::traits::Copy::; +impl IrolesSafeDispatcherDrop of core::traits::Drop::; +impl IrolesSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IrolesSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IrolesSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIrolesSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IrolesSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IrolesSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IrolesSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IrolesSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IrolesSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IrolesSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IrolesSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IrolesSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IrolesSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIrolesSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIrolesSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIrolesSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIrolesSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIrolesSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ionly_key_modelDispatcherCopy of core::traits::Copy::; +impl Ionly_key_modelDispatcherDrop of core::traits::Drop::; +impl Ionly_key_modelDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ionly_key_modelDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ionly_key_modelDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIonly_key_modelDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ionly_key_modelDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ionly_key_modelDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ionly_key_modelDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ionly_key_modelDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ionly_key_modelDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ionly_key_modelDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ionly_key_modelDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ionly_key_modelDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ionly_key_modelDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIonly_key_modelDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIonly_key_modelDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIonly_key_modelDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIonly_key_modelDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIonly_key_modelDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ionly_key_modelLibraryDispatcherCopy of core::traits::Copy::; +impl Ionly_key_modelLibraryDispatcherDrop of core::traits::Drop::; +impl Ionly_key_modelLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ionly_key_modelLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ionly_key_modelLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIonly_key_modelLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ionly_key_modelLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ionly_key_modelLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ionly_key_modelLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ionly_key_modelLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ionly_key_modelLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ionly_key_modelLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ionly_key_modelLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ionly_key_modelLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ionly_key_modelLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIonly_key_modelLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIonly_key_modelLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIonly_key_modelLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIonly_key_modelLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIonly_key_modelLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ionly_key_modelSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Ionly_key_modelSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Ionly_key_modelSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ionly_key_modelSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ionly_key_modelSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIonly_key_modelSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ionly_key_modelSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ionly_key_modelSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ionly_key_modelSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ionly_key_modelSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ionly_key_modelSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Ionly_key_modelSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ionly_key_modelSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ionly_key_modelSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ionly_key_modelSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIonly_key_modelSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIonly_key_modelSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIonly_key_modelSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIonly_key_modelSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIonly_key_modelSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Ionly_key_modelSafeDispatcherCopy of core::traits::Copy::; +impl Ionly_key_modelSafeDispatcherDrop of core::traits::Drop::; +impl Ionly_key_modelSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Ionly_key_modelSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Ionly_key_modelSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIonly_key_modelSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Ionly_key_modelSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Ionly_key_modelSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Ionly_key_modelSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Ionly_key_modelSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Ionly_key_modelSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Ionly_key_modelSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Ionly_key_modelSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Ionly_key_modelSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Ionly_key_modelSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIonly_key_modelSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIonly_key_modelSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIonly_key_modelSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIonly_key_modelSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIonly_key_modelSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Iu_256_key_modelDispatcherCopy of core::traits::Copy::; +impl Iu_256_key_modelDispatcherDrop of core::traits::Drop::; +impl Iu_256_key_modelDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Iu_256_key_modelDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Iu_256_key_modelDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIu_256_key_modelDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Iu_256_key_modelDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Iu_256_key_modelDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Iu_256_key_modelDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Iu_256_key_modelDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Iu_256_key_modelDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Iu_256_key_modelDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Iu_256_key_modelDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Iu_256_key_modelDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Iu_256_key_modelDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIu_256_key_modelDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIu_256_key_modelDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIu_256_key_modelDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIu_256_key_modelDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIu_256_key_modelDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Iu_256_key_modelLibraryDispatcherCopy of core::traits::Copy::; +impl Iu_256_key_modelLibraryDispatcherDrop of core::traits::Drop::; +impl Iu_256_key_modelLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Iu_256_key_modelLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Iu_256_key_modelLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIu_256_key_modelLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Iu_256_key_modelLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Iu_256_key_modelLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Iu_256_key_modelLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Iu_256_key_modelLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Iu_256_key_modelLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Iu_256_key_modelLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Iu_256_key_modelLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Iu_256_key_modelLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Iu_256_key_modelLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIu_256_key_modelLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIu_256_key_modelLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIu_256_key_modelLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIu_256_key_modelLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIu_256_key_modelLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Iu_256_key_modelSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Iu_256_key_modelSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Iu_256_key_modelSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Iu_256_key_modelSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Iu_256_key_modelSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIu_256_key_modelSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Iu_256_key_modelSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Iu_256_key_modelSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Iu_256_key_modelSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Iu_256_key_modelSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Iu_256_key_modelSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Iu_256_key_modelSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Iu_256_key_modelSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Iu_256_key_modelSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Iu_256_key_modelSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIu_256_key_modelSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIu_256_key_modelSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIu_256_key_modelSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIu_256_key_modelSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIu_256_key_modelSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Iu_256_key_modelSafeDispatcherCopy of core::traits::Copy::; +impl Iu_256_key_modelSafeDispatcherDrop of core::traits::Drop::; +impl Iu_256_key_modelSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Iu_256_key_modelSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Iu_256_key_modelSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIu_256_key_modelSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Iu_256_key_modelSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Iu_256_key_modelSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Iu_256_key_modelSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Iu_256_key_modelSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Iu_256_key_modelSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Iu_256_key_modelSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Iu_256_key_modelSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Iu_256_key_modelSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Iu_256_key_modelSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIu_256_key_modelSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIu_256_key_modelSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIu_256_key_modelSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIu_256_key_modelSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIu_256_key_modelSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IplayerDispatcherCopy of core::traits::Copy::; +impl IplayerDispatcherDrop of core::traits::Drop::; +impl IplayerDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IplayerDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IplayerDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIplayerDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IplayerDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IplayerDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IplayerDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IplayerDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IplayerDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IplayerDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IplayerDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IplayerDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IplayerDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIplayerDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIplayerDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIplayerDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIplayerDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIplayerDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IplayerLibraryDispatcherCopy of core::traits::Copy::; +impl IplayerLibraryDispatcherDrop of core::traits::Drop::; +impl IplayerLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IplayerLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IplayerLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIplayerLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IplayerLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IplayerLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IplayerLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IplayerLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IplayerLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IplayerLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IplayerLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IplayerLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IplayerLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIplayerLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIplayerLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIplayerLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIplayerLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIplayerLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IplayerSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IplayerSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IplayerSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IplayerSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IplayerSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIplayerSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IplayerSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IplayerSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IplayerSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IplayerSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IplayerSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IplayerSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IplayerSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IplayerSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IplayerSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIplayerSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIplayerSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIplayerSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIplayerSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIplayerSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IplayerSafeDispatcherCopy of core::traits::Copy::; +impl IplayerSafeDispatcherDrop of core::traits::Drop::; +impl IplayerSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IplayerSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IplayerSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIplayerSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IplayerSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IplayerSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IplayerSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IplayerSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IplayerSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IplayerSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IplayerSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IplayerSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IplayerSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIplayerSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIplayerSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIplayerSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIplayerSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIplayerSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_simple_arrayDispatcherCopy of core::traits::Copy::; +impl Imodel_with_simple_arrayDispatcherDrop of core::traits::Drop::; +impl Imodel_with_simple_arrayDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_simple_arrayDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_simple_arrayDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_simple_arrayDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_simple_arrayDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_simple_arrayDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_simple_arrayDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_simple_arrayDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_simple_arrayDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_simple_arrayDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_simple_arrayDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_simple_arrayDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_simple_arrayDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_simple_arrayDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_simple_arrayDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_simple_arrayDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_simple_arrayDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_simple_arrayDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_simple_arrayLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_simple_arrayLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_simple_arrayLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_simple_arrayLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_simple_arrayLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_simple_arrayLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_simple_arrayLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_simple_arrayLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_simple_arrayLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_simple_arrayLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_simple_arrayLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_simple_arrayLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_simple_arrayLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_simple_arrayLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_simple_arrayLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_simple_arrayLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_simple_arrayLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_simple_arrayLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_simple_arrayLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_simple_arrayLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_simple_arraySafeLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_simple_arraySafeLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_simple_arraySafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_simple_arraySafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_simple_arraySafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_simple_arraySafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_simple_arraySafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_simple_arraySafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_simple_arraySafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_simple_arraySafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_simple_arraySafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_simple_arraySafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_simple_arraySafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_simple_arraySafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_simple_arraySafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_simple_arraySafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_simple_arraySafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_simple_arraySafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_simple_arraySafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_simple_arraySafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_simple_arraySafeDispatcherCopy of core::traits::Copy::; +impl Imodel_with_simple_arraySafeDispatcherDrop of core::traits::Drop::; +impl Imodel_with_simple_arraySafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_simple_arraySafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_simple_arraySafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_simple_arraySafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_simple_arraySafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_simple_arraySafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_simple_arraySafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_simple_arraySafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_simple_arraySafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_simple_arraySafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_simple_arraySafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_simple_arraySafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_simple_arraySafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_simple_arraySafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_simple_arraySafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_simple_arraySafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_simple_arraySafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_simple_arraySafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_byte_arrayDispatcherCopy of core::traits::Copy::; +impl Imodel_with_byte_arrayDispatcherDrop of core::traits::Drop::; +impl Imodel_with_byte_arrayDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_byte_arrayDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_byte_arrayDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_byte_arrayDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_byte_arrayDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_byte_arrayDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_byte_arrayDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_byte_arrayDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_byte_arrayDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_byte_arrayDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_byte_arrayDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_byte_arrayDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_byte_arrayDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_byte_arrayDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_byte_arrayDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_byte_arrayDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_byte_arrayDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_byte_arrayDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_byte_arrayLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_byte_arrayLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_byte_arrayLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_byte_arrayLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_byte_arrayLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_byte_arrayLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_byte_arrayLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_byte_arrayLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_byte_arrayLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_byte_arrayLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_byte_arrayLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_byte_arrayLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_byte_arrayLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_byte_arrayLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_byte_arrayLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_byte_arrayLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_byte_arrayLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_byte_arrayLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_byte_arrayLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_byte_arrayLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_byte_arraySafeLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_byte_arraySafeLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_byte_arraySafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_byte_arraySafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_byte_arraySafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_byte_arraySafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_byte_arraySafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_byte_arraySafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_byte_arraySafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_byte_arraySafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_byte_arraySafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_byte_arraySafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_byte_arraySafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_byte_arraySafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_byte_arraySafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_byte_arraySafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_byte_arraySafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_byte_arraySafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_byte_arraySafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_byte_arraySafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_byte_arraySafeDispatcherCopy of core::traits::Copy::; +impl Imodel_with_byte_arraySafeDispatcherDrop of core::traits::Drop::; +impl Imodel_with_byte_arraySafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_byte_arraySafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_byte_arraySafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_byte_arraySafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_byte_arraySafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_byte_arraySafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_byte_arraySafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_byte_arraySafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_byte_arraySafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_byte_arraySafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_byte_arraySafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_byte_arraySafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_byte_arraySafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_byte_arraySafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_byte_arraySafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_byte_arraySafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_byte_arraySafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_byte_arraySafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_complex_arrayDispatcherCopy of core::traits::Copy::; +impl Imodel_with_complex_arrayDispatcherDrop of core::traits::Drop::; +impl Imodel_with_complex_arrayDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_complex_arrayDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_complex_arrayDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_complex_arrayDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_complex_arrayDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_complex_arrayDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_complex_arrayDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_complex_arrayDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_complex_arrayDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_complex_arrayDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_complex_arrayDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_complex_arrayDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_complex_arrayDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_complex_arrayDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_complex_arrayDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_complex_arrayDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_complex_arrayDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_complex_arrayDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_complex_arrayLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_complex_arrayLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_complex_arrayLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_complex_arrayLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_complex_arrayLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_complex_arrayLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_complex_arrayLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_complex_arrayLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_complex_arrayLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_complex_arrayLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_complex_arrayLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_complex_arrayLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_complex_arrayLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_complex_arrayLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_complex_arrayLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_complex_arrayLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_complex_arrayLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_complex_arrayLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_complex_arrayLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_complex_arrayLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_complex_arraySafeLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_complex_arraySafeLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_complex_arraySafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_complex_arraySafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_complex_arraySafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_complex_arraySafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_complex_arraySafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_complex_arraySafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_complex_arraySafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_complex_arraySafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_complex_arraySafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_complex_arraySafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_complex_arraySafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_complex_arraySafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_complex_arraySafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_complex_arraySafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_complex_arraySafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_complex_arraySafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_complex_arraySafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_complex_arraySafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_complex_arraySafeDispatcherCopy of core::traits::Copy::; +impl Imodel_with_complex_arraySafeDispatcherDrop of core::traits::Drop::; +impl Imodel_with_complex_arraySafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_complex_arraySafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_complex_arraySafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_complex_arraySafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_complex_arraySafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_complex_arraySafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_complex_arraySafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_complex_arraySafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_complex_arraySafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_complex_arraySafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_complex_arraySafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_complex_arraySafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_complex_arraySafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_complex_arraySafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_complex_arraySafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_complex_arraySafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_complex_arraySafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_complex_arraySafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_tupleDispatcherCopy of core::traits::Copy::; +impl Imodel_with_tupleDispatcherDrop of core::traits::Drop::; +impl Imodel_with_tupleDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_tupleDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_tupleDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_tupleDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_tupleDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_tupleDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_tupleDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_tupleDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_tupleDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_tupleDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_tupleDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_tupleDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_tupleDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_tupleDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_tupleDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_tupleDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_tupleDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_tupleDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_tupleLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_tupleLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_tupleLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_tupleLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_tupleLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_tupleLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_tupleLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_tupleLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_tupleLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_tupleLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_tupleLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_tupleLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_tupleLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_tupleLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_tupleLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_tupleLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_tupleLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_tupleLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_tupleLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_tupleLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_tupleSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_tupleSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_tupleSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_tupleSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_tupleSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_tupleSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_tupleSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_tupleSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_tupleSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_tupleSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_tupleSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_tupleSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_tupleSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_tupleSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_tupleSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_tupleSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_tupleSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_tupleSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_tupleSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_tupleSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_tupleSafeDispatcherCopy of core::traits::Copy::; +impl Imodel_with_tupleSafeDispatcherDrop of core::traits::Drop::; +impl Imodel_with_tupleSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_tupleSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_tupleSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_tupleSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_tupleSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_tupleSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_tupleSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_tupleSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_tupleSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_tupleSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_tupleSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_tupleSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_tupleSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_tupleSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_tupleSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_tupleSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_tupleSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_tupleSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_tuple_no_primitivesDispatcherCopy of core::traits::Copy::; +impl Imodel_with_tuple_no_primitivesDispatcherDrop of core::traits::Drop::; +impl Imodel_with_tuple_no_primitivesDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_tuple_no_primitivesDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_tuple_no_primitivesDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_tuple_no_primitivesDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_tuple_no_primitivesDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_tuple_no_primitivesDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_tuple_no_primitivesDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_tuple_no_primitivesDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_tuple_no_primitivesDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_tuple_no_primitivesDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_tuple_no_primitivesDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_tuple_no_primitivesDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_tuple_no_primitivesDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_tuple_no_primitivesDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_tuple_no_primitivesDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_tuple_no_primitivesDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_tuple_no_primitivesDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_tuple_no_primitivesDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Imodel_with_tuple_no_primitivesLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_tuple_no_primitivesLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_tuple_no_primitivesLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_tuple_no_primitivesLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_tuple_no_primitivesLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_tuple_no_primitivesLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_tuple_no_primitivesLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_tuple_no_primitivesLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_tuple_no_primitivesLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_tuple_no_primitivesLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_tuple_no_primitivesLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_tuple_no_primitivesLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_tuple_no_primitivesLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_tuple_no_primitivesLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_tuple_no_primitivesLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_tuple_no_primitivesLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_tuple_no_primitivesLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_tuple_no_primitivesLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_tuple_no_primitivesLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_tuple_no_primitivesLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_tuple_no_primitivesSafeLibraryDispatcherCopy of core::traits::Copy::; +impl Imodel_with_tuple_no_primitivesSafeLibraryDispatcherDrop of core::traits::Drop::; +impl Imodel_with_tuple_no_primitivesSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_tuple_no_primitivesSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_tuple_no_primitivesSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_tuple_no_primitivesSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_tuple_no_primitivesSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_tuple_no_primitivesSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_tuple_no_primitivesSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_tuple_no_primitivesSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl Imodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl Imodel_with_tuple_no_primitivesSafeDispatcherCopy of core::traits::Copy::; +impl Imodel_with_tuple_no_primitivesSafeDispatcherDrop of core::traits::Drop::; +impl Imodel_with_tuple_no_primitivesSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @Imodel_with_tuple_no_primitivesSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Imodel_with_tuple_no_primitivesSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImodel_with_tuple_no_primitivesSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + Imodel_with_tuple_no_primitivesSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: Imodel_with_tuple_no_primitivesSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + Imodel_with_tuple_no_primitivesSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: Imodel_with_tuple_no_primitivesSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct Imodel_with_tuple_no_primitivesSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl Imodel_with_tuple_no_primitivesSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = Imodel_with_tuple_no_primitivesSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> Imodel_with_tuple_no_primitivesSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + Imodel_with_tuple_no_primitivesSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableImodel_with_tuple_no_primitivesSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableImodel_with_tuple_no_primitivesSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableImodel_with_tuple_no_primitivesSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableImodel_with_tuple_no_primitivesSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableImodel_with_tuple_no_primitivesSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl Ibad_model_multiple_versionsDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_multiple_versionsDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_multiple_versionsDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_multiple_versionsDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_multiple_versionsLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_multiple_versionsLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_multiple_versionsLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_multiple_versionsLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_multiple_versionsSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_multiple_versionsSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_multiple_versionsSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_multiple_versionsSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_multiple_versionsSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_multiple_versionsSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_multiple_versionsSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_multiple_versionsSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_bad_version_typeDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_bad_version_typeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_bad_version_typeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_bad_version_typeDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_bad_version_typeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_bad_version_typeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_bad_version_typeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_bad_version_typeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_bad_version_typeSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_bad_version_typeSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_bad_version_typeSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_bad_version_typeSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_bad_version_typeSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_bad_version_typeSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_bad_version_typeSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_bad_version_typeSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_no_version_valueDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_no_version_valueDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_no_version_valueDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_no_version_valueDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_no_version_valueLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_no_version_valueLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_no_version_valueLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_no_version_valueLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_no_version_valueSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_no_version_valueSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_no_version_valueSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_no_version_valueSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_no_version_valueSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_no_version_valueSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_no_version_valueSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_no_version_valueSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_unexpected_arg_with_valueDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_unexpected_arg_with_valueDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_unexpected_arg_with_valueDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_unexpected_arg_with_valueDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_unexpected_arg_with_valueLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_unexpected_arg_with_valueLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_unexpected_arg_with_valueLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_unexpected_arg_with_valueLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_unexpected_arg_with_valueSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_unexpected_arg_with_valueSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_unexpected_arg_with_valueSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_unexpected_arg_with_valueSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_unexpected_arg_with_valueSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_unexpected_argDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_unexpected_argDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_unexpected_argDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_unexpected_argDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_unexpected_argLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_unexpected_argLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_unexpected_argLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_unexpected_argLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_unexpected_argSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_unexpected_argSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_unexpected_argSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_unexpected_argSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_unexpected_argSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_unexpected_argSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_unexpected_argSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_unexpected_argSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_not_supported_versionDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_not_supported_versionDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_not_supported_versionDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_not_supported_versionDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_not_supported_versionLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_not_supported_versionLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_not_supported_versionLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_not_supported_versionLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_not_supported_versionSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_not_supported_versionSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_not_supported_versionSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_not_supported_versionSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ibad_model_not_supported_versionSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Ibad_model_not_supported_versionSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIbad_model_not_supported_versionSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIbad_model_not_supported_versionSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodelv_0DispatcherSubPointersDrop of core::traits::Drop::; +impl Imodelv_0DispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodelv_0DispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodelv_0DispatcherSubPointersCopy of core::traits::Copy::; +impl Imodelv_0LibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodelv_0LibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodelv_0LibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodelv_0LibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodelv_0SafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodelv_0SafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodelv_0SafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodelv_0SafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodelv_0SafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodelv_0SafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodelv_0SafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodelv_0SafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_bad_namespace_formatDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_bad_namespace_formatDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_bad_namespace_formatDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_bad_namespace_formatDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_bad_namespace_formatLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_bad_namespace_formatLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_bad_namespace_formatLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_bad_namespace_formatLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_bad_namespace_formatSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_bad_namespace_formatSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_bad_namespace_formatSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_bad_namespace_formatSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_bad_namespace_formatSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_short_string_namespaceDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_short_string_namespaceDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_short_string_namespaceDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_short_string_namespaceDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_short_string_namespaceLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_short_string_namespaceLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_short_string_namespaceLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_short_string_namespaceLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_short_string_namespaceSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_short_string_namespaceSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_short_string_namespaceSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_short_string_namespaceSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_short_string_namespaceSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_short_string_namespaceSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_short_string_namespaceSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_short_string_namespaceSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_string_namespaceDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_string_namespaceDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_string_namespaceDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_string_namespaceDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_string_namespaceLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_string_namespaceLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_string_namespaceLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_string_namespaceLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_string_namespaceSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_string_namespaceSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_string_namespaceSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_string_namespaceSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_string_namespaceSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_string_namespaceSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_string_namespaceSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_string_namespaceSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl IpositionDispatcherSubPointersDrop of core::traits::Drop::; +impl IpositionDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIpositionDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIpositionDispatcherSubPointersCopy of core::traits::Copy::; +impl IpositionLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IpositionLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIpositionLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIpositionLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IpositionSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IpositionSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIpositionSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIpositionSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IpositionSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IpositionSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIpositionSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIpositionSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl IrolesDispatcherSubPointersDrop of core::traits::Drop::; +impl IrolesDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIrolesDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIrolesDispatcherSubPointersCopy of core::traits::Copy::; +impl IrolesLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IrolesLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIrolesLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIrolesLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IrolesSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IrolesSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIrolesSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIrolesSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IrolesSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IrolesSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIrolesSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIrolesSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Ionly_key_modelDispatcherSubPointersDrop of core::traits::Drop::; +impl Ionly_key_modelDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIonly_key_modelDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIonly_key_modelDispatcherSubPointersCopy of core::traits::Copy::; +impl Ionly_key_modelLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ionly_key_modelLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIonly_key_modelLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIonly_key_modelLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ionly_key_modelSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Ionly_key_modelSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIonly_key_modelSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIonly_key_modelSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Ionly_key_modelSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Ionly_key_modelSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIonly_key_modelSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIonly_key_modelSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Iu_256_key_modelDispatcherSubPointersDrop of core::traits::Drop::; +impl Iu_256_key_modelDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIu_256_key_modelDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIu_256_key_modelDispatcherSubPointersCopy of core::traits::Copy::; +impl Iu_256_key_modelLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Iu_256_key_modelLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIu_256_key_modelLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIu_256_key_modelLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Iu_256_key_modelSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Iu_256_key_modelSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIu_256_key_modelSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIu_256_key_modelSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Iu_256_key_modelSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Iu_256_key_modelSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIu_256_key_modelSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIu_256_key_modelSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl IplayerDispatcherSubPointersDrop of core::traits::Drop::; +impl IplayerDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIplayerDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIplayerDispatcherSubPointersCopy of core::traits::Copy::; +impl IplayerLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IplayerLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIplayerLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIplayerLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IplayerSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IplayerSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIplayerSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIplayerSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IplayerSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IplayerSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIplayerSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIplayerSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_simple_arrayDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_simple_arrayDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_simple_arrayDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_simple_arrayDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_simple_arrayLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_simple_arrayLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_simple_arrayLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_simple_arrayLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_simple_arraySafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_simple_arraySafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_simple_arraySafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_simple_arraySafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_simple_arraySafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_simple_arraySafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_simple_arraySafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_simple_arraySafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_byte_arrayDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_byte_arrayDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_byte_arrayDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_byte_arrayDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_byte_arrayLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_byte_arrayLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_byte_arrayLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_byte_arrayLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_byte_arraySafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_byte_arraySafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_byte_arraySafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_byte_arraySafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_byte_arraySafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_byte_arraySafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_byte_arraySafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_byte_arraySafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_complex_arrayDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_complex_arrayDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_complex_arrayDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_complex_arrayDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_complex_arrayLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_complex_arrayLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_complex_arrayLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_complex_arrayLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_complex_arraySafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_complex_arraySafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_complex_arraySafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_complex_arraySafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_complex_arraySafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_complex_arraySafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_complex_arraySafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_complex_arraySafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_tupleDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_tupleDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_tupleDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_tupleDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_tupleLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_tupleLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_tupleLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_tupleLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_tupleSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_tupleSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_tupleSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_tupleSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_tupleSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_tupleSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_tupleSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_tupleSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_tuple_no_primitivesDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_tuple_no_primitivesDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_tuple_no_primitivesDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_tuple_no_primitivesDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_tuple_no_primitivesLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_tuple_no_primitivesLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_tuple_no_primitivesLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_tuple_no_primitivesLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_tuple_no_primitivesSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl Imodel_with_tuple_no_primitivesSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl Imodel_with_tuple_no_primitivesSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableImodel_with_tuple_no_primitivesSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableImodel_with_tuple_no_primitivesSafeDispatcherSubPointersCopy of core::traits::Copy::; + +//! > expected_diagnostics +error: A Dojo model must have zero or one dojo::model attribute. + --> /tmp/plugin_test/src/lib.cairo:1:1 +#[dojo::model(version: 0)] +^************************^ + +error: Too many 'version' attributes for dojo::model + --> /tmp/plugin_test/src/lib.cairo:9:1 +#[dojo::model(version: 0, version: 0)] +^************************************^ + +error: The argument 'version' of dojo::model must be an integer + --> /tmp/plugin_test/src/lib.cairo:16:24 +#[dojo::model(version: hello)] + ^***^ + +error: Unexpected argument 'version' for dojo::model + --> /tmp/plugin_test/src/lib.cairo:23:15 +#[dojo::model(version)] + ^*****^ + +error: Unexpected argument 'my_arg' for dojo::model + --> /tmp/plugin_test/src/lib.cairo:30:15 +#[dojo::model(my_arg: 1)] + ^*******^ + +error: Unexpected argument 'my_arg' for dojo::model + --> /tmp/plugin_test/src/lib.cairo:37:15 +#[dojo::model(my_arg)] + ^****^ + +error: dojo::model version 2 not supported + --> /tmp/plugin_test/src/lib.cairo:44:24 +#[dojo::model(version: 2)] + ^ + +error: Model must define at least one #[key] attribute + --> /tmp/plugin_test/src/lib.cairo:87:8 +struct Roles { + ^***^ + +error: Model must define at least one member that is not a key + --> /tmp/plugin_test/src/lib.cairo:92:8 +struct OnlyKeyModel { + ^**********^ + +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. + --> /tmp/plugin_test/src/lib.cairo:100:5 + id: u256 + ^^ + +error: Model must define at least one member that is not a key + --> /tmp/plugin_test/src/lib.cairo:98:8 +struct U256KeyModel { + ^**********^ diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index b7eb73e2cf..1383648b14 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -355,57 +355,11026 @@ mod ctxnamed { } //! > expected_diagnostics -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:4:10 -#[derive(Print)] - ^***^ - -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:12:10 -#[derive(Print)] - ^***^ - -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:19:10 -#[derive(Print)] - ^***^ - -error: Unknown derive `Print` - a plugin might be missing. - --> /tmp/plugin_test/src/lib.cairo:28:10 -#[derive(Print)] - ^***^ +error: Anything other than functions is not supported in a dojo::interface + --> /tmp/plugin_test/src/lib.cairo:90:5 + const ONE: u8; + ^************^ + +error: World parameter must be the first parameter. + --> /tmp/plugin_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. + --> /tmp/plugin_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. + --> /tmp/plugin_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. + --> /tmp/plugin_test/src/lib.cairo:114:5 + fn do_with_ref_self_and_world_inv( + ^********************************^ + +error: World parameter must be the first parameter. + --> /tmp/plugin_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. + --> /tmp/plugin_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. + --> /tmp/plugin_test/src/lib.cairo:132:9 + fn do_with_ref_self_and_world( + ^****************************^ + +error: You cannot use `self` and `world` parameters together. + --> /tmp/plugin_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. + --> /tmp/plugin_test/src/lib.cairo:142:9 + fn do_with_ref_self_and_world_inv( + ^********************************^ + +error: World parameter must be the first parameter. + --> /tmp/plugin_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. + --> /tmp/plugin_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. + --> /tmp/plugin_test/src/lib.cairo:224:5 + fn dojo_init( + ^***********^ + +error: `starknet::interface` function first parameter must be a reference to the trait's generic parameter or a snapshot of it. + --> /tmp/plugin_test/src/lib.cairo:105:5 + fn do_with_self(self: @ContractState) -> felt252; + ^**********************************************^ + +error: `starknet::interface` function first parameter must be a reference to the trait's generic parameter or a snapshot of it. + --> /tmp/plugin_test/src/lib.cairo:106:5 + fn do_with_ref_self(ref self: ContractState) -> felt252; + ^*****************************************************^ + +error: `starknet::interface` function first parameter must be a reference to the trait's generic parameter or a snapshot of it. + --> /tmp/plugin_test/src/lib.cairo:111:5 + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252; + ^**********************************************************************************^ + +error: `starknet::interface` function first parameter must be a reference to the trait's generic parameter or a snapshot of it. + --> /tmp/plugin_test/src/lib.cairo:112:5 + fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; + ^********************************************************************************************^ + +error: `starknet::interface` functions don't support `ref` parameters other than the first one. + --> /tmp/plugin_test/src/lib.cairo:112:5 + fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; + ^********************************************************************************************^ + +error: `starknet::interface` functions don't support `ref` parameters other than the first one. + --> /tmp/plugin_test/src/lib.cairo:114:5 + fn do_with_ref_self_and_world_inv( + ^********************************^ + +error: `starknet::interface` functions don't support `ref` parameters other than the first one. + --> /tmp/plugin_test/src/lib.cairo:117:5 + fn do_with_several_world_dispatchers( + ^***********************************^ + +error: `starknet::interface` functions don't support `ref` parameters other than the first one. + --> /tmp/plugin_test/src/lib.cairo:121:5 + fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252; + ^***************************************************************************^ + +error: Generated trait must have generic args matching the impl's generic params. + --> /tmp/plugin_test/src/lib.cairo:163:5 + #[generate_trait] + ^***************^ //! > expanded_cairo_code -use serde::Serde; -use debug::PrintTrait; -#[derive(Print)] -struct Position { - #[key] - id: felt252, - x: felt252, - y: felt252 +#[starknet::component] +mod testcomponent1 { +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ComponentStorageBase { +} +#[derive(Drop, Copy)] +pub struct ComponentStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait> { + type BaseType = ComponentStorageBase; + type BaseMutType = ComponentStorageBaseMut; + fn storage_base(self: @ComponentState) -> ComponentStorageBase { + ComponentStorageBase { + } + } + fn storage_base_mut(ref self: ComponentState) -> ComponentStorageBaseMut { + ComponentStorageBaseMut { + } + } +} +pub struct ComponentState { +} + +impl ComponentStateDrop of Drop> {} + +impl ComponentStateDeref of core::ops::SnapshotDeref> { + type Target = ComponentStorageBase; + fn snapshot_deref(self: @ComponentState) -> ComponentStorageBase { + self.storage_base() + } +} +impl ComponentStateDerefMut of core::ops::DerefMut> { + type Target = ComponentStorageBaseMut; + fn deref_mut(ref self: ComponentState) -> ComponentStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_component_state() -> ComponentState { + ComponentState:: { + } +} + + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; +pub trait HasComponent { + fn get_component(self: @TContractState) -> @ComponentState; + fn get_component_mut(ref self: TContractState) -> ComponentState; + fn get_contract(self: @ComponentState) -> @TContractState; + fn get_contract_mut(ref self: ComponentState) -> TContractState; + fn emit>(ref self: ComponentState, event: S); +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ComponentStorageBaseDrop of core::traits::Drop::; +impl ComponentStorageBaseCopy of core::traits::Copy::; +impl ComponentStorageBaseMutDrop of core::traits::Drop::; +impl ComponentStorageBaseMutCopy of core::traits::Copy::; +} + +#[starknet::component] +mod testcomponent2 { +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct ComponentStorageBase { +} +#[derive(Drop, Copy)] +pub struct ComponentStorageBaseMut { +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait> { + type BaseType = ComponentStorageBase; + type BaseMutType = ComponentStorageBaseMut; + fn storage_base(self: @ComponentState) -> ComponentStorageBase { + ComponentStorageBase { + } + } + fn storage_base_mut(ref self: ComponentState) -> ComponentStorageBaseMut { + ComponentStorageBaseMut { + } + } +} +pub struct ComponentState { +} + +impl ComponentStateDrop of Drop> {} + +impl ComponentStateDeref of core::ops::SnapshotDeref> { + type Target = ComponentStorageBase; + fn snapshot_deref(self: @ComponentState) -> ComponentStorageBase { + self.storage_base() + } +} +impl ComponentStateDerefMut of core::ops::DerefMut> { + type Target = ComponentStorageBaseMut; + fn deref_mut(ref self: ComponentState) -> ComponentStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_component_state() -> ComponentState { + ComponentState:: { + } +} + + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; +pub trait HasComponent { + fn get_component(self: @TContractState) -> @ComponentState; + fn get_component_mut(ref self: TContractState) -> ComponentState; + fn get_contract(self: @ComponentState) -> @TContractState; + fn get_contract_mut(ref self: ComponentState) -> TContractState; + fn emit>(ref self: ComponentState, event: S); +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl ComponentStorageBaseDrop of core::traits::Drop::; +impl ComponentStorageBaseCopy of core::traits::Copy::; +impl ComponentStorageBaseMutDrop of core::traits::Drop::; +impl ComponentStorageBaseMutCopy of core::traits::Copy::; +} + + #[starknet::contract] + mod bad_namespace_format { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "bad_namespace_format" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-bad_namespace_format" + } + + fn name_hash(self: @ContractState) -> felt252 { + 2014299465256018364248618312205774234949844604916563661777686628154176783488 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 2931670046498875274448874829231097042977275875153600823491451406128208153107 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::upgradeable::upgradeable::UpgradableImpl; + + use traits::Into; + use dojo::world::Context; + + fn execute(ctx: Context, name: felt252) { + 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 { + UpgradeableEvent: dojo::contract::upgradeable::upgradeable::Event, + } +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } } +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + -#[derive(Print)] -struct Roles { - role_ids: Array +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; } +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } -use starknet::ContractAddress; +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} -#[derive(Print)] -struct Player { - #[key] - game: felt252, - #[key] - player: ContractAddress, - name: felt252, +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } } -#[derive(Print)] -enum Enemy { - Unknown, - Bot: felt252, - OtherPlayer: ContractAddress, +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + + #[starknet::contract] + mod spawn { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "spawn" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-spawn" + } + + fn name_hash(self: @ContractState) -> felt252 { + 2776321589048333240377325502911505147617911439383944762363370901236132332849 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 2472087249524108479557800499207886557849609293388925195637428170796835731505 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::upgradeable::upgradeable::UpgradableImpl; + + use traits::Into; + use dojo::world::Context; + + fn execute(ctx: Context, name: felt252) { + 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 { + UpgradeableEvent: dojo::contract::upgradeable::upgradeable::Event, + } +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } +} +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } + +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + + #[starknet::contract] + mod proxy { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "proxy" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-proxy" + } + + fn name_hash(self: @ContractState) -> felt252 { + 379211399603323842291430789821178524592027629543381998047225121027704003915 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 3522586352349720867166847576673128733430338006217587257445073829693434546448 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::upgradeable::upgradeable::UpgradableImpl; + + fn execute(value: felt252) -> felt252 { + 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 { + UpgradeableEvent: dojo::contract::upgradeable::upgradeable::Event, + } +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } +} +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } + +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + + #[starknet::contract] + mod ctxnamed { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "ctxnamed" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-ctxnamed" + } + + fn name_hash(self: @ContractState) -> felt252 { + 1120614286815912604239420768209466007446460277061516527925636408561239543041 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 882574079468045629402181499911470715863025356910172410020020548741739455774 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::upgradeable::upgradeable::UpgradableImpl; + + use traits::Into; + use dojo::world::Context; + + fn execute(ctx2: Context, name: felt252) { + 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 { + UpgradeableEvent: dojo::contract::upgradeable::upgradeable::Event, + } +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } +} +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } + +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + + #[starknet::contract] + mod withevent { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "withevent" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-withevent" + } + + fn name_hash(self: @ContractState) -> felt252 { + 2196275886623691942883456540767114081898043897719876113518403014973431884540 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 2302995054894169641868030754357260737170491794196617685355614288827933407674 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::upgradeable::upgradeable::UpgradableImpl; + + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + UpgradeableEvent: dojo::contract::upgradeable::upgradeable::Event, + TestEvent: TestEvent + } + + #[derive(Drop, starknet::Event)] + struct TestEvent { + 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'); + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + Event::TestEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("TestEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + if __selector__ == selector!("TestEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::TestEvent(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} +impl EventTestEventIntoEvent of Into { + fn into(self: TestEvent) -> Event { + Event::TestEvent(self) + } +} +impl TestEventDrop of core::traits::Drop::; +impl TestEventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @TestEvent, ref keys: Array, ref data: Array + ) { + core::serde::Serde::serialize(self.address, ref data); + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let address = core::serde::Serde::deserialize( + ref data + )?; + Option::Some(TestEvent {address, }) + } +} +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } +} +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } + +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + + #[starknet::contract] + mod withcomponent { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "withcomponent" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-withcomponent" + } + + fn name_hash(self: @ContractState) -> felt252 { + 999850881662666048155666650426666132968026605763740651763663703103974774091 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 795804664978713707757807985251114311939501109833092725925763852713460388378 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::upgradeable::upgradeable::UpgradableImpl; + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + UpgradeableEvent: dojo::contract::upgradeable::upgradeable::Event, + #[flat] + testcomponent1_event: testcomponent1::Event, + testcomponent2_event: testcomponent2::Event + } + + #[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'); + } + } + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, + pub testcomponent1_storage: testcomponent1::Storage, + pub testcomponent2_storage: testcomponent2::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, + pub testcomponent1_storage: starknet::storage::StorageBase, + pub testcomponent2_storage: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, + pub testcomponent1_storage: starknet::storage::StorageBase>, + pub testcomponent2_storage: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + testcomponent1_storage: starknet::storage::StorageBase{ address: selector!("testcomponent1_storage") }, + testcomponent2_storage: starknet::storage::StorageBase{ address: selector!("testcomponent2_storage") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + testcomponent1_storage: starknet::storage::StorageBase{ address: selector!("testcomponent1_storage") }, + testcomponent2_storage: starknet::storage::StorageBase{ address: selector!("testcomponent2_storage") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, + pub testcomponent1_storage: testcomponent1::ComponentState, + pub testcomponent2_storage: testcomponent2::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + testcomponent1_storage: testcomponent1::unsafe_new_component_state::(), + testcomponent2_storage: testcomponent2::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } +} +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } + +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl HasComponentImpl_testcomponent1 of testcomponent1::HasComponent { + fn get_component(self: @ContractState) -> @testcomponent1::ComponentState { + @testcomponent1::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> testcomponent1::ComponentState { + testcomponent1::unsafe_new_component_state::() + } + fn get_contract(self: @testcomponent1::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: testcomponent1::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: testcomponent1::ComponentState, event: S) { + let event: testcomponent1::Event = core::traits::Into::into(event); + let mut contract = testcomponent1::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::testcomponent1_event(event)); + } +} +impl HasComponentImpl_testcomponent2 of testcomponent2::HasComponent { + fn get_component(self: @ContractState) -> @testcomponent2::ComponentState { + @testcomponent2::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> testcomponent2::ComponentState { + testcomponent2::unsafe_new_component_state::() + } + fn get_contract(self: @testcomponent2::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: testcomponent2::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: testcomponent2::ComponentState, event: S) { + let event: testcomponent2::Event = core::traits::Into::into(event); + let mut contract = testcomponent2::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::testcomponent2_event(event)); + } +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + Event::testcomponent1_event(val) => { + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + Event::testcomponent2_event(val) => { + core::array::ArrayTrait::append(ref keys, selector!("testcomponent2_event")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + { + let mut keys = keys; + let mut data = data; + match starknet::Event::deserialize(ref keys, ref data) { + Option::Some(val) => { + return Option::Some(Event::testcomponent1_event(val)); + }, + Option::None => {}, + }; + } + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + if __selector__ == selector!("testcomponent2_event") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::testcomponent2_event(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} +impl Eventtestcomponent1_eventIntoEvent of Into { + fn into(self: testcomponent1::Event) -> Event { + Event::testcomponent1_event(self) + } +} +impl Eventtestcomponent2_eventIntoEvent of Into { + fn into(self: testcomponent2::Event) -> Event { + Event::testcomponent2_event(self) + } +} +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + + #[starknet::interface] + pub trait IEmptyTrait {} + + #[starknet::interface] + pub trait IFaultyTrait { + fn do_with_attrs(self: @TContractState, p1: u8) -> u16; + } + + #[starknet::interface] + pub 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; + } + + #[starknet::interface] + pub 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; + } + + #[starknet::contract] + mod MyFaultyContract { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "MyFaultyContract" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-MyFaultyContract" + } + + fn name_hash(self: @ContractState) -> felt252 { + 3439743807865759203015037013733809315384408083697880336790137144257764256358 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 1862046669446530718410691364259438011386499031689246339557998041337203828246 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::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' +}} + #[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); + } + + #[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::contract::upgradeable::upgradeable::Event, + } + trait InternalUtils{fn bad_func_using_generate(self: @ContractState) -> felt252; +} +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } +} +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestFaultyImpl__do_with_self_and_world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestFaultyImpl::do_with_self_and_world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestFaultyImpl__do_with_ref_self_and_world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestFaultyImpl::do_with_ref_self_and_world(ref contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestFaultyImpl__do_with_self_and_world_inv(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_self = core::option::OptionTraitImpl::expect( + core::serde::Serde::<@ContractState>::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestFaultyImpl::do_with_self_and_world_inv(@contract_state, __arg_self); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestFaultyImpl__do_with_ref_self_and_world_inv(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let mut __arg_self = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestFaultyImpl::do_with_ref_self_and_world_inv(ref contract_state, ref __arg_self); + let mut arr = ArrayTrait::new(); + // References. + core::serde::Serde::::serialize(@__arg_self, ref arr); + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestFaultyImpl__do_with_several_world_dispatchers(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_vec = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + let mut __arg_another_world = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #2' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestFaultyImpl::do_with_several_world_dispatchers(@contract_state, __arg_vec, ref __arg_another_world); + let mut arr = ArrayTrait::new(); + // References. + core::serde::Serde::::serialize(@__arg_another_world, ref arr); + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestFaultyImpl__do_with_world_not_named_world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_another_world = core::option::OptionTraitImpl::expect( + core::serde::Serde::<@IWorldDispatcher>::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestFaultyImpl::do_with_world_not_named_world(@contract_state, __arg_another_world); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestFaultyImpl__do_with_world_not_first(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_vec = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestFaultyImpl::do_with_world_not_first(@contract_state, __arg_vec); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__TestFaultyImpl__do_with_self_and_world as do_with_self_and_world; + pub use super::__wrapper__TestFaultyImpl__do_with_ref_self_and_world as do_with_ref_self_and_world; + pub use super::__wrapper__TestFaultyImpl__do_with_self_and_world_inv as do_with_self_and_world_inv; + pub use super::__wrapper__TestFaultyImpl__do_with_ref_self_and_world_inv as do_with_ref_self_and_world_inv; + pub use super::__wrapper__TestFaultyImpl__do_with_several_world_dispatchers as do_with_several_world_dispatchers; + pub use super::__wrapper__TestFaultyImpl__do_with_world_not_named_world as do_with_world_not_named_world; + pub use super::__wrapper__TestFaultyImpl__do_with_world_not_first as do_with_world_not_first; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } + +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + + #[starknet::contract] + mod MyNominalContract { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "MyNominalContract" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-MyNominalContract" + } + + fn name_hash(self: @ContractState) -> felt252 { + 1172628497499445169993220559087829230676589931723677494032285307738203070578 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 2020162355936884646880401248118384176803981589166410970216209297939905305278 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::upgradeable::upgradeable::UpgradableImpl; + + #[derive(Drop)] + struct Action { + damage: u8 + } + + #[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' +}} + #[generate_trait] + impl ImplInternalNoContractState of InternalNoContractState { + fn func1(world: IWorldDispatcher) -> felt252 { + let _w = world; + 42 + } + } + + #[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::contract::upgradeable::upgradeable::Event, + } +impl ActionDrop of core::traits::Drop::; + trait InternalNoContractState { + fn func1(world: IWorldDispatcher) -> felt252; + } +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } +} +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestNominalImpl__do_no_param(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestNominalImpl::do_no_param(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestNominalImpl__do_no_param_but_world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestNominalImpl::do_no_param_but_world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestNominalImpl__do_no_param_but_world_ref(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestNominalImpl::do_no_param_but_world_ref(ref contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestNominalImpl__do_params_no_world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_p1 = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + let __arg_p2 = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #2' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestNominalImpl::do_params_no_world(@contract_state, __arg_p1, __arg_p2); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestNominalImpl__do_params_and_world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_p2 = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestNominalImpl::do_params_and_world(@contract_state, __arg_p2); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestNominalImpl__do_params_and_world_ref(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_p2 = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestNominalImpl::do_params_and_world_ref(ref contract_state, __arg_p2); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestNominalImpl__do_with_self(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestNominalImpl::do_with_self(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__TestNominalImpl__do_with_ref_self(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = TestNominalImpl::do_with_ref_self(ref contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__TestNominalImpl__do_no_param as do_no_param; + pub use super::__wrapper__TestNominalImpl__do_no_param_but_world as do_no_param_but_world; + pub use super::__wrapper__TestNominalImpl__do_no_param_but_world_ref as do_no_param_but_world_ref; + pub use super::__wrapper__TestNominalImpl__do_params_no_world as do_params_no_world; + pub use super::__wrapper__TestNominalImpl__do_params_and_world as do_params_and_world; + pub use super::__wrapper__TestNominalImpl__do_params_and_world_ref as do_params_and_world_ref; + pub use super::__wrapper__TestNominalImpl__do_with_self as do_with_self; + pub use super::__wrapper__TestNominalImpl__do_with_ref_self as do_with_ref_self; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } + +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + + #[starknet::contract] + mod init_test { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "init_test" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-init_test" + } + + fn name_hash(self: @ContractState) -> felt252 { + 1673722391095039242574232979635399085098867563460816803458086922970092209409 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 799876284284394866912776672431802324689156187217902437477103298743064217162 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::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::contract::upgradeable::upgradeable::Event, + } +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@actions_address, ref __calldata__); + core::serde::Serde::::serialize(@actions_class, ref __calldata__); + core::serde::Serde::::serialize(@value, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@actions_address, ref __calldata__); + core::serde::Serde::::serialize(@actions_class, ref __calldata__); + core::serde::Serde::::serialize(@value, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@actions_address, ref __calldata__); + core::serde::Serde::::serialize(@actions_class, ref __calldata__); + core::serde::Serde::::serialize(@value, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@actions_address, ref __calldata__); + core::serde::Serde::::serialize(@actions_class, ref __calldata__); + core::serde::Serde::::serialize(@value, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } +} +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_actions_address = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + let __arg_actions_class = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #2' + ); + let __arg_value = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #3' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, __arg_actions_address, __arg_actions_class, __arg_value); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } + +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + + #[starknet::contract] + mod no_init_test { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::contract::IContract; + use starknet::storage::{ + StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess + }; + + #[abi(embed_v0)] + pub impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "no_init_test" + } + + fn namespace(self: @ContractState) -> ByteArray { + "test_package" + } + + fn tag(self: @ContractState) -> ByteArray { + "test_package-no_init_test" + } + + fn name_hash(self: @ContractState) -> felt252 { + 2188407785440294979090510634648735461326850740369373015349552249835679156474 + } + + fn namespace_hash(self: @ContractState) -> felt252 { + 3061092720893075933752785490401950953836105364709575990296000909161416686979 + } + + fn selector(self: @ContractState) -> felt252 { + 3269287263937103915837903451864388946886384011514094502724942119672327217364 + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::contract::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::contract::upgradeable::upgradeable::Event, + } +trait IDojoInitDispatcherTrait { + fn dojo_init(self: T); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitLibraryDispatcherImpl of IDojoInitDispatcherTrait { + fn dojo_init(self: IDojoInitLibraryDispatcher) { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +trait IDojoInitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn dojo_init(self: T) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IDojoInitSafeLibraryDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +struct IDojoInitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IDojoInitSafeDispatcherImpl of IDojoInitSafeDispatcherTrait { + fn dojo_init(self: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("dojo_init"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + Event::UpgradeableEvent(val) => { + core::array::ArrayTrait::append(ref keys, selector!("UpgradeableEvent")); + starknet::Event::append_keys_and_data( + val, ref keys, ref data + ); + }, + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + if __selector__ == selector!("UpgradeableEvent") { + let val = starknet::Event::deserialize( + ref keys, ref data + )?; + return Option::Some(Event::UpgradeableEvent(val)); + } + Option::None + } +} +impl EventUpgradeableEventIntoEvent of Into { + fn into(self: dojo::contract::upgradeable::upgradeable::Event) -> Event { + Event::UpgradeableEvent(self) + } +} + + +#[phantom] +pub struct Storage { + pub world_dispatcher: IWorldDispatcher, + pub upgradeable: dojo::contract::upgradeable::upgradeable::Storage, +} + +#[derive(Drop, Copy)] +pub struct ContractStorageBase { + pub world_dispatcher: starknet::storage::StorageBase, + pub upgradeable: starknet::storage::StorageBase, +} +#[derive(Drop, Copy)] +pub struct ContractStorageBaseMut { + pub world_dispatcher: starknet::storage::StorageBase>, + pub upgradeable: starknet::storage::StorageBase>, +} +impl StorageBaseImpl of starknet::storage::StorageBaseTrait { + type BaseType = ContractStorageBase; + type BaseMutType = ContractStorageBaseMut; + fn storage_base(self: @ContractState) -> ContractStorageBase { + ContractStorageBase { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } + fn storage_base_mut(ref self: ContractState) -> ContractStorageBaseMut { + ContractStorageBaseMut { + world_dispatcher: starknet::storage::StorageBase{ address: selector!("world_dispatcher") }, + upgradeable: starknet::storage::StorageBase{ address: selector!("upgradeable") }, + } + } +} +pub struct ContractState { + pub upgradeable: dojo::contract::upgradeable::upgradeable::ComponentState, +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = ContractStorageBase; + fn snapshot_deref(self: @ContractState) -> ContractStorageBase { + self.storage_base() + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = ContractStorageBaseMut; + fn deref_mut(ref self: ContractState) -> ContractStorageBaseMut { + self.storage_base_mut() + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + upgradeable: dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::(), + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__contract_name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::contract_name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__ContractImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = ContractImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__WorldProviderImpl__world(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = WorldProviderImpl::world(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +impl ContractStateUpgradableImpl of + dojo::contract::upgradeable::upgradeable::UnsafeNewContractStateTraitForUpgradableImpl { + fn unsafe_new_contract_state() -> ContractState { + unsafe_new_contract_state() + } +} +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__IDojoInitImpl__dojo_init(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + IDojoInitImpl::dojo_init(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__ContractImpl__contract_name as contract_name; + pub use super::__wrapper__ContractImpl__namespace as namespace; + pub use super::__wrapper__ContractImpl__tag as tag; + pub use super::__wrapper__ContractImpl__name_hash as name_hash; + pub use super::__wrapper__ContractImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__ContractImpl__selector as selector; + pub use super::__wrapper__WorldProviderImpl__world as world; + pub use super::__wrapper__IDojoInitImpl__dojo_init as dojo_init; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } + +impl HasComponentImpl_upgradeable of dojo::contract::upgradeable::upgradeable::HasComponent { + fn get_component(self: @ContractState) -> @dojo::contract::upgradeable::upgradeable::ComponentState { + @dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_component_mut(ref self: ContractState) -> dojo::contract::upgradeable::upgradeable::ComponentState { + dojo::contract::upgradeable::upgradeable::unsafe_new_component_state::() + } + fn get_contract(self: @dojo::contract::upgradeable::upgradeable::ComponentState) -> @ContractState { + @unsafe_new_contract_state() + } + fn get_contract_mut(ref self: dojo::contract::upgradeable::upgradeable::ComponentState) -> ContractState { + unsafe_new_contract_state() + } + fn emit>(ref self: dojo::contract::upgradeable::upgradeable::ComponentState, event: S) { + let event: dojo::contract::upgradeable::upgradeable::Event = core::traits::Into::into(event); + let mut contract = dojo::contract::upgradeable::upgradeable::HasComponent::get_contract_mut(ref self); + ContractStateEventEmitter::emit(ref contract, Event::UpgradeableEvent(event)); + } +} +impl IDojoInitDispatcherCopy of core::traits::Copy::; +impl IDojoInitDispatcherDrop of core::traits::Drop::; +impl IDojoInitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IDojoInitLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IDojoInitSafeDispatcherCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IDojoInitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IDojoInitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIDojoInitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IDojoInitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IDojoInitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IDojoInitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IDojoInitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIDojoInitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIDojoInitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIDojoInitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIDojoInitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIDojoInitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl ContractStorageBaseDrop of core::traits::Drop::; +impl ContractStorageBaseCopy of core::traits::Copy::; +impl ContractStorageBaseMutDrop of core::traits::Drop::; +impl ContractStorageBaseMutCopy of core::traits::Copy::; +impl IDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIDojoInitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIDojoInitSafeDispatcherSubPointersCopy of core::traits::Copy::; + + } + pub trait IEmptyTraitDispatcherTrait { +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IEmptyTraitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IEmptyTraitDispatcherImpl of IEmptyTraitDispatcherTrait { + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IEmptyTraitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IEmptyTraitLibraryDispatcherImpl of IEmptyTraitDispatcherTrait { + +} + + pub trait IEmptyTraitSafeDispatcherTrait { +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IEmptyTraitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IEmptyTraitSafeLibraryDispatcherImpl of IEmptyTraitSafeDispatcherTrait { + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IEmptyTraitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IEmptyTraitSafeDispatcherImpl of IEmptyTraitSafeDispatcherTrait { + +} + pub trait IFaultyTraitDispatcherTrait { + fn do_with_attrs(self: T, p1: u8) -> u16; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IFaultyTraitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IFaultyTraitDispatcherImpl of IFaultyTraitDispatcherTrait { + fn do_with_attrs(self: IFaultyTraitDispatcher, p1: u8) -> u16 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p1, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_with_attrs"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IFaultyTraitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IFaultyTraitLibraryDispatcherImpl of IFaultyTraitDispatcherTrait { + fn do_with_attrs(self: IFaultyTraitLibraryDispatcher, p1: u8) -> u16 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p1, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_with_attrs"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } + +} + + pub trait IFaultyTraitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn do_with_attrs(self: T, p1: u8) -> starknet::SyscallResult; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IFaultyTraitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IFaultyTraitSafeLibraryDispatcherImpl of IFaultyTraitSafeDispatcherTrait { + fn do_with_attrs(self: IFaultyTraitSafeLibraryDispatcher, p1: u8) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p1, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_with_attrs"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IFaultyTraitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IFaultyTraitSafeDispatcherImpl of IFaultyTraitSafeDispatcherTrait { + fn do_with_attrs(self: IFaultyTraitSafeDispatcher, p1: u8) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p1, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_with_attrs"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } + +} + pub trait INominalTraitDispatcherTrait { + fn do_no_param(self: T) -> felt252; +fn do_no_param_but_world(self: T) -> felt252; +fn do_no_param_but_world_ref(self: T) -> felt252; +fn do_params_no_world(self: T, p1: felt252, p2: u8) -> felt252; +fn do_params_and_world(self: T, p2: u8) -> felt252; +fn do_params_and_world_ref(self: T, p2: u8) -> felt252; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct INominalTraitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl INominalTraitDispatcherImpl of INominalTraitDispatcherTrait { + fn do_no_param(self: INominalTraitDispatcher) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_no_param"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_no_param_but_world(self: INominalTraitDispatcher) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_no_param_but_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_no_param_but_world_ref(self: INominalTraitDispatcher) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_no_param_but_world_ref"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_params_no_world(self: INominalTraitDispatcher, p1: felt252, p2: u8) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p1, ref __calldata__); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_params_no_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_params_and_world(self: INominalTraitDispatcher, p2: u8) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_params_and_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_params_and_world_ref(self: INominalTraitDispatcher, p2: u8) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_params_and_world_ref"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct INominalTraitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl INominalTraitLibraryDispatcherImpl of INominalTraitDispatcherTrait { + fn do_no_param(self: INominalTraitLibraryDispatcher) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_no_param"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_no_param_but_world(self: INominalTraitLibraryDispatcher) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_no_param_but_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_no_param_but_world_ref(self: INominalTraitLibraryDispatcher) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_no_param_but_world_ref"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_params_no_world(self: INominalTraitLibraryDispatcher, p1: felt252, p2: u8) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p1, ref __calldata__); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_params_no_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_params_and_world(self: INominalTraitLibraryDispatcher, p2: u8) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_params_and_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_params_and_world_ref(self: INominalTraitLibraryDispatcher, p2: u8) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_params_and_world_ref"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } + +} + + pub trait INominalTraitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn do_no_param(self: T) -> starknet::SyscallResult; + #[unstable(feature: "safe_dispatcher")] +fn do_no_param_but_world(self: T) -> starknet::SyscallResult; + #[unstable(feature: "safe_dispatcher")] +fn do_no_param_but_world_ref(self: T) -> starknet::SyscallResult; + #[unstable(feature: "safe_dispatcher")] +fn do_params_no_world(self: T, p1: felt252, p2: u8) -> starknet::SyscallResult; + #[unstable(feature: "safe_dispatcher")] +fn do_params_and_world(self: T, p2: u8) -> starknet::SyscallResult; + #[unstable(feature: "safe_dispatcher")] +fn do_params_and_world_ref(self: T, p2: u8) -> starknet::SyscallResult; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct INominalTraitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl INominalTraitSafeLibraryDispatcherImpl of INominalTraitSafeDispatcherTrait { + fn do_no_param(self: INominalTraitSafeLibraryDispatcher) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_no_param"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_no_param_but_world(self: INominalTraitSafeLibraryDispatcher) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_no_param_but_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_no_param_but_world_ref(self: INominalTraitSafeLibraryDispatcher) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_no_param_but_world_ref"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_params_no_world(self: INominalTraitSafeLibraryDispatcher, p1: felt252, p2: u8) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p1, ref __calldata__); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_params_no_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_params_and_world(self: INominalTraitSafeLibraryDispatcher, p2: u8) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_params_and_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_params_and_world_ref(self: INominalTraitSafeLibraryDispatcher, p2: u8) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_params_and_world_ref"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct INominalTraitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl INominalTraitSafeDispatcherImpl of INominalTraitSafeDispatcherTrait { + fn do_no_param(self: INominalTraitSafeDispatcher) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_no_param"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_no_param_but_world(self: INominalTraitSafeDispatcher) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_no_param_but_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_no_param_but_world_ref(self: INominalTraitSafeDispatcher) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_no_param_but_world_ref"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_params_no_world(self: INominalTraitSafeDispatcher, p1: felt252, p2: u8) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p1, ref __calldata__); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_params_no_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_params_and_world(self: INominalTraitSafeDispatcher, p2: u8) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_params_and_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_params_and_world_ref(self: INominalTraitSafeDispatcher, p2: u8) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@p2, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_params_and_world_ref"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } + +} + pub trait IFaultyTraitDispatcherTrait { +fn do_with_self_and_world_inv(self: T, self: @ContractState) -> felt252; +fn do_with_world_not_named_world(self: T, another_world: @IWorldDispatcher) -> felt252; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IFaultyTraitDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IFaultyTraitDispatcherImpl of IFaultyTraitDispatcherTrait { +fn do_with_self_and_world_inv(self: IFaultyTraitDispatcher, self: @ContractState) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::<@ContractState>::serialize(@self, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_with_self_and_world_inv"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_with_world_not_named_world(self: IFaultyTraitDispatcher, another_world: @IWorldDispatcher) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::<@IWorldDispatcher>::serialize(@another_world, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_with_world_not_named_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IFaultyTraitLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IFaultyTraitLibraryDispatcherImpl of IFaultyTraitDispatcherTrait { +fn do_with_self_and_world_inv(self: IFaultyTraitLibraryDispatcher, self: @ContractState) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::<@ContractState>::serialize(@self, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_with_self_and_world_inv"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } +fn do_with_world_not_named_world(self: IFaultyTraitLibraryDispatcher, another_world: @IWorldDispatcher) -> felt252 { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::<@IWorldDispatcher>::serialize(@another_world, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_with_world_not_named_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + } + +} + + pub trait IFaultyTraitSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] +fn do_with_self_and_world_inv(self: T, self: @ContractState) -> starknet::SyscallResult; + #[unstable(feature: "safe_dispatcher")] +fn do_with_world_not_named_world(self: T, another_world: @IWorldDispatcher) -> starknet::SyscallResult; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IFaultyTraitSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl IFaultyTraitSafeLibraryDispatcherImpl of IFaultyTraitSafeDispatcherTrait { +fn do_with_self_and_world_inv(self: IFaultyTraitSafeLibraryDispatcher, self: @ContractState) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::<@ContractState>::serialize(@self, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_with_self_and_world_inv"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_with_world_not_named_world(self: IFaultyTraitSafeLibraryDispatcher, another_world: @IWorldDispatcher) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::<@IWorldDispatcher>::serialize(@another_world, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("do_with_world_not_named_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] + pub struct IFaultyTraitSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl IFaultyTraitSafeDispatcherImpl of IFaultyTraitSafeDispatcherTrait { +fn do_with_self_and_world_inv(self: IFaultyTraitSafeDispatcher, self: @ContractState) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::<@ContractState>::serialize(@self, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_with_self_and_world_inv"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } +fn do_with_world_not_named_world(self: IFaultyTraitSafeDispatcher, another_world: @IWorldDispatcher) -> starknet::SyscallResult { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::<@IWorldDispatcher>::serialize(@another_world, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("do_with_world_not_named_world"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok( + core::option::OptionTrait::expect( + core::serde::Serde::::deserialize(ref __dispatcher_return_data__), + 'Returned data too short', + ) + ) + } + +} +impl IEmptyTraitDispatcherCopy of core::traits::Copy::; +impl IEmptyTraitDispatcherDrop of core::traits::Drop::; +impl IEmptyTraitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IEmptyTraitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IEmptyTraitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIEmptyTraitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IEmptyTraitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IEmptyTraitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IEmptyTraitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IEmptyTraitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IEmptyTraitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IEmptyTraitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IEmptyTraitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IEmptyTraitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IEmptyTraitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIEmptyTraitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIEmptyTraitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIEmptyTraitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIEmptyTraitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIEmptyTraitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IEmptyTraitLibraryDispatcherCopy of core::traits::Copy::; +impl IEmptyTraitLibraryDispatcherDrop of core::traits::Drop::; +impl IEmptyTraitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IEmptyTraitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IEmptyTraitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIEmptyTraitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IEmptyTraitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IEmptyTraitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IEmptyTraitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IEmptyTraitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IEmptyTraitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IEmptyTraitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IEmptyTraitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IEmptyTraitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IEmptyTraitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIEmptyTraitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIEmptyTraitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIEmptyTraitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIEmptyTraitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIEmptyTraitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IEmptyTraitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IEmptyTraitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IEmptyTraitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IEmptyTraitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IEmptyTraitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIEmptyTraitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IEmptyTraitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IEmptyTraitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IEmptyTraitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IEmptyTraitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IEmptyTraitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IEmptyTraitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IEmptyTraitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IEmptyTraitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IEmptyTraitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIEmptyTraitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIEmptyTraitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIEmptyTraitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIEmptyTraitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIEmptyTraitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IEmptyTraitSafeDispatcherCopy of core::traits::Copy::; +impl IEmptyTraitSafeDispatcherDrop of core::traits::Drop::; +impl IEmptyTraitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IEmptyTraitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IEmptyTraitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIEmptyTraitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IEmptyTraitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IEmptyTraitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IEmptyTraitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IEmptyTraitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IEmptyTraitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IEmptyTraitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IEmptyTraitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IEmptyTraitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IEmptyTraitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIEmptyTraitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIEmptyTraitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIEmptyTraitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIEmptyTraitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIEmptyTraitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IFaultyTraitDispatcherCopy of core::traits::Copy::; +impl IFaultyTraitDispatcherDrop of core::traits::Drop::; +impl IFaultyTraitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IFaultyTraitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IFaultyTraitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIFaultyTraitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IFaultyTraitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IFaultyTraitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IFaultyTraitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IFaultyTraitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IFaultyTraitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IFaultyTraitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IFaultyTraitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IFaultyTraitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IFaultyTraitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIFaultyTraitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIFaultyTraitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIFaultyTraitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIFaultyTraitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIFaultyTraitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IFaultyTraitLibraryDispatcherCopy of core::traits::Copy::; +impl IFaultyTraitLibraryDispatcherDrop of core::traits::Drop::; +impl IFaultyTraitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IFaultyTraitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IFaultyTraitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIFaultyTraitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IFaultyTraitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IFaultyTraitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IFaultyTraitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IFaultyTraitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IFaultyTraitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IFaultyTraitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IFaultyTraitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IFaultyTraitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IFaultyTraitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIFaultyTraitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIFaultyTraitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIFaultyTraitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIFaultyTraitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIFaultyTraitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IFaultyTraitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IFaultyTraitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IFaultyTraitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IFaultyTraitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IFaultyTraitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIFaultyTraitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IFaultyTraitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IFaultyTraitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IFaultyTraitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IFaultyTraitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IFaultyTraitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IFaultyTraitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IFaultyTraitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IFaultyTraitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IFaultyTraitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIFaultyTraitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIFaultyTraitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIFaultyTraitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIFaultyTraitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIFaultyTraitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IFaultyTraitSafeDispatcherCopy of core::traits::Copy::; +impl IFaultyTraitSafeDispatcherDrop of core::traits::Drop::; +impl IFaultyTraitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IFaultyTraitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IFaultyTraitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIFaultyTraitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IFaultyTraitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IFaultyTraitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IFaultyTraitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IFaultyTraitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IFaultyTraitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IFaultyTraitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IFaultyTraitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IFaultyTraitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IFaultyTraitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIFaultyTraitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIFaultyTraitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIFaultyTraitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIFaultyTraitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIFaultyTraitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl INominalTraitDispatcherCopy of core::traits::Copy::; +impl INominalTraitDispatcherDrop of core::traits::Drop::; +impl INominalTraitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @INominalTraitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(INominalTraitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreINominalTraitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + INominalTraitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: INominalTraitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + INominalTraitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: INominalTraitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct INominalTraitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl INominalTraitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = INominalTraitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> INominalTraitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + INominalTraitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableINominalTraitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableINominalTraitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableINominalTraitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableINominalTraitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableINominalTraitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl INominalTraitLibraryDispatcherCopy of core::traits::Copy::; +impl INominalTraitLibraryDispatcherDrop of core::traits::Drop::; +impl INominalTraitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @INominalTraitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(INominalTraitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreINominalTraitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + INominalTraitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: INominalTraitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + INominalTraitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: INominalTraitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct INominalTraitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl INominalTraitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = INominalTraitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> INominalTraitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + INominalTraitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableINominalTraitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableINominalTraitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableINominalTraitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableINominalTraitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableINominalTraitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl INominalTraitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl INominalTraitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl INominalTraitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @INominalTraitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(INominalTraitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreINominalTraitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + INominalTraitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: INominalTraitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + INominalTraitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: INominalTraitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct INominalTraitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl INominalTraitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = INominalTraitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> INominalTraitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + INominalTraitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableINominalTraitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableINominalTraitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableINominalTraitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableINominalTraitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableINominalTraitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl INominalTraitSafeDispatcherCopy of core::traits::Copy::; +impl INominalTraitSafeDispatcherDrop of core::traits::Drop::; +impl INominalTraitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @INominalTraitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(INominalTraitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreINominalTraitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + INominalTraitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: INominalTraitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + INominalTraitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: INominalTraitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct INominalTraitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl INominalTraitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = INominalTraitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> INominalTraitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + INominalTraitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableINominalTraitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableINominalTraitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableINominalTraitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableINominalTraitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableINominalTraitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IFaultyTraitDispatcherCopy of core::traits::Copy::; +impl IFaultyTraitDispatcherDrop of core::traits::Drop::; +impl IFaultyTraitDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IFaultyTraitDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IFaultyTraitDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIFaultyTraitDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IFaultyTraitDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IFaultyTraitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IFaultyTraitDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IFaultyTraitDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IFaultyTraitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IFaultyTraitDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IFaultyTraitDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IFaultyTraitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IFaultyTraitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIFaultyTraitDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIFaultyTraitDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIFaultyTraitDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIFaultyTraitDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIFaultyTraitDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +impl IFaultyTraitLibraryDispatcherCopy of core::traits::Copy::; +impl IFaultyTraitLibraryDispatcherDrop of core::traits::Drop::; +impl IFaultyTraitLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IFaultyTraitLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IFaultyTraitLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIFaultyTraitLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IFaultyTraitLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IFaultyTraitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IFaultyTraitLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IFaultyTraitLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IFaultyTraitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IFaultyTraitLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IFaultyTraitLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IFaultyTraitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IFaultyTraitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIFaultyTraitLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIFaultyTraitLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIFaultyTraitLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIFaultyTraitLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIFaultyTraitLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IFaultyTraitSafeLibraryDispatcherCopy of core::traits::Copy::; +impl IFaultyTraitSafeLibraryDispatcherDrop of core::traits::Drop::; +impl IFaultyTraitSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IFaultyTraitSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IFaultyTraitSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIFaultyTraitSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IFaultyTraitSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IFaultyTraitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IFaultyTraitSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IFaultyTraitSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IFaultyTraitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer, +} +impl IFaultyTraitSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IFaultyTraitSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IFaultyTraitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IFaultyTraitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIFaultyTraitSafeLibraryDispatcherSubPointers { + class_hash: starknet::storage::StoragePointer>, +} +impl MutableIFaultyTraitSafeLibraryDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIFaultyTraitSafeLibraryDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIFaultyTraitSafeLibraryDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let class_hash_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIFaultyTraitSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +impl IFaultyTraitSafeDispatcherCopy of core::traits::Copy::; +impl IFaultyTraitSafeDispatcherDrop of core::traits::Drop::; +impl IFaultyTraitSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @IFaultyTraitSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(IFaultyTraitSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreIFaultyTraitSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + IFaultyTraitSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: IFaultyTraitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + IFaultyTraitSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: IFaultyTraitSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +struct IFaultyTraitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer, +} +impl IFaultyTraitSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { +type SubPointersType = IFaultyTraitSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> IFaultyTraitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + IFaultyTraitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +struct MutableIFaultyTraitSafeDispatcherSubPointers { + contract_address: starknet::storage::StoragePointer>, +} +impl MutableIFaultyTraitSafeDispatcherSubPointersImpl of starknet::storage::MutableSubPointers { +type SubPointersType = MutableIFaultyTraitSafeDispatcherSubPointers; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> MutableIFaultyTraitSafeDispatcherSubPointers { + let base_address = self.address; + let mut current_offset = self.offset; + let contract_address_value = starknet::storage::StoragePointer { + address: base_address, + offset: current_offset, + }; + MutableIFaultyTraitSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } } +impl IEmptyTraitDispatcherSubPointersDrop of core::traits::Drop::; +impl IEmptyTraitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIEmptyTraitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIEmptyTraitDispatcherSubPointersCopy of core::traits::Copy::; +impl IEmptyTraitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IEmptyTraitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIEmptyTraitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIEmptyTraitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IEmptyTraitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IEmptyTraitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIEmptyTraitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIEmptyTraitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IEmptyTraitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IEmptyTraitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIEmptyTraitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIEmptyTraitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl IFaultyTraitDispatcherSubPointersDrop of core::traits::Drop::; +impl IFaultyTraitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIFaultyTraitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIFaultyTraitDispatcherSubPointersCopy of core::traits::Copy::; +impl IFaultyTraitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IFaultyTraitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIFaultyTraitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIFaultyTraitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IFaultyTraitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IFaultyTraitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIFaultyTraitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIFaultyTraitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IFaultyTraitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IFaultyTraitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIFaultyTraitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIFaultyTraitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl INominalTraitDispatcherSubPointersDrop of core::traits::Drop::; +impl INominalTraitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableINominalTraitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableINominalTraitDispatcherSubPointersCopy of core::traits::Copy::; +impl INominalTraitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl INominalTraitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableINominalTraitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableINominalTraitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl INominalTraitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl INominalTraitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableINominalTraitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableINominalTraitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl INominalTraitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl INominalTraitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableINominalTraitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableINominalTraitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl IFaultyTraitDispatcherSubPointersDrop of core::traits::Drop::; +impl IFaultyTraitDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIFaultyTraitDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIFaultyTraitDispatcherSubPointersCopy of core::traits::Copy::; +impl IFaultyTraitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IFaultyTraitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIFaultyTraitLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIFaultyTraitLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IFaultyTraitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl IFaultyTraitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIFaultyTraitSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIFaultyTraitSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl IFaultyTraitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl IFaultyTraitSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl MutableIFaultyTraitSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl MutableIFaultyTraitSafeDispatcherSubPointersCopy of core::traits::Copy::; diff --git a/crates/dojo-lang/src/semantics/test_data/get b/crates/dojo-lang/src/semantics/test_data/get index 13e45b47a7..e64ef5f6b4 100644 --- a/crates/dojo-lang/src/semantics/test_data/get +++ b/crates/dojo-lang/src/semantics/test_data/get @@ -231,7 +231,7 @@ Block( ) //! > semantic_diagnostics -error: Trait has no implementation in context: dojo::model::Model::. +error: Trait has no implementation in context: dojo::model::model::Model::. --> lib.cairo:12:1 get!(world, key, (Health)) ^************************^ diff --git a/crates/dojo-lang/src/semantics/test_data/set b/crates/dojo-lang/src/semantics/test_data/set index 03cd1da1b9..d07054bc86 100644 --- a/crates/dojo-lang/src/semantics/test_data/set +++ b/crates/dojo-lang/src/semantics/test_data/set @@ -63,7 +63,8 @@ test_semantics //! > setup_code use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; -#[derive(Copy, Drop, Serde, Model)] +#[derive(Copy, Drop, Serde)] +#[dojo::model] struct Health { #[key] id: u32, @@ -119,7 +120,7 @@ Block( StatementExpr { expr: FunctionCall( ExprFunctionCall { - function: ?6::set, + function: test::HealthModelImpl::set, args: [ Value( Snapshot( @@ -150,17 +151,7 @@ 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 + --> lib.cairo:10:22 fn test_func() { let key: felt252 = 0xb0b; ^*^ - -error: Trait has no implementation in context: dojo::model::Model::. - --> lib.cairo:11:1 -set!(world, (Health{id: 0xb0b, health: 79})) -^******************************************^ diff --git a/crates/dojo-world/abigen/src/main.rs b/crates/dojo-world/abigen/src/main.rs index 3f26903f4a..da004fad1c 100644 --- a/crates/dojo-world/abigen/src/main.rs +++ b/crates/dojo-world/abigen/src/main.rs @@ -83,7 +83,7 @@ fn get_bindings_file_content(contract_name: &str, contract_class: ContractClass) format!( "// AUTOGENERATED FILE, DO NOT EDIT.\n// To generate the bindings, please run `cargo run \ --bin dojo-world-abigen` instead.\nuse cainome::rs::abigen;\n\nabigen!(\n {},\n \ - r#\"{}\"#,\ntype_aliases {{\ndojo::config::component::Config::Event as \ + r#\"{}\"#,\ntype_aliases {{\ndojo::world::config::Config::Event as \ DojoConfigEvent;\n}}\n);", contract_name, serde_json::to_string_pretty(&contract_class.abi).unwrap() @@ -105,7 +105,7 @@ fn compile_dojo_core() { r#" [package] cairo-version = "2.7.0-rc.3" -edition = "2023_11" +edition = "2024_07" name = "dojo" version = "0.7.3" diff --git a/crates/dojo-world/src/contracts/abi/model.rs b/crates/dojo-world/src/contracts/abi/model.rs index 0c82d8dd60..f4d2153b92 100644 --- a/crates/dojo-world/src/contracts/abi/model.rs +++ b/crates/dojo-world/src/contracts/abi/model.rs @@ -64,7 +64,7 @@ abigen!( }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -72,33 +72,33 @@ abigen!( }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -106,15 +106,15 @@ abigen!( }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -122,7 +122,7 @@ abigen!( }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -132,7 +132,7 @@ abigen!( "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -149,7 +149,7 @@ abigen!( }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -161,23 +161,23 @@ abigen!( }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -189,23 +189,23 @@ abigen!( }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -217,23 +217,23 @@ abigen!( }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -241,19 +241,19 @@ abigen!( }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -267,7 +267,7 @@ abigen!( "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -292,7 +292,7 @@ abigen!( }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -310,7 +310,7 @@ abigen!( "inputs": [ { "name": "model", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "outputs": [], @@ -318,12 +318,12 @@ abigen!( }, { "type": "event", - "name": "dojo::resource_metadata::resource_metadata::Event", + "name": "dojo::model::metadata::resource_metadata::Event", "kind": "enum", "variants": [] } ]"#, type_aliases { -dojo::config::component::Config::Event as DojoConfigEvent; +dojo::world::config::Config::Event as DojoConfigEvent; } ); diff --git a/crates/dojo-world/src/contracts/abi/world.rs b/crates/dojo-world/src/contracts/abi/world.rs index f4a86c7a37..a6de280321 100644 --- a/crates/dojo-world/src/contracts/abi/world.rs +++ b/crates/dojo-world/src/contracts/abi/world.rs @@ -8,7 +8,7 @@ abigen!( { "type": "impl", "name": "World", - "interface_name": "dojo::world::IWorld" + "interface_name": "dojo::world::world_contract::IWorld" }, { "type": "struct", @@ -30,7 +30,7 @@ abigen!( }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -54,7 +54,7 @@ abigen!( }, { "type": "enum", - "name": "dojo::world::ModelIndex", + "name": "dojo::model::model::ModelIndex", "variants": [ { "name": "Keys", @@ -82,7 +82,7 @@ abigen!( }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -90,33 +90,33 @@ abigen!( }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -124,15 +124,15 @@ abigen!( }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -140,7 +140,7 @@ abigen!( }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -160,7 +160,7 @@ abigen!( }, { "type": "interface", - "name": "dojo::world::IWorld", + "name": "dojo::world::world_contract::IWorld", "items": [ { "type": "function", @@ -173,7 +173,7 @@ abigen!( ], "outputs": [ { - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "state_mutability": "view" @@ -184,7 +184,7 @@ abigen!( "inputs": [ { "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "outputs": [], @@ -327,11 +327,11 @@ abigen!( }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [ @@ -351,7 +351,7 @@ abigen!( }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "values", @@ -359,7 +359,7 @@ abigen!( }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -375,11 +375,11 @@ abigen!( }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -585,11 +585,11 @@ abigen!( { "type": "impl", "name": "UpgradeableWorld", - "interface_name": "dojo::world::IUpgradeableWorld" + "interface_name": "dojo::world::world_contract::IUpgradeableWorld" }, { "type": "interface", - "name": "dojo::world::IUpgradeableWorld", + "name": "dojo::world::world_contract::IUpgradeableWorld", "items": [ { "type": "function", @@ -608,11 +608,11 @@ abigen!( { "type": "impl", "name": "UpgradeableState", - "interface_name": "dojo::interfaces::IUpgradeableState" + "interface_name": "dojo::world::update::IUpgradeableState" }, { "type": "struct", - "name": "dojo::interfaces::StorageUpdate", + "name": "dojo::world::update::StorageUpdate", "members": [ { "name": "key", @@ -626,17 +626,17 @@ abigen!( }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::interfaces::ProgramOutput", + "name": "dojo::world::update::ProgramOutput", "members": [ { "name": "prev_state_root", @@ -674,7 +674,7 @@ abigen!( }, { "type": "interface", - "name": "dojo::interfaces::IUpgradeableState", + "name": "dojo::world::update::IUpgradeableState", "items": [ { "type": "function", @@ -682,11 +682,11 @@ abigen!( "inputs": [ { "name": "new_state", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "program_output", - "type": "dojo::interfaces::ProgramOutput" + "type": "dojo::world::update::ProgramOutput" }, { "name": "program_hash", @@ -701,11 +701,11 @@ abigen!( { "type": "impl", "name": "ConfigImpl", - "interface_name": "dojo::config::interface::IConfig" + "interface_name": "dojo::world::config::IConfig" }, { "type": "interface", - "name": "dojo::config::interface::IConfig", + "name": "dojo::world::config::IConfig", "items": [ { "type": "function", @@ -790,7 +790,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::WorldSpawned", + "name": "dojo::world::world_contract::world::WorldSpawned", "kind": "struct", "members": [ { @@ -807,7 +807,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::ContractDeployed", + "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ { @@ -839,7 +839,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::ContractUpgraded", + "name": "dojo::world::world_contract::world::ContractUpgraded", "kind": "struct", "members": [ { @@ -856,7 +856,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::WorldUpgraded", + "name": "dojo::world::world_contract::world::WorldUpgraded", "kind": "struct", "members": [ { @@ -868,7 +868,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::MetadataUpdate", + "name": "dojo::world::world_contract::world::MetadataUpdate", "kind": "struct", "members": [ { @@ -885,7 +885,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::NamespaceRegistered", + "name": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "struct", "members": [ { @@ -902,7 +902,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::ModelRegistered", + "name": "dojo::world::world_contract::world::ModelRegistered", "kind": "struct", "members": [ { @@ -939,7 +939,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::StoreSetRecord", + "name": "dojo::world::world_contract::world::StoreSetRecord", "kind": "struct", "members": [ { @@ -961,7 +961,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::StoreUpdateRecord", + "name": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "struct", "members": [ { @@ -983,7 +983,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::StoreDelRecord", + "name": "dojo::world::world_contract::world::StoreDelRecord", "kind": "struct", "members": [ { @@ -1000,7 +1000,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::WriterUpdated", + "name": "dojo::world::world_contract::world::WriterUpdated", "kind": "struct", "members": [ { @@ -1022,7 +1022,7 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::OwnerUpdated", + "name": "dojo::world::world_contract::world::OwnerUpdated", "kind": "struct", "members": [ { @@ -1044,7 +1044,7 @@ abigen!( }, { "type": "event", - "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "name": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "struct", "members": [ { @@ -1056,7 +1056,7 @@ abigen!( }, { "type": "event", - "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "name": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -1068,7 +1068,7 @@ abigen!( }, { "type": "event", - "name": "dojo::config::component::Config::FactsRegistryUpdate", + "name": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "struct", "members": [ { @@ -1080,29 +1080,29 @@ abigen!( }, { "type": "event", - "name": "dojo::config::component::Config::Event", + "name": "dojo::world::config::Config::Event", "kind": "enum", "variants": [ { "name": "DifferProgramHashUpdate", - "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "type": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "nested" }, { "name": "MergerProgramHashUpdate", - "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "type": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "nested" }, { "name": "FactsRegistryUpdate", - "type": "dojo::config::component::Config::FactsRegistryUpdate", + "type": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::world::world::StateUpdated", + "name": "dojo::world::world_contract::world::StateUpdated", "kind": "struct", "members": [ { @@ -1114,83 +1114,83 @@ abigen!( }, { "type": "event", - "name": "dojo::world::world::Event", + "name": "dojo::world::world_contract::world::Event", "kind": "enum", "variants": [ { "name": "WorldSpawned", - "type": "dojo::world::world::WorldSpawned", + "type": "dojo::world::world_contract::world::WorldSpawned", "kind": "nested" }, { "name": "ContractDeployed", - "type": "dojo::world::world::ContractDeployed", + "type": "dojo::world::world_contract::world::ContractDeployed", "kind": "nested" }, { "name": "ContractUpgraded", - "type": "dojo::world::world::ContractUpgraded", + "type": "dojo::world::world_contract::world::ContractUpgraded", "kind": "nested" }, { "name": "WorldUpgraded", - "type": "dojo::world::world::WorldUpgraded", + "type": "dojo::world::world_contract::world::WorldUpgraded", "kind": "nested" }, { "name": "MetadataUpdate", - "type": "dojo::world::world::MetadataUpdate", + "type": "dojo::world::world_contract::world::MetadataUpdate", "kind": "nested" }, { "name": "NamespaceRegistered", - "type": "dojo::world::world::NamespaceRegistered", + "type": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "nested" }, { "name": "ModelRegistered", - "type": "dojo::world::world::ModelRegistered", + "type": "dojo::world::world_contract::world::ModelRegistered", "kind": "nested" }, { "name": "StoreSetRecord", - "type": "dojo::world::world::StoreSetRecord", + "type": "dojo::world::world_contract::world::StoreSetRecord", "kind": "nested" }, { "name": "StoreUpdateRecord", - "type": "dojo::world::world::StoreUpdateRecord", + "type": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "nested" }, { "name": "StoreDelRecord", - "type": "dojo::world::world::StoreDelRecord", + "type": "dojo::world::world_contract::world::StoreDelRecord", "kind": "nested" }, { "name": "WriterUpdated", - "type": "dojo::world::world::WriterUpdated", + "type": "dojo::world::world_contract::world::WriterUpdated", "kind": "nested" }, { "name": "OwnerUpdated", - "type": "dojo::world::world::OwnerUpdated", + "type": "dojo::world::world_contract::world::OwnerUpdated", "kind": "nested" }, { "name": "ConfigEvent", - "type": "dojo::config::component::Config::Event", + "type": "dojo::world::config::Config::Event", "kind": "nested" }, { "name": "StateUpdated", - "type": "dojo::world::world::StateUpdated", + "type": "dojo::world::world_contract::world::StateUpdated", "kind": "nested" } ] } ]"#, type_aliases { -dojo::config::component::Config::Event as DojoConfigEvent; +dojo::world::config::Config::Event as DojoConfigEvent; } ); diff --git a/crates/dojo-world/src/contracts/model.rs b/crates/dojo-world/src/contracts/model.rs index 1026a2c19f..d6b7d61d48 100644 --- a/crates/dojo-world/src/contracts/model.rs +++ b/crates/dojo-world/src/contracts/model.rs @@ -13,7 +13,7 @@ use starknet::core::utils::{ }; use starknet::providers::{Provider, ProviderError}; -use super::abi::world::Layout; +use super::abi::world::{Layout, ModelIndex}; use super::naming; use crate::contracts::WorldContractReader; @@ -25,9 +25,6 @@ pub mod abigen { pub mod model { pub use crate::contracts::abi::model::*; } - pub mod world { - pub use crate::contracts::abi::world::*; - } } #[derive(Debug, thiserror::Error)] @@ -121,7 +118,7 @@ where } pub async fn entity_storage(&self, keys: &[Felt]) -> Result, ModelError> { - // As the dojo::database::introspect::Layout type has been pasted + // As the dojo::model::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. // Here is a trick reading the model layout as raw FieldElement @@ -131,7 +128,7 @@ where Ok(self .world_reader - .entity(&self.selector(), &abigen::world::ModelIndex::Keys(keys.to_vec()), &layout) + .entity(&self.selector(), &ModelIndex::Keys(keys.to_vec()), &layout) .call() .await?) } diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index 24825c59ca..cdaa500878 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -77,7 +77,7 @@ async fn test_model() { assert_eq!( position.class_hash(), - felt!("0x2b530adc12f28cdb03e7c9c0b69556b18c4775faedf826879aee9f6113c8c66") + felt!("0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea") ); let moves = world.model_reader("dojo_examples", "Moves").await.unwrap(); diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index 4d5a052941..4200fd2e14 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -37,8 +37,8 @@ pub use types::{ 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 WORLD_QUALIFIED_PATH: &str = "dojo::world::world_contract::world"; +pub const BASE_QUALIFIED_PATH: &str = "dojo::contract::base_contract::base"; pub const MANIFESTS_DIR: &str = "manifests"; pub const DEPLOYMENT_DIR: &str = "deployment"; diff --git a/crates/sozo/ops/src/tests/model.rs b/crates/sozo/ops/src/tests/model.rs index ce01535979..3cb75b8f2b 100644 --- a/crates/sozo/ops/src/tests/model.rs +++ b/crates/sozo/ops/src/tests/model.rs @@ -25,7 +25,7 @@ async fn test_model_ops() { ) .await .unwrap(), - Felt::from_hex("0x47f77d27573e12c1441dd65b1a88f4432c1c4ec446241830ff4c33f3f58a44e") + Felt::from_hex("0x61fa996f7cf8412bb5aca7d4bd4fd9eca806a92e5007e87d23f638b6774ed40") .unwrap() ); @@ -37,7 +37,7 @@ async fn test_model_ops() { ) .await .unwrap(), - Felt::from_hex("0x413aab3045f0a59103449d05974e30aaf91985113b0ae5d97a43b1141c3e1cb") + Felt::from_hex("0x6dd9f573496d64b1c026c68cbfe31a7724c7bcd4a142099666e8e22b82e0688") .unwrap() ); diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index a677d52c7a..edb8f3c6fe 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -11,7 +11,7 @@ dependencies = [ [[package]] name = "dojo_plugin" version = "0.7.3" -source = "git+https://github.com/dojoengine/dojo?branch=bump-cairo-2.7#17bc842f2f87b6ac0472d196efc11f01a5e55add" +source = "git+https://github.com/dojoengine/dojo?rev=d90b52b#d90b52b89749ac8af82f352dc08aa0b1378cfae6" [[package]] name = "types_test" diff --git a/crates/torii/types-test/Scarb.toml b/crates/torii/types-test/Scarb.toml index 46b73d435d..3c0e2d505f 100644 --- a/crates/torii/types-test/Scarb.toml +++ b/crates/torii/types-test/Scarb.toml @@ -1,6 +1,6 @@ [package] cairo-version = "=2.7.0-rc.3" -edition = "2023_11" +edition = "2024_07" name = "types_test" version = "0.7.3" diff --git a/crates/torii/types-test/src/contracts.cairo b/crates/torii/types-test/src/contracts.cairo index efb6271343..6147526b07 100644 --- a/crates/torii/types-test/src/contracts.cairo +++ b/crates/torii/types-test/src/contracts.cairo @@ -10,7 +10,7 @@ trait IRecords { mod records { use starknet::{ContractAddress, get_caller_address}; use types_test::models::{ - Record, RecordTrait, RecordSibling, RecordSiblingTrait, Subrecord, SubrecordTrait, Nested, + Record, RecordStore, RecordSibling, RecordSiblingStore, Subrecord, SubrecordStore, Nested, NestedMore, NestedMost, Depth }; use types_test::{seed, random}; diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index ca338c7df5..61945087e5 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -4,7 +4,7 @@ name = "dojo_examples" version = "0.7.3" # Use the prelude with the less imports as possible # from corelib. -edition = "2023_11" +edition = "2024_07" [cairo] sierra-replace-ids = true @@ -43,7 +43,7 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x5ffa124a5076e590a23e9d393ebe4fc7c66989c2cd228a46f38a9e2d48305a7" +world_address = "0x64525f120f0c0bfaa610e38fad3ace40ff8c696e0c498697d73e0f58fd5ad1" [profile.release.tool.dojo] # for more info on how `merge-strategy` works see: 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 7c75c59707..3d21bef6a6 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -356,11 +356,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -378,7 +378,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -390,12 +390,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -407,7 +407,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] diff --git a/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-dungeon-6620e0e6.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-dungeon-6620e0e6.json index b48fc407a5..91fe2a95d0 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-dungeon-6620e0e6.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-dungeon-6620e0e6.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -165,11 +165,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -187,7 +187,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -199,12 +199,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -216,7 +216,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] 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 776977acd1..278cbb1cc0 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -147,11 +147,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -169,7 +169,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -181,12 +181,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -198,7 +198,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] 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 f9e4b7448b..86d2a176ff 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -160,11 +160,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -182,7 +182,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -194,12 +194,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -211,7 +211,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] diff --git a/examples/spawn-and-move/manifests/dev/base/abis/dojo-base.json b/examples/spawn-and-move/manifests/dev/base/abis/dojo-base.json index ee9ceaac66..4800464226 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/dojo-base.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/dojo-base.json @@ -2,11 +2,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -16,7 +16,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -24,7 +24,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -34,11 +34,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -61,7 +61,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -73,24 +73,24 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::base::base::Event", + "name": "dojo::contract::base_contract::base::Event", "kind": "enum", "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "flat" } ] diff --git a/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json b/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json index fe02b53f14..5620aa6fb5 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "World", - "interface_name": "dojo::world::IWorld" + "interface_name": "dojo::world::world_contract::IWorld" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -48,7 +48,7 @@ }, { "type": "enum", - "name": "dojo::world::ModelIndex", + "name": "dojo::model::model::ModelIndex", "variants": [ { "name": "Keys", @@ -76,7 +76,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -84,33 +84,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -118,15 +118,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -134,7 +134,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -154,7 +154,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorld", + "name": "dojo::world::world_contract::IWorld", "items": [ { "type": "function", @@ -167,7 +167,7 @@ ], "outputs": [ { - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "state_mutability": "view" @@ -178,7 +178,7 @@ "inputs": [ { "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "outputs": [], @@ -321,11 +321,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [ @@ -345,7 +345,7 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "values", @@ -353,7 +353,7 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -369,11 +369,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -579,11 +579,11 @@ { "type": "impl", "name": "UpgradeableWorld", - "interface_name": "dojo::world::IUpgradeableWorld" + "interface_name": "dojo::world::world_contract::IUpgradeableWorld" }, { "type": "interface", - "name": "dojo::world::IUpgradeableWorld", + "name": "dojo::world::world_contract::IUpgradeableWorld", "items": [ { "type": "function", @@ -602,11 +602,11 @@ { "type": "impl", "name": "UpgradeableState", - "interface_name": "dojo::interfaces::IUpgradeableState" + "interface_name": "dojo::world::update::IUpgradeableState" }, { "type": "struct", - "name": "dojo::interfaces::StorageUpdate", + "name": "dojo::world::update::StorageUpdate", "members": [ { "name": "key", @@ -620,17 +620,17 @@ }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::interfaces::ProgramOutput", + "name": "dojo::world::update::ProgramOutput", "members": [ { "name": "prev_state_root", @@ -668,7 +668,7 @@ }, { "type": "interface", - "name": "dojo::interfaces::IUpgradeableState", + "name": "dojo::world::update::IUpgradeableState", "items": [ { "type": "function", @@ -676,11 +676,11 @@ "inputs": [ { "name": "new_state", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "program_output", - "type": "dojo::interfaces::ProgramOutput" + "type": "dojo::world::update::ProgramOutput" }, { "name": "program_hash", @@ -695,11 +695,11 @@ { "type": "impl", "name": "ConfigImpl", - "interface_name": "dojo::config::interface::IConfig" + "interface_name": "dojo::world::config::IConfig" }, { "type": "interface", - "name": "dojo::config::interface::IConfig", + "name": "dojo::world::config::IConfig", "items": [ { "type": "function", @@ -784,7 +784,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldSpawned", + "name": "dojo::world::world_contract::world::WorldSpawned", "kind": "struct", "members": [ { @@ -801,7 +801,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractDeployed", + "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ { @@ -833,7 +833,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractUpgraded", + "name": "dojo::world::world_contract::world::ContractUpgraded", "kind": "struct", "members": [ { @@ -850,7 +850,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldUpgraded", + "name": "dojo::world::world_contract::world::WorldUpgraded", "kind": "struct", "members": [ { @@ -862,7 +862,7 @@ }, { "type": "event", - "name": "dojo::world::world::MetadataUpdate", + "name": "dojo::world::world_contract::world::MetadataUpdate", "kind": "struct", "members": [ { @@ -879,7 +879,7 @@ }, { "type": "event", - "name": "dojo::world::world::NamespaceRegistered", + "name": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "struct", "members": [ { @@ -896,7 +896,7 @@ }, { "type": "event", - "name": "dojo::world::world::ModelRegistered", + "name": "dojo::world::world_contract::world::ModelRegistered", "kind": "struct", "members": [ { @@ -933,7 +933,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreSetRecord", + "name": "dojo::world::world_contract::world::StoreSetRecord", "kind": "struct", "members": [ { @@ -955,7 +955,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreUpdateRecord", + "name": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "struct", "members": [ { @@ -977,7 +977,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreDelRecord", + "name": "dojo::world::world_contract::world::StoreDelRecord", "kind": "struct", "members": [ { @@ -994,7 +994,7 @@ }, { "type": "event", - "name": "dojo::world::world::WriterUpdated", + "name": "dojo::world::world_contract::world::WriterUpdated", "kind": "struct", "members": [ { @@ -1016,7 +1016,7 @@ }, { "type": "event", - "name": "dojo::world::world::OwnerUpdated", + "name": "dojo::world::world_contract::world::OwnerUpdated", "kind": "struct", "members": [ { @@ -1038,7 +1038,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "name": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "struct", "members": [ { @@ -1050,7 +1050,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "name": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -1062,7 +1062,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::FactsRegistryUpdate", + "name": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "struct", "members": [ { @@ -1074,29 +1074,29 @@ }, { "type": "event", - "name": "dojo::config::component::Config::Event", + "name": "dojo::world::config::Config::Event", "kind": "enum", "variants": [ { "name": "DifferProgramHashUpdate", - "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "type": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "nested" }, { "name": "MergerProgramHashUpdate", - "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "type": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "nested" }, { "name": "FactsRegistryUpdate", - "type": "dojo::config::component::Config::FactsRegistryUpdate", + "type": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::world::world::StateUpdated", + "name": "dojo::world::world_contract::world::StateUpdated", "kind": "struct", "members": [ { @@ -1108,77 +1108,77 @@ }, { "type": "event", - "name": "dojo::world::world::Event", + "name": "dojo::world::world_contract::world::Event", "kind": "enum", "variants": [ { "name": "WorldSpawned", - "type": "dojo::world::world::WorldSpawned", + "type": "dojo::world::world_contract::world::WorldSpawned", "kind": "nested" }, { "name": "ContractDeployed", - "type": "dojo::world::world::ContractDeployed", + "type": "dojo::world::world_contract::world::ContractDeployed", "kind": "nested" }, { "name": "ContractUpgraded", - "type": "dojo::world::world::ContractUpgraded", + "type": "dojo::world::world_contract::world::ContractUpgraded", "kind": "nested" }, { "name": "WorldUpgraded", - "type": "dojo::world::world::WorldUpgraded", + "type": "dojo::world::world_contract::world::WorldUpgraded", "kind": "nested" }, { "name": "MetadataUpdate", - "type": "dojo::world::world::MetadataUpdate", + "type": "dojo::world::world_contract::world::MetadataUpdate", "kind": "nested" }, { "name": "NamespaceRegistered", - "type": "dojo::world::world::NamespaceRegistered", + "type": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "nested" }, { "name": "ModelRegistered", - "type": "dojo::world::world::ModelRegistered", + "type": "dojo::world::world_contract::world::ModelRegistered", "kind": "nested" }, { "name": "StoreSetRecord", - "type": "dojo::world::world::StoreSetRecord", + "type": "dojo::world::world_contract::world::StoreSetRecord", "kind": "nested" }, { "name": "StoreUpdateRecord", - "type": "dojo::world::world::StoreUpdateRecord", + "type": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "nested" }, { "name": "StoreDelRecord", - "type": "dojo::world::world::StoreDelRecord", + "type": "dojo::world::world_contract::world::StoreDelRecord", "kind": "nested" }, { "name": "WriterUpdated", - "type": "dojo::world::world::WriterUpdated", + "type": "dojo::world::world_contract::world::WriterUpdated", "kind": "nested" }, { "name": "OwnerUpdated", - "type": "dojo::world::world::OwnerUpdated", + "type": "dojo::world::world_contract::world::OwnerUpdated", "kind": "nested" }, { "name": "ConfigEvent", - "type": "dojo::config::component::Config::Event", + "type": "dojo::world::config::Config::Event", "kind": "nested" }, { "name": "StateUpdated", - "type": "dojo::world::world::StateUpdated", + "type": "dojo::world::world_contract::world::StateUpdated", "kind": "nested" } ] 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 133257a2c1..4641430128 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 858f51d13c..5e416425e2 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 36b29c9dd7..79677cca37 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 adf73384b2..bfae2f690c 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 3e61365dee..d1fba9822d 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 8549c6cad8..6b373d240f 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 1f298063d0..203c340d15 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 031b2dcc9e..58aa520a88 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json index 4d4a41214e..aab11e5888 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json index 50d5861a0a..55eaa66dde 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 fd2ea9f285..ba8b171ff2 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 = "0x562dc5e2a07016ab56ac97e72e5ce62a46caed41bb28d5aefdc6d1aafd3575e" -original_class_hash = "0x562dc5e2a07016ab56ac97e72e5ce62a46caed41bb28d5aefdc6d1aafd3575e" +class_hash = "0x40a2b17006490ae06a027632f2d5ed3debe715db65ef41c6037599d0c48c303" +original_class_hash = "0x40a2b17006490ae06a027632f2d5ed3debe715db65ef41c6037599d0c48c303" 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-dungeon-6620e0e6.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-dungeon-6620e0e6.toml index 87331f3f21..ccccbd090d 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-dungeon-6620e0e6.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-dungeon-6620e0e6.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x11bb79f4255371bbd58715696ede661544e281ece752d783e52e73deb8948cf" -original_class_hash = "0x11bb79f4255371bbd58715696ede661544e281ece752d783e52e73deb8948cf" +class_hash = "0x45ad5a298db270a9c3ee439b7a7a008e3219b70937cfaa144589866442f3908" +original_class_hash = "0x45ad5a298db270a9c3ee439b7a7a008e3219b70937cfaa144589866442f3908" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-dungeon-6620e0e6.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 d08d8c605d..19a8d9ddcd 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 = "0xc25acec255f081e3845b29c598a9b6eecc79d16445e2dd0baa740c92055213" -original_class_hash = "0xc25acec255f081e3845b29c598a9b6eecc79d16445e2dd0baa740c92055213" +class_hash = "0x3daab1621bba5f43f0d84f8f68ee7a5dfa4d83f98f746e2e9dcd3a848233e35" +original_class_hash = "0x3daab1621bba5f43f0d84f8f68ee7a5dfa4d83f98f746e2e9dcd3a848233e35" 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 83bbda3d73..c69accac73 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 = "0x4990d14908bf4cee13d7cff8dde2ffd91772c8ba325b0f0f2af0bd3398e3634" -original_class_hash = "0x4990d14908bf4cee13d7cff8dde2ffd91772c8ba325b0f0f2af0bd3398e3634" +class_hash = "0x77f7f87e45a7295b9067e6438bb41009661a4a72be944d9f40976984a7b7d37" +original_class_hash = "0x77f7f87e45a7295b9067e6438bb41009661a4a72be944d9f40976984a7b7d37" 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 063a71b75a..44b3746b00 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 = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" -original_class_hash = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" +class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +original_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" 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 5df663d9cd..612934eb2e 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 = "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58" -original_class_hash = "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58" +class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" +original_class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" 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 e5876dcbd1..216cf40eba 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 = "0x6e69c6811fcc67953426e123cdd87530e7a27bb4613251fc6182aa9dde75411" -original_class_hash = "0x6e69c6811fcc67953426e123cdd87530e7a27bb4613251fc6182aa9dde75411" +class_hash = "0x8a7f15ef119eb0b44c6b7f30f312dc23619d781173dcfff0e55234bf4a67a3" +original_class_hash = "0x8a7f15ef119eb0b44c6b7f30f312dc23619d781173dcfff0e55234bf4a67a3" 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 588d5fc68a..1ca597fe5d 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 = "0x33728d68e7d0d807184b6cb065b608a5145fb4b964c1c0bf3c8a4b92695053e" -original_class_hash = "0x33728d68e7d0d807184b6cb065b608a5145fb4b964c1c0bf3c8a4b92695053e" +class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" +original_class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" 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 92b5304374..cd51863d86 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 = "0x4d9dfa45ceeb2fa6051d9cf4fb469ad0354becd3c9830595b941d6fd4eb2202" -original_class_hash = "0x4d9dfa45ceeb2fa6051d9cf4fb469ad0354becd3c9830595b941d6fd4eb2202" +class_hash = "0x1dfb7c80100d8045d0b37d01ee118e057aa04ff98198f43f1b43171acb0ad9e" +original_class_hash = "0x1dfb7c80100d8045d0b37d01ee118e057aa04ff98198f43f1b43171acb0ad9e" 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 a06d6ce493..b76b00a4d8 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 = "0x291252f382a059d3d1fa0c813160c93ccc05f9b5683fa63b8194fe8bed2fcba" -original_class_hash = "0x291252f382a059d3d1fa0c813160c93ccc05f9b5683fa63b8194fe8bed2fcba" +class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" +original_class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" 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 a436a2584a..9396b8ee6f 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 = "0x47f77d27573e12c1441dd65b1a88f4432c1c4ec446241830ff4c33f3f58a44e" -original_class_hash = "0x47f77d27573e12c1441dd65b1a88f4432c1c4ec446241830ff4c33f3f58a44e" +class_hash = "0x61fa996f7cf8412bb5aca7d4bd4fd9eca806a92e5007e87d23f638b6774ed40" +original_class_hash = "0x61fa996f7cf8412bb5aca7d4bd4fd9eca806a92e5007e87d23f638b6774ed40" 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 afa44f5268..04dd18b75c 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 = "0xc88609dbcf23f3610913a55744dd6a211703daa989dfd91e2672dd85c33b4e" -original_class_hash = "0xc88609dbcf23f3610913a55744dd6a211703daa989dfd91e2672dd85c33b4e" +class_hash = "0x5191a56dc5a83bb56969ddb5fcc70dc1ac4ad057d0a054cf555a0023b454923" +original_class_hash = "0x5191a56dc5a83bb56969ddb5fcc70dc1ac4ad057d0a054cf555a0023b454923" 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 fdc5e77543..18f79d32a8 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 = "0x2b530adc12f28cdb03e7c9c0b69556b18c4775faedf826879aee9f6113c8c66" -original_class_hash = "0x2b530adc12f28cdb03e7c9c0b69556b18c4775faedf826879aee9f6113c8c66" +class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" +original_class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" 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 497ccb92fd..b33d974ad9 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 = "0x794eb270cb490e228d2710c8a397cfb821461a2796acc6714eca8d8462d7f57" -original_class_hash = "0x794eb270cb490e228d2710c8a397cfb821461a2796acc6714eca8d8462d7f57" +class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" +original_class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" 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/base/models/dojo_examples_foes-RiverSkale-39535c12.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_foes-RiverSkale-39535c12.toml index 0aed2ff250..a9fc46d5a8 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_foes-RiverSkale-39535c12.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_foes-RiverSkale-39535c12.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x273dc20b425570101716086cc3b94073e1762b5aa802c369b9d953d59ebce49" -original_class_hash = "0x273dc20b425570101716086cc3b94073e1762b5aa802c369b9d953d59ebce49" +class_hash = "0x72898823e557f2f3a48026a97b6ec9fed750a4884788751c4c512c6dde0ff3c" +original_class_hash = "0x72898823e557f2f3a48026a97b6ec9fed750a4884788751c4c512c6dde0ff3c" abi = "manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json" tag = "dojo_examples_foes-RiverSkale" manifest_name = "dojo_examples_foes-RiverSkale-39535c12" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml index c32d92e8d6..b7545139ac 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x6bf10689b313619cf163192a65419764462e0be3cbafcfafa83df8763eda82e" -original_class_hash = "0x6bf10689b313619cf163192a65419764462e0be3cbafcfafa83df8763eda82e" +class_hash = "0x5cbece2ac875c6040300d7530bada7a3469a0e8e7584f29fcfaa2626ca1f6de" +original_class_hash = "0x5cbece2ac875c6040300d7530bada7a3469a0e8e7584f29fcfaa2626ca1f6de" abi = "manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json" tag = "dojo_examples_weapons-Flatbow" manifest_name = "dojo_examples_weapons-Flatbow-22f5bd16" 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 7c75c59707..3d21bef6a6 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -356,11 +356,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -378,7 +378,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -390,12 +390,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -407,7 +407,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-dungeon-6620e0e6.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-dungeon-6620e0e6.json index b48fc407a5..91fe2a95d0 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-dungeon-6620e0e6.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-dungeon-6620e0e6.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -165,11 +165,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -187,7 +187,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -199,12 +199,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -216,7 +216,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] 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 776977acd1..278cbb1cc0 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -147,11 +147,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -169,7 +169,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -181,12 +181,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -198,7 +198,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] 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 f9e4b7448b..86d2a176ff 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -160,11 +160,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -182,7 +182,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -194,12 +194,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -211,7 +211,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json index ee9ceaac66..4800464226 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json @@ -2,11 +2,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -16,7 +16,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -24,7 +24,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -34,11 +34,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -61,7 +61,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -73,24 +73,24 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::base::base::Event", + "name": "dojo::contract::base_contract::base::Event", "kind": "enum", "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "flat" } ] diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json index fe02b53f14..5620aa6fb5 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "World", - "interface_name": "dojo::world::IWorld" + "interface_name": "dojo::world::world_contract::IWorld" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -48,7 +48,7 @@ }, { "type": "enum", - "name": "dojo::world::ModelIndex", + "name": "dojo::model::model::ModelIndex", "variants": [ { "name": "Keys", @@ -76,7 +76,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -84,33 +84,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -118,15 +118,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -134,7 +134,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -154,7 +154,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorld", + "name": "dojo::world::world_contract::IWorld", "items": [ { "type": "function", @@ -167,7 +167,7 @@ ], "outputs": [ { - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "state_mutability": "view" @@ -178,7 +178,7 @@ "inputs": [ { "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "outputs": [], @@ -321,11 +321,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [ @@ -345,7 +345,7 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "values", @@ -353,7 +353,7 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -369,11 +369,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -579,11 +579,11 @@ { "type": "impl", "name": "UpgradeableWorld", - "interface_name": "dojo::world::IUpgradeableWorld" + "interface_name": "dojo::world::world_contract::IUpgradeableWorld" }, { "type": "interface", - "name": "dojo::world::IUpgradeableWorld", + "name": "dojo::world::world_contract::IUpgradeableWorld", "items": [ { "type": "function", @@ -602,11 +602,11 @@ { "type": "impl", "name": "UpgradeableState", - "interface_name": "dojo::interfaces::IUpgradeableState" + "interface_name": "dojo::world::update::IUpgradeableState" }, { "type": "struct", - "name": "dojo::interfaces::StorageUpdate", + "name": "dojo::world::update::StorageUpdate", "members": [ { "name": "key", @@ -620,17 +620,17 @@ }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::interfaces::ProgramOutput", + "name": "dojo::world::update::ProgramOutput", "members": [ { "name": "prev_state_root", @@ -668,7 +668,7 @@ }, { "type": "interface", - "name": "dojo::interfaces::IUpgradeableState", + "name": "dojo::world::update::IUpgradeableState", "items": [ { "type": "function", @@ -676,11 +676,11 @@ "inputs": [ { "name": "new_state", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "program_output", - "type": "dojo::interfaces::ProgramOutput" + "type": "dojo::world::update::ProgramOutput" }, { "name": "program_hash", @@ -695,11 +695,11 @@ { "type": "impl", "name": "ConfigImpl", - "interface_name": "dojo::config::interface::IConfig" + "interface_name": "dojo::world::config::IConfig" }, { "type": "interface", - "name": "dojo::config::interface::IConfig", + "name": "dojo::world::config::IConfig", "items": [ { "type": "function", @@ -784,7 +784,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldSpawned", + "name": "dojo::world::world_contract::world::WorldSpawned", "kind": "struct", "members": [ { @@ -801,7 +801,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractDeployed", + "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ { @@ -833,7 +833,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractUpgraded", + "name": "dojo::world::world_contract::world::ContractUpgraded", "kind": "struct", "members": [ { @@ -850,7 +850,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldUpgraded", + "name": "dojo::world::world_contract::world::WorldUpgraded", "kind": "struct", "members": [ { @@ -862,7 +862,7 @@ }, { "type": "event", - "name": "dojo::world::world::MetadataUpdate", + "name": "dojo::world::world_contract::world::MetadataUpdate", "kind": "struct", "members": [ { @@ -879,7 +879,7 @@ }, { "type": "event", - "name": "dojo::world::world::NamespaceRegistered", + "name": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "struct", "members": [ { @@ -896,7 +896,7 @@ }, { "type": "event", - "name": "dojo::world::world::ModelRegistered", + "name": "dojo::world::world_contract::world::ModelRegistered", "kind": "struct", "members": [ { @@ -933,7 +933,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreSetRecord", + "name": "dojo::world::world_contract::world::StoreSetRecord", "kind": "struct", "members": [ { @@ -955,7 +955,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreUpdateRecord", + "name": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "struct", "members": [ { @@ -977,7 +977,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreDelRecord", + "name": "dojo::world::world_contract::world::StoreDelRecord", "kind": "struct", "members": [ { @@ -994,7 +994,7 @@ }, { "type": "event", - "name": "dojo::world::world::WriterUpdated", + "name": "dojo::world::world_contract::world::WriterUpdated", "kind": "struct", "members": [ { @@ -1016,7 +1016,7 @@ }, { "type": "event", - "name": "dojo::world::world::OwnerUpdated", + "name": "dojo::world::world_contract::world::OwnerUpdated", "kind": "struct", "members": [ { @@ -1038,7 +1038,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "name": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "struct", "members": [ { @@ -1050,7 +1050,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "name": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -1062,7 +1062,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::FactsRegistryUpdate", + "name": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "struct", "members": [ { @@ -1074,29 +1074,29 @@ }, { "type": "event", - "name": "dojo::config::component::Config::Event", + "name": "dojo::world::config::Config::Event", "kind": "enum", "variants": [ { "name": "DifferProgramHashUpdate", - "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "type": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "nested" }, { "name": "MergerProgramHashUpdate", - "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "type": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "nested" }, { "name": "FactsRegistryUpdate", - "type": "dojo::config::component::Config::FactsRegistryUpdate", + "type": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::world::world::StateUpdated", + "name": "dojo::world::world_contract::world::StateUpdated", "kind": "struct", "members": [ { @@ -1108,77 +1108,77 @@ }, { "type": "event", - "name": "dojo::world::world::Event", + "name": "dojo::world::world_contract::world::Event", "kind": "enum", "variants": [ { "name": "WorldSpawned", - "type": "dojo::world::world::WorldSpawned", + "type": "dojo::world::world_contract::world::WorldSpawned", "kind": "nested" }, { "name": "ContractDeployed", - "type": "dojo::world::world::ContractDeployed", + "type": "dojo::world::world_contract::world::ContractDeployed", "kind": "nested" }, { "name": "ContractUpgraded", - "type": "dojo::world::world::ContractUpgraded", + "type": "dojo::world::world_contract::world::ContractUpgraded", "kind": "nested" }, { "name": "WorldUpgraded", - "type": "dojo::world::world::WorldUpgraded", + "type": "dojo::world::world_contract::world::WorldUpgraded", "kind": "nested" }, { "name": "MetadataUpdate", - "type": "dojo::world::world::MetadataUpdate", + "type": "dojo::world::world_contract::world::MetadataUpdate", "kind": "nested" }, { "name": "NamespaceRegistered", - "type": "dojo::world::world::NamespaceRegistered", + "type": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "nested" }, { "name": "ModelRegistered", - "type": "dojo::world::world::ModelRegistered", + "type": "dojo::world::world_contract::world::ModelRegistered", "kind": "nested" }, { "name": "StoreSetRecord", - "type": "dojo::world::world::StoreSetRecord", + "type": "dojo::world::world_contract::world::StoreSetRecord", "kind": "nested" }, { "name": "StoreUpdateRecord", - "type": "dojo::world::world::StoreUpdateRecord", + "type": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "nested" }, { "name": "StoreDelRecord", - "type": "dojo::world::world::StoreDelRecord", + "type": "dojo::world::world_contract::world::StoreDelRecord", "kind": "nested" }, { "name": "WriterUpdated", - "type": "dojo::world::world::WriterUpdated", + "type": "dojo::world::world_contract::world::WriterUpdated", "kind": "nested" }, { "name": "OwnerUpdated", - "type": "dojo::world::world::OwnerUpdated", + "type": "dojo::world::world_contract::world::OwnerUpdated", "kind": "nested" }, { "name": "ConfigEvent", - "type": "dojo::config::component::Config::Event", + "type": "dojo::world::config::Config::Event", "kind": "nested" }, { "name": "StateUpdated", - "type": "dojo::world::world::StateUpdated", + "type": "dojo::world::world_contract::world::StateUpdated", "kind": "nested" } ] 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 133257a2c1..4641430128 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 858f51d13c..5e416425e2 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 36b29c9dd7..79677cca37 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 adf73384b2..bfae2f690c 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 3e61365dee..d1fba9822d 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 8549c6cad8..6b373d240f 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 1f298063d0..203c340d15 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 031b2dcc9e..58aa520a88 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json index 4d4a41214e..aab11e5888 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json index 50d5861a0a..55eaa66dde 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 2e1fe5d442..2e6e8e5be7 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.json +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.json @@ -1,13 +1,13 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58", - "original_class_hash": "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58", + "class_hash": "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde", + "original_class_hash": "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde", "abi": [ { "type": "impl", "name": "World", - "interface_name": "dojo::world::IWorld" + "interface_name": "dojo::world::world_contract::IWorld" }, { "type": "struct", @@ -29,7 +29,7 @@ }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -53,7 +53,7 @@ }, { "type": "enum", - "name": "dojo::world::ModelIndex", + "name": "dojo::model::model::ModelIndex", "variants": [ { "name": "Keys", @@ -81,7 +81,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -89,33 +89,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -123,15 +123,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -139,7 +139,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -159,7 +159,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorld", + "name": "dojo::world::world_contract::IWorld", "items": [ { "type": "function", @@ -172,7 +172,7 @@ ], "outputs": [ { - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "state_mutability": "view" @@ -183,7 +183,7 @@ "inputs": [ { "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "outputs": [], @@ -326,11 +326,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [ @@ -350,7 +350,7 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "values", @@ -358,7 +358,7 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -374,11 +374,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -584,11 +584,11 @@ { "type": "impl", "name": "UpgradeableWorld", - "interface_name": "dojo::world::IUpgradeableWorld" + "interface_name": "dojo::world::world_contract::IUpgradeableWorld" }, { "type": "interface", - "name": "dojo::world::IUpgradeableWorld", + "name": "dojo::world::world_contract::IUpgradeableWorld", "items": [ { "type": "function", @@ -607,11 +607,11 @@ { "type": "impl", "name": "UpgradeableState", - "interface_name": "dojo::interfaces::IUpgradeableState" + "interface_name": "dojo::world::update::IUpgradeableState" }, { "type": "struct", - "name": "dojo::interfaces::StorageUpdate", + "name": "dojo::world::update::StorageUpdate", "members": [ { "name": "key", @@ -625,17 +625,17 @@ }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::interfaces::ProgramOutput", + "name": "dojo::world::update::ProgramOutput", "members": [ { "name": "prev_state_root", @@ -673,7 +673,7 @@ }, { "type": "interface", - "name": "dojo::interfaces::IUpgradeableState", + "name": "dojo::world::update::IUpgradeableState", "items": [ { "type": "function", @@ -681,11 +681,11 @@ "inputs": [ { "name": "new_state", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "program_output", - "type": "dojo::interfaces::ProgramOutput" + "type": "dojo::world::update::ProgramOutput" }, { "name": "program_hash", @@ -700,11 +700,11 @@ { "type": "impl", "name": "ConfigImpl", - "interface_name": "dojo::config::interface::IConfig" + "interface_name": "dojo::world::config::IConfig" }, { "type": "interface", - "name": "dojo::config::interface::IConfig", + "name": "dojo::world::config::IConfig", "items": [ { "type": "function", @@ -789,7 +789,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldSpawned", + "name": "dojo::world::world_contract::world::WorldSpawned", "kind": "struct", "members": [ { @@ -806,7 +806,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractDeployed", + "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ { @@ -838,7 +838,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractUpgraded", + "name": "dojo::world::world_contract::world::ContractUpgraded", "kind": "struct", "members": [ { @@ -855,7 +855,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldUpgraded", + "name": "dojo::world::world_contract::world::WorldUpgraded", "kind": "struct", "members": [ { @@ -867,7 +867,7 @@ }, { "type": "event", - "name": "dojo::world::world::MetadataUpdate", + "name": "dojo::world::world_contract::world::MetadataUpdate", "kind": "struct", "members": [ { @@ -884,7 +884,7 @@ }, { "type": "event", - "name": "dojo::world::world::NamespaceRegistered", + "name": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "struct", "members": [ { @@ -901,7 +901,7 @@ }, { "type": "event", - "name": "dojo::world::world::ModelRegistered", + "name": "dojo::world::world_contract::world::ModelRegistered", "kind": "struct", "members": [ { @@ -938,7 +938,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreSetRecord", + "name": "dojo::world::world_contract::world::StoreSetRecord", "kind": "struct", "members": [ { @@ -960,7 +960,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreUpdateRecord", + "name": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "struct", "members": [ { @@ -982,7 +982,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreDelRecord", + "name": "dojo::world::world_contract::world::StoreDelRecord", "kind": "struct", "members": [ { @@ -999,7 +999,7 @@ }, { "type": "event", - "name": "dojo::world::world::WriterUpdated", + "name": "dojo::world::world_contract::world::WriterUpdated", "kind": "struct", "members": [ { @@ -1021,7 +1021,7 @@ }, { "type": "event", - "name": "dojo::world::world::OwnerUpdated", + "name": "dojo::world::world_contract::world::OwnerUpdated", "kind": "struct", "members": [ { @@ -1043,7 +1043,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "name": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "struct", "members": [ { @@ -1055,7 +1055,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "name": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -1067,7 +1067,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::FactsRegistryUpdate", + "name": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "struct", "members": [ { @@ -1079,29 +1079,29 @@ }, { "type": "event", - "name": "dojo::config::component::Config::Event", + "name": "dojo::world::config::Config::Event", "kind": "enum", "variants": [ { "name": "DifferProgramHashUpdate", - "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "type": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "nested" }, { "name": "MergerProgramHashUpdate", - "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "type": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "nested" }, { "name": "FactsRegistryUpdate", - "type": "dojo::config::component::Config::FactsRegistryUpdate", + "type": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::world::world::StateUpdated", + "name": "dojo::world::world_contract::world::StateUpdated", "kind": "struct", "members": [ { @@ -1113,84 +1113,84 @@ }, { "type": "event", - "name": "dojo::world::world::Event", + "name": "dojo::world::world_contract::world::Event", "kind": "enum", "variants": [ { "name": "WorldSpawned", - "type": "dojo::world::world::WorldSpawned", + "type": "dojo::world::world_contract::world::WorldSpawned", "kind": "nested" }, { "name": "ContractDeployed", - "type": "dojo::world::world::ContractDeployed", + "type": "dojo::world::world_contract::world::ContractDeployed", "kind": "nested" }, { "name": "ContractUpgraded", - "type": "dojo::world::world::ContractUpgraded", + "type": "dojo::world::world_contract::world::ContractUpgraded", "kind": "nested" }, { "name": "WorldUpgraded", - "type": "dojo::world::world::WorldUpgraded", + "type": "dojo::world::world_contract::world::WorldUpgraded", "kind": "nested" }, { "name": "MetadataUpdate", - "type": "dojo::world::world::MetadataUpdate", + "type": "dojo::world::world_contract::world::MetadataUpdate", "kind": "nested" }, { "name": "NamespaceRegistered", - "type": "dojo::world::world::NamespaceRegistered", + "type": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "nested" }, { "name": "ModelRegistered", - "type": "dojo::world::world::ModelRegistered", + "type": "dojo::world::world_contract::world::ModelRegistered", "kind": "nested" }, { "name": "StoreSetRecord", - "type": "dojo::world::world::StoreSetRecord", + "type": "dojo::world::world_contract::world::StoreSetRecord", "kind": "nested" }, { "name": "StoreUpdateRecord", - "type": "dojo::world::world::StoreUpdateRecord", + "type": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "nested" }, { "name": "StoreDelRecord", - "type": "dojo::world::world::StoreDelRecord", + "type": "dojo::world::world_contract::world::StoreDelRecord", "kind": "nested" }, { "name": "WriterUpdated", - "type": "dojo::world::world::WriterUpdated", + "type": "dojo::world::world_contract::world::WriterUpdated", "kind": "nested" }, { "name": "OwnerUpdated", - "type": "dojo::world::world::OwnerUpdated", + "type": "dojo::world::world_contract::world::OwnerUpdated", "kind": "nested" }, { "name": "ConfigEvent", - "type": "dojo::config::component::Config::Event", + "type": "dojo::world::config::Config::Event", "kind": "nested" }, { "name": "StateUpdated", - "type": "dojo::world::world::StateUpdated", + "type": "dojo::world::world_contract::world::StateUpdated", "kind": "nested" } ] } ], - "address": "0x5ffa124a5076e590a23e9d393ebe4fc7c66989c2cd228a46f38a9e2d48305a7", - "transaction_hash": "0x4e792ecd0c6a655b93e861fe9cfa7243b857c925bd23d9d092fa2ee82bdfac7", + "address": "0x64525f120f0c0bfaa610e38fad3ace40ff8c696e0c498697d73e0f58fd5ad1", + "transaction_hash": "0x1a996413193677077362ecedda60227f345b0bb1b5c173b9a82f5cb8b584e8b", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -1201,8 +1201,8 @@ }, "base": { "kind": "Class", - "class_hash": "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b", - "original_class_hash": "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b", + "class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", + "original_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": "manifests/dev/deployment/abis/dojo-base.json", "tag": "dojo-base", "manifest_name": "dojo-base" @@ -1210,15 +1210,15 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x706862400b7076835b64b54887248e3698e1c72faafb4aaa133ea4bafde1ed7", - "class_hash": "0x562dc5e2a07016ab56ac97e72e5ce62a46caed41bb28d5aefdc6d1aafd3575e", - "original_class_hash": "0x562dc5e2a07016ab56ac97e72e5ce62a46caed41bb28d5aefdc6d1aafd3575e", - "base_class_hash": "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b", + "address": "0x668a24b0352dec79bd4661685fe1b152f33989bd3dc2dbdb094491fb1bdd589", + "class_hash": "0x40a2b17006490ae06a027632f2d5ed3debe715db65ef41c6037599d0c48c303", + "original_class_hash": "0x40a2b17006490ae06a027632f2d5ed3debe715db65ef41c6037599d0c48c303", + "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -1240,7 +1240,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -1313,11 +1313,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -1327,7 +1327,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -1335,7 +1335,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -1572,11 +1572,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -1594,7 +1594,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -1606,12 +1606,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -1623,7 +1623,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] @@ -1641,15 +1641,15 @@ }, { "kind": "DojoContract", - "address": "0x7083da52651ece707402a0f7f7c8fbfb1fe327b8138b0df234eb47d21698750", - "class_hash": "0x11bb79f4255371bbd58715696ede661544e281ece752d783e52e73deb8948cf", - "original_class_hash": "0x11bb79f4255371bbd58715696ede661544e281ece752d783e52e73deb8948cf", - "base_class_hash": "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b", + "address": "0x54ff4297b599c8e3948093b96af1c030c153f58225d9e5310f7f0acb0d4a462", + "class_hash": "0x45ad5a298db270a9c3ee439b7a7a008e3219b70937cfaa144589866442f3908", + "original_class_hash": "0x45ad5a298db270a9c3ee439b7a7a008e3219b70937cfaa144589866442f3908", + "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -1671,7 +1671,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -1744,11 +1744,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -1758,7 +1758,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -1766,7 +1766,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -1812,11 +1812,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -1834,7 +1834,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -1846,12 +1846,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -1863,7 +1863,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] @@ -1878,15 +1878,15 @@ }, { "kind": "DojoContract", - "address": "0x708e9ef47bc3d42d12b5caa837e10b3b6f6c5e6c33776e6094d75a4fe72a8a5", - "class_hash": "0xc25acec255f081e3845b29c598a9b6eecc79d16445e2dd0baa740c92055213", - "original_class_hash": "0xc25acec255f081e3845b29c598a9b6eecc79d16445e2dd0baa740c92055213", - "base_class_hash": "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b", + "address": "0x6b85960481f204d313929031f776161d8b4eff4a8b9c53d14c27d7af90486d0", + "class_hash": "0x3daab1621bba5f43f0d84f8f68ee7a5dfa4d83f98f746e2e9dcd3a848233e35", + "original_class_hash": "0x3daab1621bba5f43f0d84f8f68ee7a5dfa4d83f98f746e2e9dcd3a848233e35", + "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -1908,7 +1908,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -1981,11 +1981,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -1995,7 +1995,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -2003,7 +2003,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -2031,11 +2031,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -2053,7 +2053,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -2065,12 +2065,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -2082,7 +2082,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] @@ -2097,15 +2097,15 @@ }, { "kind": "DojoContract", - "address": "0x592be9dcc584b972683aa3ba6fd7c982574303e402af0c1529bb33fc09df16e", - "class_hash": "0x4990d14908bf4cee13d7cff8dde2ffd91772c8ba325b0f0f2af0bd3398e3634", - "original_class_hash": "0x4990d14908bf4cee13d7cff8dde2ffd91772c8ba325b0f0f2af0bd3398e3634", - "base_class_hash": "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b", + "address": "0x2c7763f16ffa3cc9b295904051b5b362ef99bf39eb0b43969ace5547e5bd64f", + "class_hash": "0x77f7f87e45a7295b9067e6438bb41009661a4a72be944d9f40976984a7b7d37", + "original_class_hash": "0x77f7f87e45a7295b9067e6438bb41009661a4a72be944d9f40976984a7b7d37", + "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -2127,7 +2127,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -2200,11 +2200,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -2214,7 +2214,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -2222,7 +2222,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -2263,11 +2263,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -2285,7 +2285,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -2297,12 +2297,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -2314,7 +2314,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] @@ -2352,13 +2352,13 @@ "key": false } ], - "class_hash": "0x6e69c6811fcc67953426e123cdd87530e7a27bb4613251fc6182aa9dde75411", - "original_class_hash": "0x6e69c6811fcc67953426e123cdd87530e7a27bb4613251fc6182aa9dde75411", + "class_hash": "0x8a7f15ef119eb0b44c6b7f30f312dc23619d781173dcfff0e55234bf4a67a3", + "original_class_hash": "0x8a7f15ef119eb0b44c6b7f30f312dc23619d781173dcfff0e55234bf4a67a3", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -2404,7 +2404,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -2412,33 +2412,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -2446,15 +2446,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -2462,7 +2462,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -2478,7 +2478,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -2490,23 +2490,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -2518,23 +2518,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -2546,23 +2546,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -2570,19 +2570,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -2592,7 +2592,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -2699,7 +2699,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -2710,7 +2710,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -2792,13 +2792,13 @@ "key": true } ], - "class_hash": "0x33728d68e7d0d807184b6cb065b608a5145fb4b964c1c0bf3c8a4b92695053e", - "original_class_hash": "0x33728d68e7d0d807184b6cb065b608a5145fb4b964c1c0bf3c8a4b92695053e", + "class_hash": "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b", + "original_class_hash": "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -2844,7 +2844,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -2852,33 +2852,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -2886,15 +2886,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -2902,7 +2902,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -2918,7 +2918,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -2930,23 +2930,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -2958,23 +2958,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -2986,23 +2986,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -3010,19 +3010,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -3032,7 +3032,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -3139,7 +3139,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -3150,7 +3150,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -3226,13 +3226,13 @@ "key": false } ], - "class_hash": "0x4d9dfa45ceeb2fa6051d9cf4fb469ad0354becd3c9830595b941d6fd4eb2202", - "original_class_hash": "0x4d9dfa45ceeb2fa6051d9cf4fb469ad0354becd3c9830595b941d6fd4eb2202", + "class_hash": "0x1dfb7c80100d8045d0b37d01ee118e057aa04ff98198f43f1b43171acb0ad9e", + "original_class_hash": "0x1dfb7c80100d8045d0b37d01ee118e057aa04ff98198f43f1b43171acb0ad9e", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -3278,7 +3278,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -3286,33 +3286,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -3320,15 +3320,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -3336,7 +3336,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -3352,7 +3352,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -3364,23 +3364,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -3392,23 +3392,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -3420,23 +3420,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -3444,19 +3444,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -3466,7 +3466,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -3573,7 +3573,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -3584,7 +3584,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -3652,13 +3652,13 @@ "key": false } ], - "class_hash": "0x291252f382a059d3d1fa0c813160c93ccc05f9b5683fa63b8194fe8bed2fcba", - "original_class_hash": "0x291252f382a059d3d1fa0c813160c93ccc05f9b5683fa63b8194fe8bed2fcba", + "class_hash": "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2", + "original_class_hash": "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -3704,7 +3704,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -3712,33 +3712,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -3746,15 +3746,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -3762,7 +3762,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -3778,7 +3778,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -3790,23 +3790,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -3818,23 +3818,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -3846,23 +3846,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -3870,19 +3870,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -3892,7 +3892,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -3999,7 +3999,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -4010,7 +4010,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -4109,13 +4109,13 @@ "key": false } ], - "class_hash": "0x47f77d27573e12c1441dd65b1a88f4432c1c4ec446241830ff4c33f3f58a44e", - "original_class_hash": "0x47f77d27573e12c1441dd65b1a88f4432c1c4ec446241830ff4c33f3f58a44e", + "class_hash": "0x61fa996f7cf8412bb5aca7d4bd4fd9eca806a92e5007e87d23f638b6774ed40", + "original_class_hash": "0x61fa996f7cf8412bb5aca7d4bd4fd9eca806a92e5007e87d23f638b6774ed40", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -4161,7 +4161,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -4169,33 +4169,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -4203,15 +4203,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -4219,7 +4219,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -4235,7 +4235,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -4247,23 +4247,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -4275,23 +4275,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -4303,23 +4303,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -4327,19 +4327,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -4349,7 +4349,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -4456,7 +4456,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -4467,7 +4467,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -4575,13 +4575,13 @@ "key": false } ], - "class_hash": "0xc88609dbcf23f3610913a55744dd6a211703daa989dfd91e2672dd85c33b4e", - "original_class_hash": "0xc88609dbcf23f3610913a55744dd6a211703daa989dfd91e2672dd85c33b4e", + "class_hash": "0x5191a56dc5a83bb56969ddb5fcc70dc1ac4ad057d0a054cf555a0023b454923", + "original_class_hash": "0x5191a56dc5a83bb56969ddb5fcc70dc1ac4ad057d0a054cf555a0023b454923", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -4627,7 +4627,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -4635,33 +4635,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -4669,15 +4669,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -4685,7 +4685,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -4701,7 +4701,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -4713,23 +4713,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -4741,23 +4741,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -4769,23 +4769,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -4793,19 +4793,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -4815,7 +4815,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -4922,7 +4922,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -4933,7 +4933,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -5027,13 +5027,13 @@ "key": false } ], - "class_hash": "0x2b530adc12f28cdb03e7c9c0b69556b18c4775faedf826879aee9f6113c8c66", - "original_class_hash": "0x2b530adc12f28cdb03e7c9c0b69556b18c4775faedf826879aee9f6113c8c66", + "class_hash": "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea", + "original_class_hash": "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -5079,7 +5079,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -5087,33 +5087,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -5121,15 +5121,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -5137,7 +5137,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -5153,7 +5153,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -5165,23 +5165,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -5193,23 +5193,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -5221,23 +5221,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -5245,19 +5245,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -5267,7 +5267,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -5374,7 +5374,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -5385,7 +5385,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -5472,13 +5472,13 @@ "key": false } ], - "class_hash": "0x794eb270cb490e228d2710c8a397cfb821461a2796acc6714eca8d8462d7f57", - "original_class_hash": "0x794eb270cb490e228d2710c8a397cfb821461a2796acc6714eca8d8462d7f57", + "class_hash": "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b", + "original_class_hash": "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -5524,7 +5524,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -5532,33 +5532,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -5566,15 +5566,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -5582,7 +5582,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -5598,7 +5598,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -5610,23 +5610,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -5638,23 +5638,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -5666,23 +5666,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -5690,19 +5690,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -5712,7 +5712,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -5819,7 +5819,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -5830,7 +5830,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -5912,13 +5912,13 @@ "key": false } ], - "class_hash": "0x273dc20b425570101716086cc3b94073e1762b5aa802c369b9d953d59ebce49", - "original_class_hash": "0x273dc20b425570101716086cc3b94073e1762b5aa802c369b9d953d59ebce49", + "class_hash": "0x72898823e557f2f3a48026a97b6ec9fed750a4884788751c4c512c6dde0ff3c", + "original_class_hash": "0x72898823e557f2f3a48026a97b6ec9fed750a4884788751c4c512c6dde0ff3c", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -5964,7 +5964,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -5972,33 +5972,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -6006,15 +6006,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -6022,7 +6022,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -6038,7 +6038,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -6050,23 +6050,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -6078,23 +6078,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -6106,23 +6106,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -6130,19 +6130,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -6152,7 +6152,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -6259,7 +6259,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -6270,7 +6270,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" @@ -6351,13 +6351,13 @@ "key": false } ], - "class_hash": "0x6bf10689b313619cf163192a65419764462e0be3cbafcfafa83df8763eda82e", - "original_class_hash": "0x6bf10689b313619cf163192a65419764462e0be3cbafcfafa83df8763eda82e", + "class_hash": "0x5cbece2ac875c6040300d7530bada7a3469a0e8e7584f29fcfaa2626ca1f6de", + "original_class_hash": "0x5cbece2ac875c6040300d7530bada7a3469a0e8e7584f29fcfaa2626ca1f6de", "abi": [ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -6403,7 +6403,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -6411,33 +6411,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -6445,15 +6445,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -6461,7 +6461,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -6477,7 +6477,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -6489,23 +6489,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -6517,23 +6517,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -6545,23 +6545,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -6569,19 +6569,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -6591,7 +6591,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -6698,7 +6698,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -6709,7 +6709,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 c54a255d9d..0db69370a4 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 = "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58" -original_class_hash = "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58" +class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" +original_class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" abi = "manifests/dev/deployment/abis/dojo-world.json" -address = "0x5ffa124a5076e590a23e9d393ebe4fc7c66989c2cd228a46f38a9e2d48305a7" -transaction_hash = "0x4e792ecd0c6a655b93e861fe9cfa7243b857c925bd23d9d092fa2ee82bdfac7" +address = "0x64525f120f0c0bfaa610e38fad3ace40ff8c696e0c498697d73e0f58fd5ad1" +transaction_hash = "0x1a996413193677077362ecedda60227f345b0bb1b5c173b9a82f5cb8b584e8b" block_number = 3 seed = "dojo_examples" manifest_name = "dojo-world" @@ -15,18 +15,18 @@ rpc_url = "http://localhost:5050/" [base] kind = "Class" -class_hash = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" -original_class_hash = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" +class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +original_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" [[contracts]] kind = "DojoContract" -address = "0x706862400b7076835b64b54887248e3698e1c72faafb4aaa133ea4bafde1ed7" -class_hash = "0x562dc5e2a07016ab56ac97e72e5ce62a46caed41bb28d5aefdc6d1aafd3575e" -original_class_hash = "0x562dc5e2a07016ab56ac97e72e5ce62a46caed41bb28d5aefdc6d1aafd3575e" -base_class_hash = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" +address = "0x668a24b0352dec79bd4661685fe1b152f33989bd3dc2dbdb094491fb1bdd589" +class_hash = "0x40a2b17006490ae06a027632f2d5ed3debe715db65ef41c6037599d0c48c303" +original_class_hash = "0x40a2b17006490ae06a027632f2d5ed3debe715db65ef41c6037599d0c48c303" +base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" 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 = "0x7083da52651ece707402a0f7f7c8fbfb1fe327b8138b0df234eb47d21698750" -class_hash = "0x11bb79f4255371bbd58715696ede661544e281ece752d783e52e73deb8948cf" -original_class_hash = "0x11bb79f4255371bbd58715696ede661544e281ece752d783e52e73deb8948cf" -base_class_hash = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" +address = "0x54ff4297b599c8e3948093b96af1c030c153f58225d9e5310f7f0acb0d4a462" +class_hash = "0x45ad5a298db270a9c3ee439b7a7a008e3219b70937cfaa144589866442f3908" +original_class_hash = "0x45ad5a298db270a9c3ee439b7a7a008e3219b70937cfaa144589866442f3908" +base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-dungeon-6620e0e6.json" reads = [] writes = [] @@ -54,10 +54,10 @@ manifest_name = "dojo_examples-dungeon-6620e0e6" [[contracts]] kind = "DojoContract" -address = "0x708e9ef47bc3d42d12b5caa837e10b3b6f6c5e6c33776e6094d75a4fe72a8a5" -class_hash = "0xc25acec255f081e3845b29c598a9b6eecc79d16445e2dd0baa740c92055213" -original_class_hash = "0xc25acec255f081e3845b29c598a9b6eecc79d16445e2dd0baa740c92055213" -base_class_hash = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" +address = "0x6b85960481f204d313929031f776161d8b4eff4a8b9c53d14c27d7af90486d0" +class_hash = "0x3daab1621bba5f43f0d84f8f68ee7a5dfa4d83f98f746e2e9dcd3a848233e35" +original_class_hash = "0x3daab1621bba5f43f0d84f8f68ee7a5dfa4d83f98f746e2e9dcd3a848233e35" +base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] @@ -68,10 +68,10 @@ manifest_name = "dojo_examples-mock_token-31599eb2" [[contracts]] kind = "DojoContract" -address = "0x592be9dcc584b972683aa3ba6fd7c982574303e402af0c1529bb33fc09df16e" -class_hash = "0x4990d14908bf4cee13d7cff8dde2ffd91772c8ba325b0f0f2af0bd3398e3634" -original_class_hash = "0x4990d14908bf4cee13d7cff8dde2ffd91772c8ba325b0f0f2af0bd3398e3634" -base_class_hash = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" +address = "0x2c7763f16ffa3cc9b295904051b5b362ef99bf39eb0b43969ace5547e5bd64f" +class_hash = "0x77f7f87e45a7295b9067e6438bb41009661a4a72be944d9f40976984a7b7d37" +original_class_hash = "0x77f7f87e45a7295b9067e6438bb41009661a4a72be944d9f40976984a7b7d37" +base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] @@ -86,8 +86,8 @@ manifest_name = "dojo_examples-others-61de2c18" [[models]] kind = "DojoModel" -class_hash = "0x6e69c6811fcc67953426e123cdd87530e7a27bb4613251fc6182aa9dde75411" -original_class_hash = "0x6e69c6811fcc67953426e123cdd87530e7a27bb4613251fc6182aa9dde75411" +class_hash = "0x8a7f15ef119eb0b44c6b7f30f312dc23619d781173dcfff0e55234bf4a67a3" +original_class_hash = "0x8a7f15ef119eb0b44c6b7f30f312dc23619d781173dcfff0e55234bf4a67a3" abi = "manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" @@ -109,8 +109,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x33728d68e7d0d807184b6cb065b608a5145fb4b964c1c0bf3c8a4b92695053e" -original_class_hash = "0x33728d68e7d0d807184b6cb065b608a5145fb4b964c1c0bf3c8a4b92695053e" +class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" +original_class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" abi = "manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" @@ -137,8 +137,8 @@ key = true [[models]] kind = "DojoModel" -class_hash = "0x4d9dfa45ceeb2fa6051d9cf4fb469ad0354becd3c9830595b941d6fd4eb2202" -original_class_hash = "0x4d9dfa45ceeb2fa6051d9cf4fb469ad0354becd3c9830595b941d6fd4eb2202" +class_hash = "0x1dfb7c80100d8045d0b37d01ee118e057aa04ff98198f43f1b43171acb0ad9e" +original_class_hash = "0x1dfb7c80100d8045d0b37d01ee118e057aa04ff98198f43f1b43171acb0ad9e" abi = "manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" @@ -155,8 +155,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x291252f382a059d3d1fa0c813160c93ccc05f9b5683fa63b8194fe8bed2fcba" -original_class_hash = "0x291252f382a059d3d1fa0c813160c93ccc05f9b5683fa63b8194fe8bed2fcba" +class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" +original_class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" abi = "manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" @@ -173,8 +173,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x47f77d27573e12c1441dd65b1a88f4432c1c4ec446241830ff4c33f3f58a44e" -original_class_hash = "0x47f77d27573e12c1441dd65b1a88f4432c1c4ec446241830ff4c33f3f58a44e" +class_hash = "0x61fa996f7cf8412bb5aca7d4bd4fd9eca806a92e5007e87d23f638b6774ed40" +original_class_hash = "0x61fa996f7cf8412bb5aca7d4bd4fd9eca806a92e5007e87d23f638b6774ed40" abi = "manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" @@ -196,8 +196,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0xc88609dbcf23f3610913a55744dd6a211703daa989dfd91e2672dd85c33b4e" -original_class_hash = "0xc88609dbcf23f3610913a55744dd6a211703daa989dfd91e2672dd85c33b4e" +class_hash = "0x5191a56dc5a83bb56969ddb5fcc70dc1ac4ad057d0a054cf555a0023b454923" +original_class_hash = "0x5191a56dc5a83bb56969ddb5fcc70dc1ac4ad057d0a054cf555a0023b454923" abi = "manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" @@ -224,8 +224,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x2b530adc12f28cdb03e7c9c0b69556b18c4775faedf826879aee9f6113c8c66" -original_class_hash = "0x2b530adc12f28cdb03e7c9c0b69556b18c4775faedf826879aee9f6113c8c66" +class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" +original_class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" abi = "manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" @@ -242,8 +242,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x794eb270cb490e228d2710c8a397cfb821461a2796acc6714eca8d8462d7f57" -original_class_hash = "0x794eb270cb490e228d2710c8a397cfb821461a2796acc6714eca8d8462d7f57" +class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" +original_class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" abi = "manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" @@ -265,8 +265,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x273dc20b425570101716086cc3b94073e1762b5aa802c369b9d953d59ebce49" -original_class_hash = "0x273dc20b425570101716086cc3b94073e1762b5aa802c369b9d953d59ebce49" +class_hash = "0x72898823e557f2f3a48026a97b6ec9fed750a4884788751c4c512c6dde0ff3c" +original_class_hash = "0x72898823e557f2f3a48026a97b6ec9fed750a4884788751c4c512c6dde0ff3c" abi = "manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json" tag = "dojo_examples_foes-RiverSkale" manifest_name = "dojo_examples_foes-RiverSkale-39535c12" @@ -293,8 +293,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x6bf10689b313619cf163192a65419764462e0be3cbafcfafa83df8763eda82e" -original_class_hash = "0x6bf10689b313619cf163192a65419764462e0be3cbafcfafa83df8763eda82e" +class_hash = "0x5cbece2ac875c6040300d7530bada7a3469a0e8e7584f29fcfaa2626ca1f6de" +original_class_hash = "0x5cbece2ac875c6040300d7530bada7a3469a0e8e7584f29fcfaa2626ca1f6de" abi = "manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json" tag = "dojo_examples_weapons-Flatbow" manifest_name = "dojo_examples_weapons-Flatbow-22f5bd16" 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 7c75c59707..3d21bef6a6 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -356,11 +356,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -378,7 +378,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -390,12 +390,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -407,7 +407,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] diff --git a/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-dungeon-6620e0e6.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-dungeon-6620e0e6.json index b48fc407a5..91fe2a95d0 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-dungeon-6620e0e6.json +++ b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-dungeon-6620e0e6.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -165,11 +165,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -187,7 +187,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -199,12 +199,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -216,7 +216,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] 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 776977acd1..278cbb1cc0 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -147,11 +147,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -169,7 +169,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -181,12 +181,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -198,7 +198,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] 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 f9e4b7448b..86d2a176ff 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "ContractImpl", - "interface_name": "dojo::contract::IContract" + "interface_name": "dojo::contract::contract::IContract" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "interface", - "name": "dojo::contract::IContract", + "name": "dojo::contract::contract::IContract", "items": [ { "type": "function", @@ -97,11 +97,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -111,7 +111,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -119,7 +119,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -160,11 +160,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -182,7 +182,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -194,12 +194,12 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] @@ -211,7 +211,7 @@ "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "nested" } ] 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 index ee9ceaac66..4800464226 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/dojo-base.json +++ b/examples/spawn-and-move/manifests/release/base/abis/dojo-base.json @@ -2,11 +2,11 @@ { "type": "impl", "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" + "interface_name": "dojo::world::world_contract::IWorldProvider" }, { "type": "struct", - "name": "dojo::world::IWorldDispatcher", + "name": "dojo::world::world_contract::IWorldDispatcher", "members": [ { "name": "contract_address", @@ -16,7 +16,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorldProvider", + "name": "dojo::world::world_contract::IWorldProvider", "items": [ { "type": "function", @@ -24,7 +24,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::world::IWorldDispatcher" + "type": "dojo::world::world_contract::IWorldDispatcher" } ], "state_mutability": "view" @@ -34,11 +34,11 @@ { "type": "impl", "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" + "interface_name": "dojo::contract::upgradeable::IUpgradeable" }, { "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", + "name": "dojo::contract::upgradeable::IUpgradeable", "items": [ { "type": "function", @@ -61,7 +61,7 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "struct", "members": [ { @@ -73,24 +73,24 @@ }, { "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", + "name": "dojo::contract::upgradeable::upgradeable::Event", "kind": "enum", "variants": [ { "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::base::base::Event", + "name": "dojo::contract::base_contract::base::Event", "kind": "enum", "variants": [ { "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", + "type": "dojo::contract::upgradeable::upgradeable::Event", "kind": "flat" } ] diff --git a/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json b/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json index fe02b53f14..5620aa6fb5 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json +++ b/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "World", - "interface_name": "dojo::world::IWorld" + "interface_name": "dojo::world::world_contract::IWorld" }, { "type": "struct", @@ -24,7 +24,7 @@ }, { "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", + "name": "dojo::model::metadata::ResourceMetadata", "members": [ { "name": "resource_id", @@ -48,7 +48,7 @@ }, { "type": "enum", - "name": "dojo::world::ModelIndex", + "name": "dojo::model::model::ModelIndex", "variants": [ { "name": "Keys", @@ -76,7 +76,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -84,33 +84,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -118,15 +118,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -134,7 +134,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -154,7 +154,7 @@ }, { "type": "interface", - "name": "dojo::world::IWorld", + "name": "dojo::world::world_contract::IWorld", "items": [ { "type": "function", @@ -167,7 +167,7 @@ ], "outputs": [ { - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "state_mutability": "view" @@ -178,7 +178,7 @@ "inputs": [ { "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" + "type": "dojo::model::metadata::ResourceMetadata" } ], "outputs": [], @@ -321,11 +321,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [ @@ -345,7 +345,7 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "values", @@ -353,7 +353,7 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -369,11 +369,11 @@ }, { "name": "index", - "type": "dojo::world::ModelIndex" + "type": "dojo::model::model::ModelIndex" }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "outputs": [], @@ -579,11 +579,11 @@ { "type": "impl", "name": "UpgradeableWorld", - "interface_name": "dojo::world::IUpgradeableWorld" + "interface_name": "dojo::world::world_contract::IUpgradeableWorld" }, { "type": "interface", - "name": "dojo::world::IUpgradeableWorld", + "name": "dojo::world::world_contract::IUpgradeableWorld", "items": [ { "type": "function", @@ -602,11 +602,11 @@ { "type": "impl", "name": "UpgradeableState", - "interface_name": "dojo::interfaces::IUpgradeableState" + "interface_name": "dojo::world::update::IUpgradeableState" }, { "type": "struct", - "name": "dojo::interfaces::StorageUpdate", + "name": "dojo::world::update::StorageUpdate", "members": [ { "name": "key", @@ -620,17 +620,17 @@ }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::interfaces::ProgramOutput", + "name": "dojo::world::update::ProgramOutput", "members": [ { "name": "prev_state_root", @@ -668,7 +668,7 @@ }, { "type": "interface", - "name": "dojo::interfaces::IUpgradeableState", + "name": "dojo::world::update::IUpgradeableState", "items": [ { "type": "function", @@ -676,11 +676,11 @@ "inputs": [ { "name": "new_state", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "program_output", - "type": "dojo::interfaces::ProgramOutput" + "type": "dojo::world::update::ProgramOutput" }, { "name": "program_hash", @@ -695,11 +695,11 @@ { "type": "impl", "name": "ConfigImpl", - "interface_name": "dojo::config::interface::IConfig" + "interface_name": "dojo::world::config::IConfig" }, { "type": "interface", - "name": "dojo::config::interface::IConfig", + "name": "dojo::world::config::IConfig", "items": [ { "type": "function", @@ -784,7 +784,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldSpawned", + "name": "dojo::world::world_contract::world::WorldSpawned", "kind": "struct", "members": [ { @@ -801,7 +801,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractDeployed", + "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ { @@ -833,7 +833,7 @@ }, { "type": "event", - "name": "dojo::world::world::ContractUpgraded", + "name": "dojo::world::world_contract::world::ContractUpgraded", "kind": "struct", "members": [ { @@ -850,7 +850,7 @@ }, { "type": "event", - "name": "dojo::world::world::WorldUpgraded", + "name": "dojo::world::world_contract::world::WorldUpgraded", "kind": "struct", "members": [ { @@ -862,7 +862,7 @@ }, { "type": "event", - "name": "dojo::world::world::MetadataUpdate", + "name": "dojo::world::world_contract::world::MetadataUpdate", "kind": "struct", "members": [ { @@ -879,7 +879,7 @@ }, { "type": "event", - "name": "dojo::world::world::NamespaceRegistered", + "name": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "struct", "members": [ { @@ -896,7 +896,7 @@ }, { "type": "event", - "name": "dojo::world::world::ModelRegistered", + "name": "dojo::world::world_contract::world::ModelRegistered", "kind": "struct", "members": [ { @@ -933,7 +933,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreSetRecord", + "name": "dojo::world::world_contract::world::StoreSetRecord", "kind": "struct", "members": [ { @@ -955,7 +955,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreUpdateRecord", + "name": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "struct", "members": [ { @@ -977,7 +977,7 @@ }, { "type": "event", - "name": "dojo::world::world::StoreDelRecord", + "name": "dojo::world::world_contract::world::StoreDelRecord", "kind": "struct", "members": [ { @@ -994,7 +994,7 @@ }, { "type": "event", - "name": "dojo::world::world::WriterUpdated", + "name": "dojo::world::world_contract::world::WriterUpdated", "kind": "struct", "members": [ { @@ -1016,7 +1016,7 @@ }, { "type": "event", - "name": "dojo::world::world::OwnerUpdated", + "name": "dojo::world::world_contract::world::OwnerUpdated", "kind": "struct", "members": [ { @@ -1038,7 +1038,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "name": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "struct", "members": [ { @@ -1050,7 +1050,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "name": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -1062,7 +1062,7 @@ }, { "type": "event", - "name": "dojo::config::component::Config::FactsRegistryUpdate", + "name": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "struct", "members": [ { @@ -1074,29 +1074,29 @@ }, { "type": "event", - "name": "dojo::config::component::Config::Event", + "name": "dojo::world::config::Config::Event", "kind": "enum", "variants": [ { "name": "DifferProgramHashUpdate", - "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "type": "dojo::world::config::Config::DifferProgramHashUpdate", "kind": "nested" }, { "name": "MergerProgramHashUpdate", - "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "type": "dojo::world::config::Config::MergerProgramHashUpdate", "kind": "nested" }, { "name": "FactsRegistryUpdate", - "type": "dojo::config::component::Config::FactsRegistryUpdate", + "type": "dojo::world::config::Config::FactsRegistryUpdate", "kind": "nested" } ] }, { "type": "event", - "name": "dojo::world::world::StateUpdated", + "name": "dojo::world::world_contract::world::StateUpdated", "kind": "struct", "members": [ { @@ -1108,77 +1108,77 @@ }, { "type": "event", - "name": "dojo::world::world::Event", + "name": "dojo::world::world_contract::world::Event", "kind": "enum", "variants": [ { "name": "WorldSpawned", - "type": "dojo::world::world::WorldSpawned", + "type": "dojo::world::world_contract::world::WorldSpawned", "kind": "nested" }, { "name": "ContractDeployed", - "type": "dojo::world::world::ContractDeployed", + "type": "dojo::world::world_contract::world::ContractDeployed", "kind": "nested" }, { "name": "ContractUpgraded", - "type": "dojo::world::world::ContractUpgraded", + "type": "dojo::world::world_contract::world::ContractUpgraded", "kind": "nested" }, { "name": "WorldUpgraded", - "type": "dojo::world::world::WorldUpgraded", + "type": "dojo::world::world_contract::world::WorldUpgraded", "kind": "nested" }, { "name": "MetadataUpdate", - "type": "dojo::world::world::MetadataUpdate", + "type": "dojo::world::world_contract::world::MetadataUpdate", "kind": "nested" }, { "name": "NamespaceRegistered", - "type": "dojo::world::world::NamespaceRegistered", + "type": "dojo::world::world_contract::world::NamespaceRegistered", "kind": "nested" }, { "name": "ModelRegistered", - "type": "dojo::world::world::ModelRegistered", + "type": "dojo::world::world_contract::world::ModelRegistered", "kind": "nested" }, { "name": "StoreSetRecord", - "type": "dojo::world::world::StoreSetRecord", + "type": "dojo::world::world_contract::world::StoreSetRecord", "kind": "nested" }, { "name": "StoreUpdateRecord", - "type": "dojo::world::world::StoreUpdateRecord", + "type": "dojo::world::world_contract::world::StoreUpdateRecord", "kind": "nested" }, { "name": "StoreDelRecord", - "type": "dojo::world::world::StoreDelRecord", + "type": "dojo::world::world_contract::world::StoreDelRecord", "kind": "nested" }, { "name": "WriterUpdated", - "type": "dojo::world::world::WriterUpdated", + "type": "dojo::world::world_contract::world::WriterUpdated", "kind": "nested" }, { "name": "OwnerUpdated", - "type": "dojo::world::world::OwnerUpdated", + "type": "dojo::world::world_contract::world::OwnerUpdated", "kind": "nested" }, { "name": "ConfigEvent", - "type": "dojo::config::component::Config::Event", + "type": "dojo::world::config::Config::Event", "kind": "nested" }, { "name": "StateUpdated", - "type": "dojo::world::world::StateUpdated", + "type": "dojo::world::world_contract::world::StateUpdated", "kind": "nested" } ] 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 133257a2c1..4641430128 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 858f51d13c..5e416425e2 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 36b29c9dd7..79677cca37 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 adf73384b2..bfae2f690c 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 3e61365dee..d1fba9822d 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 8549c6cad8..6b373d240f 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 1f298063d0..203c340d15 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 031b2dcc9e..58aa520a88 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 @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json index 4d4a41214e..aab11e5888 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json index 50d5861a0a..55eaa66dde 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json @@ -2,7 +2,7 @@ { "type": "impl", "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" + "interface_name": "dojo::model::model::IModel" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::FieldLayout", + "name": "dojo::model::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Layout", + "name": "dojo::model::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::database::introspect::Member", + "name": "dojo::model::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Struct", + "name": "dojo::model::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::database::introspect::Enum", + "name": "dojo::model::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::database::introspect::Ty", + "name": "dojo::model::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::database::introspect::Struct" + "type": "dojo::model::introspect::Struct" }, { "name": "Enum", - "type": "dojo::database::introspect::Enum" + "type": "dojo::model::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::IModel", + "name": "dojo::model::model::IModel", "items": [ { "type": "function", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Layout" + "type": "dojo::model::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::database::introspect::Ty" + "type": "dojo::model::introspect::Ty" } ], "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 b54ad660f6..9ae935a468 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 = "0x562dc5e2a07016ab56ac97e72e5ce62a46caed41bb28d5aefdc6d1aafd3575e" -original_class_hash = "0x562dc5e2a07016ab56ac97e72e5ce62a46caed41bb28d5aefdc6d1aafd3575e" +class_hash = "0x40a2b17006490ae06a027632f2d5ed3debe715db65ef41c6037599d0c48c303" +original_class_hash = "0x40a2b17006490ae06a027632f2d5ed3debe715db65ef41c6037599d0c48c303" 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-dungeon-6620e0e6.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-dungeon-6620e0e6.toml index b91b03f9c6..e69587f08d 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-dungeon-6620e0e6.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-dungeon-6620e0e6.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x11bb79f4255371bbd58715696ede661544e281ece752d783e52e73deb8948cf" -original_class_hash = "0x11bb79f4255371bbd58715696ede661544e281ece752d783e52e73deb8948cf" +class_hash = "0x45ad5a298db270a9c3ee439b7a7a008e3219b70937cfaa144589866442f3908" +original_class_hash = "0x45ad5a298db270a9c3ee439b7a7a008e3219b70937cfaa144589866442f3908" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-dungeon-6620e0e6.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 fcd665c7ed..b4a1a5e9e2 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 = "0xc25acec255f081e3845b29c598a9b6eecc79d16445e2dd0baa740c92055213" -original_class_hash = "0xc25acec255f081e3845b29c598a9b6eecc79d16445e2dd0baa740c92055213" +class_hash = "0x3daab1621bba5f43f0d84f8f68ee7a5dfa4d83f98f746e2e9dcd3a848233e35" +original_class_hash = "0x3daab1621bba5f43f0d84f8f68ee7a5dfa4d83f98f746e2e9dcd3a848233e35" 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 0955f52fb1..5bb73e7612 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 = "0x4990d14908bf4cee13d7cff8dde2ffd91772c8ba325b0f0f2af0bd3398e3634" -original_class_hash = "0x4990d14908bf4cee13d7cff8dde2ffd91772c8ba325b0f0f2af0bd3398e3634" +class_hash = "0x77f7f87e45a7295b9067e6438bb41009661a4a72be944d9f40976984a7b7d37" +original_class_hash = "0x77f7f87e45a7295b9067e6438bb41009661a4a72be944d9f40976984a7b7d37" 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 2e7dd0aefd..a2ae530db5 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 = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" -original_class_hash = "0x6178b645cecd0c483994e4e592dea2c71ed26b2083de2a3e0af55fcf62cb31b" +class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +original_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" 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 67395bf4b3..38bcc45608 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 = "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58" -original_class_hash = "0x564a2ff36752ddda913033318645e313928c7c96dc02efc82f597a66a9c6e58" +class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" +original_class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" 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 670c948d5b..fe94878af2 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 = "0x6e69c6811fcc67953426e123cdd87530e7a27bb4613251fc6182aa9dde75411" -original_class_hash = "0x6e69c6811fcc67953426e123cdd87530e7a27bb4613251fc6182aa9dde75411" +class_hash = "0x8a7f15ef119eb0b44c6b7f30f312dc23619d781173dcfff0e55234bf4a67a3" +original_class_hash = "0x8a7f15ef119eb0b44c6b7f30f312dc23619d781173dcfff0e55234bf4a67a3" 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 f4b75ff1af..9c5159c335 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 = "0x33728d68e7d0d807184b6cb065b608a5145fb4b964c1c0bf3c8a4b92695053e" -original_class_hash = "0x33728d68e7d0d807184b6cb065b608a5145fb4b964c1c0bf3c8a4b92695053e" +class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" +original_class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" 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 b247480140..a70e821a53 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 = "0x4d9dfa45ceeb2fa6051d9cf4fb469ad0354becd3c9830595b941d6fd4eb2202" -original_class_hash = "0x4d9dfa45ceeb2fa6051d9cf4fb469ad0354becd3c9830595b941d6fd4eb2202" +class_hash = "0x1dfb7c80100d8045d0b37d01ee118e057aa04ff98198f43f1b43171acb0ad9e" +original_class_hash = "0x1dfb7c80100d8045d0b37d01ee118e057aa04ff98198f43f1b43171acb0ad9e" 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 c816d200fc..76f81e2739 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 = "0x291252f382a059d3d1fa0c813160c93ccc05f9b5683fa63b8194fe8bed2fcba" -original_class_hash = "0x291252f382a059d3d1fa0c813160c93ccc05f9b5683fa63b8194fe8bed2fcba" +class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" +original_class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" 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 519b624c02..a633e865bf 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 = "0x47f77d27573e12c1441dd65b1a88f4432c1c4ec446241830ff4c33f3f58a44e" -original_class_hash = "0x47f77d27573e12c1441dd65b1a88f4432c1c4ec446241830ff4c33f3f58a44e" +class_hash = "0x61fa996f7cf8412bb5aca7d4bd4fd9eca806a92e5007e87d23f638b6774ed40" +original_class_hash = "0x61fa996f7cf8412bb5aca7d4bd4fd9eca806a92e5007e87d23f638b6774ed40" 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 7810a9e825..524aa7cd98 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 = "0xc88609dbcf23f3610913a55744dd6a211703daa989dfd91e2672dd85c33b4e" -original_class_hash = "0xc88609dbcf23f3610913a55744dd6a211703daa989dfd91e2672dd85c33b4e" +class_hash = "0x5191a56dc5a83bb56969ddb5fcc70dc1ac4ad057d0a054cf555a0023b454923" +original_class_hash = "0x5191a56dc5a83bb56969ddb5fcc70dc1ac4ad057d0a054cf555a0023b454923" 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 1c898edae0..494543b775 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 = "0x2b530adc12f28cdb03e7c9c0b69556b18c4775faedf826879aee9f6113c8c66" -original_class_hash = "0x2b530adc12f28cdb03e7c9c0b69556b18c4775faedf826879aee9f6113c8c66" +class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" +original_class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" 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 20f74a6c02..53fcfab12b 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 = "0x794eb270cb490e228d2710c8a397cfb821461a2796acc6714eca8d8462d7f57" -original_class_hash = "0x794eb270cb490e228d2710c8a397cfb821461a2796acc6714eca8d8462d7f57" +class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" +original_class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" abi = "manifests/release/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/release/base/models/dojo_examples_foes-RiverSkale-39535c12.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_foes-RiverSkale-39535c12.toml index 9a334cd732..933470cf93 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_foes-RiverSkale-39535c12.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_foes-RiverSkale-39535c12.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x273dc20b425570101716086cc3b94073e1762b5aa802c369b9d953d59ebce49" -original_class_hash = "0x273dc20b425570101716086cc3b94073e1762b5aa802c369b9d953d59ebce49" +class_hash = "0x72898823e557f2f3a48026a97b6ec9fed750a4884788751c4c512c6dde0ff3c" +original_class_hash = "0x72898823e557f2f3a48026a97b6ec9fed750a4884788751c4c512c6dde0ff3c" abi = "manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json" tag = "dojo_examples_foes-RiverSkale" manifest_name = "dojo_examples_foes-RiverSkale-39535c12" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml index df6c13214c..2da6333356 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x6bf10689b313619cf163192a65419764462e0be3cbafcfafa83df8763eda82e" -original_class_hash = "0x6bf10689b313619cf163192a65419764462e0be3cbafcfafa83df8763eda82e" +class_hash = "0x5cbece2ac875c6040300d7530bada7a3469a0e8e7584f29fcfaa2626ca1f6de" +original_class_hash = "0x5cbece2ac875c6040300d7530bada7a3469a0e8e7584f29fcfaa2626ca1f6de" abi = "manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json" tag = "dojo_examples_weapons-Flatbow" manifest_name = "dojo_examples_weapons-Flatbow-22f5bd16" diff --git a/examples/spawn-and-move/src/actions.cairo b/examples/spawn-and-move/src/actions.cairo index d073bc36f8..b966441e49 100644 --- a/examples/spawn-and-move/src/actions.cairo +++ b/examples/spawn-and-move/src/actions.cairo @@ -27,8 +27,8 @@ pub mod actions { use starknet::{ContractAddress, get_caller_address}; use dojo_examples::models::{ - Position, Moves, Direction, Vec2, PlayerConfig, PlayerItem, ServerProfile, PositionTrait, - MovesTrait, MovesEntityTrait, PlayerConfigTrait, PlayerConfigEntityTrait + Position, Moves, Direction, Vec2, PlayerConfig, PlayerItem, ServerProfile, PositionStore, + MovesStore, MovesEntityStore, PlayerConfigStore, PlayerConfigEntityStore }; use dojo_examples::utils::next_position; @@ -89,24 +89,25 @@ pub mod actions { let player = get_caller_address(); // instead of using the `get!` macro, you can directly use - // the Trait::get method - let mut position = PositionTrait::get(world, player); + // the Store::get method + let mut position = PositionStore::get(world, player); - // you can also get entity values by entity ID with the `EntityTrait` trait. + // you can also get entity values by entity ID with the `EntityStore` trait. // Note that it returns a `Entity` struct which contains // model values and the entity ID. - let move_id = MovesTrait::entity_id_from_keys(player); - let mut moves = MovesEntityTrait::get(world, move_id); + let move_id = MovesStore::entity_id_from_keys(player); + let mut moves = MovesEntityStore::get(world, move_id); moves.remaining -= 1; moves.last_direction = direction; let next = next_position(position, direction); // instead of using the `set!` macro, you can directly use - // the Trait::set method + // the Store::set method next.set(world); - // you can also update entity values by entity ID with the `EntityTrait` trait. + // you can also update entity values by entity ID with the `EntityStore` + // trait. moves.update(world); emit!(world, (Moved { player, direction })); @@ -129,7 +130,7 @@ pub mod actions { let player = get_caller_address(); let (position, moves) = get!(world, player, (Position, Moves)); - let config = PlayerConfigTrait::get(world, player); + let config = PlayerConfigStore::get(world, player); delete!(world, (position, moves)); config.delete(world); @@ -164,26 +165,26 @@ pub mod actions { let river_skale = RiverSkale { id: 1, health: 5, armor: 3, attack: 2 }; set!(world, (flatbow, river_skale)); - // IDungeonDispatcher { contract_address: dungeon_address }.enter(); + IDungeonDispatcher { contract_address: dungeon_address }.enter(); } fn update_player_name(ref world: IWorldDispatcher, name: ByteArray) { let player = get_caller_address(); - let config = PlayerConfigTrait::get(world, player); + let config = PlayerConfigStore::get(world, player); config.set_name(world, name.clone()); - let new_name = PlayerConfigTrait::get_name(world, player); + let new_name = PlayerConfigStore::get_name(world, player); assert(new_name == name, 'unable to change name'); } fn update_player_name_value(ref world: IWorldDispatcher, name: ByteArray) { let player = get_caller_address(); - let config_id = PlayerConfigTrait::entity_id_from_keys(player); + let config_id = PlayerConfigStore::entity_id_from_keys(player); - let config = PlayerConfigEntityTrait::get(world, config_id); + let config = PlayerConfigEntityStore::get(world, config_id); config.set_name(world, name.clone()); - let new_name = PlayerConfigEntityTrait::get_name(world, config_id); + let new_name = PlayerConfigEntityStore::get_name(world, config_id); assert(new_name == name, 'unable to change name'); } } @@ -213,7 +214,7 @@ pub mod actions { mod tests { use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; - use dojo::test_utils::{spawn_test_world, deploy_contract}; + use dojo::utils::test::{spawn_test_world, deploy_contract}; use super::{actions, IActionsDispatcher, IActionsDispatcherTrait}; use dojo_examples::models::{Position, position, Moves, moves, Direction, Vec2};