diff --git a/crates/dojo-core/src/tests/world/resources.cairo b/crates/dojo-core/src/tests/world/resources.cairo index 94702f02a7..673c7d85af 100644 --- a/crates/dojo-core/src/tests/world/resources.cairo +++ b/crates/dojo-core/src/tests/world/resources.cairo @@ -4,7 +4,7 @@ use dojo::model::{Model, ResourceMetadata}; use dojo::utils::{bytearray_hash, entity_id_from_keys}; use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait, world}; use dojo::world::world::{ - NamespaceRegistered, ModelRegistered, ModelUpgraded, MetadataUpdate, ContractDeployed, + Event, NamespaceRegistered, ModelRegistered, ModelUpgraded, MetadataUpdate, ContractDeployed, ContractUpgraded }; use dojo::contract::{IContractDispatcher, IContractDispatcherTrait}; @@ -51,7 +51,11 @@ fn test_set_metadata_resource_owner() { assert_eq!( starknet::testing::pop_log(world.contract_address), - Option::Some(MetadataUpdate { resource: metadata.resource_id, uri: metadata.metadata_uri }) + Option::Some( + Event::MetadataUpdate( + MetadataUpdate { resource: metadata.resource_id, uri: metadata.metadata_uri } + ) + ) ); } @@ -137,17 +141,22 @@ fn test_register_model_for_namespace_owner() { starknet::testing::set_contract_address(bob); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - let event = starknet::testing::pop_log::(world.contract_address); - - assert(event.is_some(), 'no ModelRegistered event'); - let event = event.unwrap(); - assert(event.name == Model::::name(), 'bad model name'); - assert(event.namespace == Model::::namespace(), 'bad model namespace'); - assert(event.class_hash == foo::TEST_CLASS_HASH.try_into().unwrap(), 'bad model class_hash'); - assert( - event.address != core::num::traits::Zero::::zero(), - 'bad model prev address' - ); + let event = starknet::testing::pop_log::(world.contract_address); + assert(event.is_some(), 'no event)'); + + if let Event::ModelRegistered(event) = event.unwrap() { + assert(event.name == Model::::name(), 'bad model name'); + assert(event.namespace == Model::::namespace(), 'bad model namespace'); + assert( + event.class_hash == foo::TEST_CLASS_HASH.try_into().unwrap(), 'bad model class_hash' + ); + assert( + event.address != core::num::traits::Zero::::zero(), + 'bad model prev address' + ); + } else { + core::panic_with_felt252('no ModelRegistered event'); + } assert(world.is_owner(Model::::selector(), bob), 'bob is not the owner'); } @@ -165,17 +174,22 @@ fn test_register_model_for_namespace_writer() { starknet::testing::set_contract_address(bob); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - let event = starknet::testing::pop_log::(world.contract_address); - - assert(event.is_some(), 'no ModelRegistered event'); - let event = event.unwrap(); - assert(event.name == Model::::name(), 'bad model name'); - assert(event.namespace == Model::::namespace(), 'bad model namespace'); - assert(event.class_hash == foo::TEST_CLASS_HASH.try_into().unwrap(), 'bad model class_hash'); - assert( - event.address != core::num::traits::Zero::::zero(), - 'bad model prev address' - ); + let event = starknet::testing::pop_log::(world.contract_address); + assert(event.is_some(), 'no event)'); + + if let Event::ModelRegistered(event) = event.unwrap() { + assert(event.name == Model::::name(), 'bad model name'); + assert(event.namespace == Model::::namespace(), 'bad model namespace'); + assert( + event.class_hash == foo::TEST_CLASS_HASH.try_into().unwrap(), 'bad model class_hash' + ); + assert( + event.address != core::num::traits::Zero::::zero(), + 'bad model prev address' + ); + } else { + core::panic_with_felt252('no ModelRegistered event'); + } assert(world.is_owner(Model::::selector(), bob), 'bob is not the owner'); } @@ -195,17 +209,22 @@ fn test_upgrade_model_from_model_owner() { world.upgrade_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - let event = starknet::testing::pop_log::(world.contract_address); - - assert(event.is_some(), 'no ModelRegistered event'); - let event = event.unwrap(); - assert(event.name == Model::::name(), 'bad model name'); - assert(event.namespace == Model::::namespace(), 'bad model namespace'); - assert(event.class_hash == foo::TEST_CLASS_HASH.try_into().unwrap(), 'bad model class_hash'); - assert( - event.address != core::num::traits::Zero::::zero(), - 'bad model prev address' - ); + let event = starknet::testing::pop_log::(world.contract_address); + assert(event.is_some(), 'no event)'); + + if let Event::ModelUpgraded(event) = event.unwrap() { + assert(event.name == Model::::name(), 'bad model name'); + assert(event.namespace == Model::::namespace(), 'bad model namespace'); + assert( + event.class_hash == foo::TEST_CLASS_HASH.try_into().unwrap(), 'bad model class_hash' + ); + assert( + event.address != core::num::traits::Zero::::zero(), + 'bad model prev address' + ); + } else { + core::panic_with_felt252('no ModelRegistered event'); + } assert(world.is_owner(Model::::selector(), bob), 'bob is not the owner'); } @@ -291,13 +310,14 @@ fn test_register_namespace() { let namespace = "namespace"; let hash = bytearray_hash(@namespace); - world.register_namespace(namespace); + world.register_namespace(namespace.clone()); assert(world.is_owner(hash, bob), 'namespace not registered'); + let expected_event = NamespaceRegistered { namespace, hash }; assert_eq!( starknet::testing::pop_log(world.contract_address), - Option::Some(NamespaceRegistered { namespace: "namespace", hash }) + Option::Some(Event::NamespaceRegistered(expected_event)) ); } @@ -349,16 +369,21 @@ fn test_deploy_contract_for_namespace_owner() { let contract_address = world.deploy_contract('salt1', class_hash); let dispatcher = IContractDispatcher { contract_address }; - let event = starknet::testing::pop_log::(world.contract_address); - assert(event.is_some(), 'no ContractDeployed event'); - let event = event.unwrap(); - assert(event.salt == 'salt1', 'bad event salt'); - assert(event.class_hash == class_hash, 'bad class_hash'); - assert(event.name == dispatcher.contract_name(), 'bad contract name'); - assert(event.namespace == dispatcher.namespace(), 'bad namespace'); - assert( - event.address != core::num::traits::Zero::::zero(), 'bad contract address' - ); + let event = starknet::testing::pop_log::(world.contract_address); + assert(event.is_some(), 'no event)'); + + if let Event::ContractDeployed(event) = event.unwrap() { + assert(event.salt == 'salt1', 'bad event salt'); + assert(event.class_hash == class_hash, 'bad class_hash'); + assert(event.name == dispatcher.contract_name(), 'bad contract name'); + assert(event.namespace == dispatcher.namespace(), 'bad namespace'); + assert( + event.address != core::num::traits::Zero::::zero(), + 'bad contract address' + ); + } else { + core::panic_with_felt252('no ContractDeployed event'); + }; } #[test] @@ -437,13 +462,18 @@ fn test_upgrade_contract_from_resource_owner() { world.upgrade_contract(dispatcher.selector(), class_hash); - let event = starknet::testing::pop_log::(world.contract_address); - assert(event.is_some(), 'no ContractUpgraded event'); - let event = event.unwrap(); - assert(event.class_hash == class_hash, 'bad class_hash'); - assert( - event.address != core::num::traits::Zero::::zero(), 'bad contract address' - ); + let event = starknet::testing::pop_log::(world.contract_address); + assert(event.is_some(), 'no event)'); + + if let Event::ContractUpgraded(event) = event.unwrap() { + assert(event.class_hash == class_hash, 'bad class_hash'); + assert( + event.address != core::num::traits::Zero::::zero(), + 'bad contract address' + ); + } else { + core::panic_with_felt252('no ContractUpgraded event'); + }; } #[test] diff --git a/crates/dojo-core/src/world/world_contract.cairo b/crates/dojo-core/src/world/world_contract.cairo index c43cea508e..40b08e8ecd 100644 --- a/crates/dojo-core/src/world/world_contract.cairo +++ b/crates/dojo-core/src/world/world_contract.cairo @@ -140,7 +140,7 @@ pub mod world { impl ConfigInternalImpl = Config::InternalImpl; #[event] - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub enum Event { WorldSpawned: WorldSpawned, ContractDeployed: ContractDeployed, @@ -158,36 +158,44 @@ pub mod world { WriterUpdated: WriterUpdated, OwnerUpdated: OwnerUpdated, ConfigEvent: Config::Event, - StateUpdated: StateUpdated + StateUpdated: StateUpdated, + // Dojo System Events are emitted by the `emit!` macro. + // The selector is fixed to `selector!("dojo_core::event::SYSTEM_EVENT_SELECTOR")` and + // should not be used directly in this enumeration. } - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct StateUpdated { pub da_hash: felt252, } - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct WorldSpawned { pub address: ContractAddress, + #[key] pub creator: ContractAddress } - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct WorldUpgraded { pub class_hash: ClassHash, } #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct ContractDeployed { - pub salt: felt252, + #[key] pub class_hash: ClassHash, - pub address: ContractAddress, + #[key] pub namespace: ByteArray, - pub name: ByteArray + #[key] + pub name: ByteArray, + pub salt: felt252, + pub address: ContractAddress, } #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct ContractUpgraded { + #[key] pub class_hash: ClassHash, pub address: ContractAddress, } @@ -200,19 +208,23 @@ pub mod world { #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct MetadataUpdate { + #[key] pub resource: felt252, pub uri: ByteArray } #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct NamespaceRegistered { + #[key] pub namespace: ByteArray, pub hash: felt252 } #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct ModelRegistered { + #[key] pub name: ByteArray, + #[key] pub namespace: ByteArray, pub class_hash: ClassHash, pub address: ContractAddress, @@ -228,44 +240,57 @@ pub mod world { pub prev_address: ContractAddress, } - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct StoreSetRecord { + #[key] pub table: felt252, + #[key] pub keys: Span, pub values: Span, } - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct StoreUpdateRecord { + #[key] pub table: felt252, + #[key] pub entity_id: felt252, pub values: Span, } - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct StoreUpdateMember { + #[key] pub table: felt252, + #[key] pub entity_id: felt252, + #[key] pub member_selector: felt252, pub values: Span, } - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct StoreDelRecord { + #[key] pub table: felt252, + #[key] pub entity_id: felt252, } - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct WriterUpdated { + #[key] pub resource: felt252, + #[key] pub contract: ContractAddress, pub value: bool } - #[derive(Drop, starknet::Event)] + #[derive(Drop, starknet::Event, Debug, PartialEq)] pub struct OwnerUpdated { + #[key] pub address: ContractAddress, + #[key] pub resource: felt252, pub value: bool, } diff --git a/crates/dojo-lang/src/event.rs b/crates/dojo-lang/src/event.rs index 4058d93759..01b32e4ec9 100644 --- a/crates/dojo-lang/src/event.rs +++ b/crates/dojo-lang/src/event.rs @@ -9,6 +9,7 @@ use cairo_lang_starknet_classes::abi::EventFieldKind; use cairo_lang_syntax::node::db::SyntaxGroup; use cairo_lang_syntax::node::helpers::QueryAttrs; use cairo_lang_syntax::node::{ast, Terminal, TypedStablePtr, TypedSyntaxNode}; +use dojo_types::event::SYSTEM_EVENT_SELECTOR; use indoc::formatdoc; use crate::plugin::DojoAuxData; @@ -75,6 +76,9 @@ pub fn handle_event_struct( ( // Append the event selector using the struct_name for the selector // and then append the members. + // + // The first key of a dojo event will be the selector for SYSTEM_EVENT_SELECTOR, + // to distinguish them from starknet events. RewriteNode::interpolate_patched( &formatdoc!( " @@ -83,6 +87,8 @@ pub fn handle_event_struct( self: @$struct_name$, ref keys: Array, ref data: Array ) {{ core::array::ArrayTrait::append(ref keys, \ + selector!(\"{SYSTEM_EVENT_SELECTOR}\")); + core::array::ArrayTrait::append(ref keys, \ dojo::model::Model::<$struct_name$>::selector()); $append_members$ }} 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 897b4d959c..6fd1873630 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 @@ -749,7 +749,7 @@ { "name": "creator", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" } ] }, @@ -758,29 +758,29 @@ "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ - { - "name": "salt", - "type": "core::felt252", - "kind": "data" - }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "name", "type": "core::byte_array::ByteArray", + "kind": "key" + }, + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", "kind": "data" } ] @@ -793,7 +793,7 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" + "kind": "key" }, { "name": "address", @@ -839,7 +839,7 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "uri", @@ -856,7 +856,7 @@ { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "hash", @@ -873,12 +873,12 @@ { "name": "name", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "class_hash", @@ -937,12 +937,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "keys", "type": "core::array::Span::", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -959,12 +959,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -981,17 +981,17 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "member_selector", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -1008,12 +1008,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" } ] }, @@ -1025,12 +1025,12 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "contract", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "value", @@ -1047,12 +1047,12 @@ { "name": "address", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "value", 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 2b3b1409df..266d7972da 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 = "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597" -original_class_hash = "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597" +class_hash = "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6" +original_class_hash = "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/crates/dojo-types/src/event.rs b/crates/dojo-types/src/event.rs index 9693676840..3ba0c3c8be 100644 --- a/crates/dojo-types/src/event.rs +++ b/crates/dojo-types/src/event.rs @@ -1,5 +1,7 @@ use starknet::core::types::Felt; +pub const SYSTEM_EVENT_SELECTOR: &str = "SystemEvent__"; + /// The event emitted when a World is spawned. #[derive(Clone, Debug)] pub struct WorldSpawned { diff --git a/crates/dojo-world/src/contracts/abi/world.rs b/crates/dojo-world/src/contracts/abi/world.rs index 21f17dcef3..de037504d0 100644 --- a/crates/dojo-world/src/contracts/abi/world.rs +++ b/crates/dojo-world/src/contracts/abi/world.rs @@ -755,7 +755,7 @@ abigen!( { "name": "creator", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" } ] }, @@ -764,29 +764,29 @@ abigen!( "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ - { - "name": "salt", - "type": "core::felt252", - "kind": "data" - }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "name", "type": "core::byte_array::ByteArray", + "kind": "key" + }, + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", "kind": "data" } ] @@ -799,7 +799,7 @@ abigen!( { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" + "kind": "key" }, { "name": "address", @@ -845,7 +845,7 @@ abigen!( { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "uri", @@ -862,7 +862,7 @@ abigen!( { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "hash", @@ -879,12 +879,12 @@ abigen!( { "name": "name", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "class_hash", @@ -943,12 +943,12 @@ abigen!( { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "keys", "type": "core::array::Span::", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -965,12 +965,12 @@ abigen!( { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -987,17 +987,17 @@ abigen!( { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "member_selector", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -1014,12 +1014,12 @@ abigen!( { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" } ] }, @@ -1031,12 +1031,12 @@ abigen!( { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "contract", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "value", @@ -1053,12 +1053,12 @@ abigen!( { "name": "address", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "value", diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index 33d4f69009..a7899e050c 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -119,9 +119,9 @@ fn parse_deployed_contracts_events_without_upgrade() { ]; let events = vec![ - build_deploy_event(vec![felt!("0x0"), felt!("0x1"), felt!("0x123")], "ns1", "c1"), - build_deploy_event(vec![felt!("0x0"), felt!("0x2"), felt!("0x456")], "ns2", "c2"), - build_deploy_event(vec![felt!("0x0"), felt!("0x3"), felt!("0x789")], "ns3", "c3"), + build_deploy_event(vec![felt!("0x0"), felt!("0x123")], felt!("0x1"), "ns1", "c1"), + build_deploy_event(vec![felt!("0x0"), felt!("0x456")], felt!("0x2"), "ns2", "c2"), + build_deploy_event(vec![felt!("0x0"), felt!("0x789")], felt!("0x3"), "ns3", "c3"), ]; let actual_contracts = parse_contracts_events(events, vec![], vec![]); @@ -161,39 +161,39 @@ fn parse_deployed_contracts_events_with_upgrade() { ]; let deployed_events = vec![ - build_deploy_event(vec![felt!("0x0"), felt!("0x1"), felt!("0x123")], "ns1", "c1"), - build_deploy_event(vec![felt!("0x0"), felt!("0x2"), felt!("0x456")], "ns2", "c2"), - build_deploy_event(vec![felt!("0x0"), felt!("0x3"), felt!("0x789")], "ns3", "c3"), + build_deploy_event(vec![felt!("0x0"), felt!("0x123")], felt!("0x1"), "ns1", "c1"), + build_deploy_event(vec![felt!("0x0"), felt!("0x456")], felt!("0x2"), "ns2", "c2"), + build_deploy_event(vec![felt!("0x0"), felt!("0x789")], felt!("0x3"), "ns3", "c3"), ]; let upgrade_events = vec![ EmittedEvent { - data: vec![felt!("0x66"), felt!("0x123")], - keys: vec![], + data: vec![felt!("0x123")], + keys: vec![felt!("0x66")], block_number: Some(2), block_hash: Default::default(), from_address: Default::default(), transaction_hash: Default::default(), }, EmittedEvent { - data: vec![felt!("0x69"), felt!("0x123")], - keys: vec![], + data: vec![felt!("0x123")], + keys: vec![felt!("0x69")], block_number: Some(9), block_hash: Default::default(), from_address: Default::default(), transaction_hash: Default::default(), }, EmittedEvent { - data: vec![felt!("0x77"), felt!("0x123")], - keys: vec![], + data: vec![felt!("0x123")], + keys: vec![felt!("0x77")], block_number: Some(5), block_hash: Default::default(), from_address: Default::default(), transaction_hash: Default::default(), }, EmittedEvent { - data: vec![felt!("0x88"), felt!("0x789")], - keys: vec![], + data: vec![felt!("0x789")], + keys: vec![felt!("0x88")], block_number: Some(5), block_hash: Default::default(), from_address: Default::default(), @@ -238,9 +238,9 @@ fn events_without_block_number_arent_parsed() { ]; let deployed_events = vec![ - build_deploy_event(vec![felt!("0x0"), felt!("0x1"), felt!("0x123")], "ns1", "c1"), - build_deploy_event(vec![felt!("0x0"), felt!("0x2"), felt!("0x456")], "ns2", "c2"), - build_deploy_event(vec![felt!("0x0"), felt!("0x3"), felt!("0x789")], "ns3", "c3"), + build_deploy_event(vec![felt!("0x0"), felt!("0x123")], felt!("0x1"), "ns1", "c1"), + build_deploy_event(vec![felt!("0x0"), felt!("0x456")], felt!("0x2"), "ns2", "c2"), + build_deploy_event(vec![felt!("0x0"), felt!("0x789")], felt!("0x3"), "ns3", "c3"), ]; // only the first upgrade event has a block number and is parsed @@ -248,32 +248,32 @@ fn events_without_block_number_arent_parsed() { // and are not evaluated when parsing the remote contracts let upgrade_events = vec![ EmittedEvent { - data: vec![felt!("0x66"), felt!("0x123")], - keys: vec![], + data: vec![felt!("0x123")], + keys: vec![felt!("0x66")], block_number: Some(2), block_hash: Default::default(), from_address: Default::default(), transaction_hash: Default::default(), }, EmittedEvent { - data: vec![felt!("0x69"), felt!("0x123")], - keys: vec![], + data: vec![felt!("0x123")], + keys: vec![felt!("0x69")], block_number: None, block_hash: Default::default(), from_address: Default::default(), transaction_hash: Default::default(), }, EmittedEvent { - data: vec![felt!("0x77"), felt!("0x123")], - keys: vec![], + data: vec![felt!("0x123")], + keys: vec![felt!("0x77")], block_number: None, block_hash: Default::default(), from_address: Default::default(), transaction_hash: Default::default(), }, EmittedEvent { - data: vec![felt!("0x88"), felt!("0x789")], - keys: vec![], + data: vec![felt!("0x789")], + keys: vec![felt!("0x88")], block_number: None, block_hash: Default::default(), from_address: Default::default(), @@ -618,13 +618,13 @@ fn serialize_bytearray(s: &str) -> Vec { } fn build_model_registered_event(values: Vec, namespace: &str, model: &str) -> EmittedEvent { - let mut data = ByteArray::cairo_serialize(&ByteArray::from_string(model).unwrap()); - data.extend(ByteArray::cairo_serialize(&ByteArray::from_string(namespace).unwrap())); - data.extend(values); + let mut keys = vec![selector!("ModelRegistered")]; + keys.extend(ByteArray::cairo_serialize(&ByteArray::from_string(model).unwrap())); + keys.extend(ByteArray::cairo_serialize(&ByteArray::from_string(namespace).unwrap())); EmittedEvent { - data, - keys: vec![selector!("ModelRegistered")], + data: values, + keys, block_hash: Default::default(), from_address: Default::default(), block_number: Default::default(), @@ -632,14 +632,14 @@ fn build_model_registered_event(values: Vec, namespace: &str, model: &str) } } -fn build_deploy_event(values: Vec, ns: &str, name: &str) -> EmittedEvent { - let mut data = values.to_vec(); - data.extend(serialize_bytearray(ns).iter()); - data.extend(serialize_bytearray(name).iter()); +fn build_deploy_event(values: Vec, class_hash: Felt, ns: &str, name: &str) -> EmittedEvent { + let mut keys = vec![selector!("ContractDeployed"), class_hash]; + keys.extend(serialize_bytearray(ns).iter()); + keys.extend(serialize_bytearray(name).iter()); EmittedEvent { - data, - keys: vec![], + data: values, + keys, block_hash: Default::default(), from_address: Default::default(), block_number: Default::default(), diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index 9497a582ab..c6b8424355 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -578,10 +578,13 @@ fn parse_contracts_events( // system -> (block_num, (resource -> perm)) let mut grants: HashMap)> = HashMap::new(); events.into_iter().for_each(|event| { + let mut keys = event.keys.into_iter(); let mut data = event.data.into_iter(); let block_num = event.block_number; - let resource = data.next().expect("resource is missing from event"); - let contract = data.next().expect("contract is missing from event"); + + let resource = keys.next().expect("resource is missing from event"); + let contract = keys.next().expect("contract is missing from event"); + let value = data.next().expect("value is missing from event"); let value = !value.is_zero(); @@ -623,9 +626,11 @@ fn parse_contracts_events( events.into_iter().for_each(|event| { let mut data = event.data.into_iter(); + let mut keys = event.keys.into_iter(); let block_num = event.block_number; - let class_hash = data.next().expect("qed; missing class hash"); + let class_hash = keys.next().expect("qed; missing class hash"); + let address = data.next().expect("qed; missing address"); // Events that do not have a block number are ignored because we are unable to evaluate @@ -653,12 +658,16 @@ fn parse_contracts_events( .into_iter() .map(|event| { let mut data = event.data.into_iter(); + let mut keys = event.keys.into_iter(); + + // Skip the event selector. + let _ = keys.next().expect("Keys must contains at least the event selector"); let _ = data.next().expect("salt is missing from event"); - let mut class_hash = data.next().expect("class hash is missing from event"); - let address = data.next().expect("addresss is missing from event"); + let address = data.next().expect("address is missing from event"); - let str_data = data.as_slice(); + let mut class_hash = keys.next().expect("class hash is missing from event"); + let str_data = keys.as_slice(); let namespace = ByteArray::cairo_deserialize(str_data, 0).expect("namespace is missing from event"); let offset = ByteArray::cairo_serialized_size(&namespace); diff --git a/crates/sozo/ops/src/tests/model.rs b/crates/sozo/ops/src/tests/model.rs index 3b369b8928..571fad2e4d 100644 --- a/crates/sozo/ops/src/tests/model.rs +++ b/crates/sozo/ops/src/tests/model.rs @@ -58,7 +58,8 @@ async fn test_model_ops() { ) .await .unwrap(), - Felt::from_hex("0x5581faa4aa9c7cf1903a7e07f28707a0a599b602ca13f3d2f88d68322e240d").unwrap() + Felt::from_hex("0x73d1ddd4238638723f2db9b10787b282b7ff685de98db3ce676b6ca891a8829") + .unwrap() ); let layout = diff --git a/crates/torii/core/src/processors/event_message.rs b/crates/torii/core/src/processors/event_message.rs index e2044cbe1a..b8e62a69dc 100644 --- a/crates/torii/core/src/processors/event_message.rs +++ b/crates/torii/core/src/processors/event_message.rs @@ -1,9 +1,10 @@ use anyhow::{Error, Result}; use async_trait::async_trait; +use dojo_types::event::SYSTEM_EVENT_SELECTOR; use dojo_world::contracts::world::WorldContractReader; use starknet::core::types::Event; use starknet::providers::Provider; -use tracing::info; +use tracing::{info, warn}; use super::EventProcessor; use crate::processors::MODEL_INDEX; @@ -20,14 +21,14 @@ where P: Provider + Send + Sync + std::fmt::Debug, { fn event_key(&self) -> String { - "".to_string() + SYSTEM_EVENT_SELECTOR.to_string() } fn validate(&self, event: &Event) -> bool { // we expect at least 3 keys - // 1: event selector - // 2: model keys, arbitrary length - // last key: system key + // 1: SYSTEM_EVENT_SELECTOR + // 2: Event selector + // 3: The last key must be the system address if event.keys.len() < 3 { return false; } @@ -47,7 +48,14 @@ where // silently ignore if the model is not found let model = match db.model(event.keys[MODEL_INDEX]).await { Ok(model) => model, - Err(_) => return Ok(()), + Err(_) => { + warn!( + target: LOG_TARGET, + model = %event.keys[MODEL_INDEX], + "System event model not found." + ); + return Ok(()); + } }; info!( @@ -56,10 +64,11 @@ where "Store event message." ); - // skip the first key, as its the event selector + // skip the two first keys, as its the SYSTEM_EVENT_SELECTOR and the event selector // and dont include last key as its the system key let mut keys_and_unpacked = - [event.keys[1..event.keys.len() - 1].to_vec(), event.data.clone()].concat(); + [event.keys[MODEL_INDEX + 1..event.keys.len() - 1].to_vec(), event.data.clone()] + .concat(); let mut entity = model.schema.clone(); entity.deserialize(&mut keys_and_unpacked)?; diff --git a/crates/torii/core/src/processors/metadata_update.rs b/crates/torii/core/src/processors/metadata_update.rs index 594a32898a..2efc545088 100644 --- a/crates/torii/core/src/processors/metadata_update.rs +++ b/crates/torii/core/src/processors/metadata_update.rs @@ -35,7 +35,8 @@ where } fn validate(&self, event: &Event) -> bool { - if event.keys.len() > 1 { + // The keys should be the selector and the resource. + if event.keys.len() != 2 { info!( target: LOG_TARGET, event_key = %>::event_key(self), @@ -56,8 +57,8 @@ where _event_id: &str, event: &Event, ) -> Result<(), Error> { - let resource = &event.data[0]; - let uri_str = ByteArray::cairo_deserialize(&event.data, 1)?.to_string()?; + let resource = &event.keys[1]; + let uri_str = ByteArray::cairo_deserialize(&event.data, 0)?.to_string()?; info!( target: LOG_TARGET, resource = %format!("{:#x}", resource), diff --git a/crates/torii/core/src/processors/mod.rs b/crates/torii/core/src/processors/mod.rs index e9e29f7766..2bfcb3c081 100644 --- a/crates/torii/core/src/processors/mod.rs +++ b/crates/torii/core/src/processors/mod.rs @@ -15,9 +15,7 @@ pub mod store_transaction; pub mod store_update_member; pub mod store_update_record; -const MODEL_INDEX: usize = 0; -const NUM_KEYS_INDEX: usize = 1; -const ENTITY_ID_INDEX: usize = 1; +const MODEL_INDEX: usize = 1; #[async_trait] pub trait EventProcessor

diff --git a/crates/torii/core/src/processors/register_model.rs b/crates/torii/core/src/processors/register_model.rs index 369357a243..34832846a5 100644 --- a/crates/torii/core/src/processors/register_model.rs +++ b/crates/torii/core/src/processors/register_model.rs @@ -25,7 +25,11 @@ where } fn validate(&self, event: &Event) -> bool { - if event.keys.len() > 1 { + // 7 is expected because we have: + // 0: event selector + // 1-3: name (bytearray, at least 3 felts) + // 4-6: namespace (bytearray, at least 3 felts) + if event.keys.len() < 7 { info!( target: LOG_TARGET, event_key = %>::event_key(self), @@ -46,10 +50,11 @@ where _event_id: &str, event: &Event, ) -> Result<(), Error> { - let name = ByteArray::cairo_deserialize(&event.data, 0)?; - let mut offset = ByteArray::cairo_serialized_size(&name); - let namespace = ByteArray::cairo_deserialize(&event.data, offset)?; - offset += ByteArray::cairo_serialized_size(&namespace); + // First key is always the event selector. + let mut offset = 1; + let name = ByteArray::cairo_deserialize(&event.keys, offset)?; + offset += ByteArray::cairo_serialized_size(&name); + let namespace = ByteArray::cairo_deserialize(&event.keys, offset)?; let name = name.to_string()?; let namespace = namespace.to_string()?; @@ -61,8 +66,8 @@ where let unpacked_size: u32 = model.unpacked_size().await?; let packed_size: u32 = model.packed_size().await?; - let class_hash = event.data[offset]; - let contract_address = event.data[offset + 1]; + let class_hash = event.data[0]; + let contract_address = event.data[1]; info!( target: LOG_TARGET, diff --git a/crates/torii/core/src/processors/store_del_record.rs b/crates/torii/core/src/processors/store_del_record.rs index 46e43c4f1e..2709f3222c 100644 --- a/crates/torii/core/src/processors/store_del_record.rs +++ b/crates/torii/core/src/processors/store_del_record.rs @@ -6,7 +6,7 @@ use starknet::providers::Provider; use tracing::info; use super::EventProcessor; -use crate::processors::{ENTITY_ID_INDEX, MODEL_INDEX}; +use crate::processors::MODEL_INDEX; use crate::sql::Sql; pub(crate) const LOG_TARGET: &str = "torii_core::processors::store_del_record"; @@ -24,7 +24,11 @@ where } fn validate(&self, event: &Event) -> bool { - if event.keys.len() > 1 { + // At least 3: + // 0: Event selector + // 1: table + // 2: entity_id + if event.keys.len() != 3 { info!( target: LOG_TARGET, event_key = %>::event_key(self), @@ -45,7 +49,9 @@ where event_id: &str, event: &Event, ) -> Result<(), Error> { - let selector = event.data[MODEL_INDEX]; + let mut offset = MODEL_INDEX; + let selector = event.keys[offset]; + offset += 1; let model = db.model(selector).await?; @@ -55,7 +61,7 @@ where "Store delete record." ); - let entity_id = event.data[ENTITY_ID_INDEX]; + let entity_id = event.keys[offset]; let entity = model.schema; db.delete_entity(entity_id, entity, event_id, block_timestamp).await?; diff --git a/crates/torii/core/src/processors/store_set_record.rs b/crates/torii/core/src/processors/store_set_record.rs index 0dfd0cde45..d0a0117b95 100644 --- a/crates/torii/core/src/processors/store_set_record.rs +++ b/crates/torii/core/src/processors/store_set_record.rs @@ -1,13 +1,12 @@ -use anyhow::{Context, Error, Ok, Result}; +use anyhow::{Error, Ok, Result}; use async_trait::async_trait; use dojo_world::contracts::world::WorldContractReader; -use num_traits::ToPrimitive; use starknet::core::types::Event; use starknet::providers::Provider; -use tracing::info; +use tracing::{info, warn}; use super::EventProcessor; -use crate::processors::{MODEL_INDEX, NUM_KEYS_INDEX}; +use crate::processors::MODEL_INDEX; use crate::sql::Sql; pub(crate) const LOG_TARGET: &str = "torii_core::processors::store_set_record"; @@ -25,8 +24,12 @@ where } fn validate(&self, event: &Event) -> bool { - if event.keys.len() > 1 { - info!( + // At least 3: + // 0: Event selector + // 1: table + // 2: keys (span, at least 1 felt) + if event.keys.len() < 3 { + warn!( target: LOG_TARGET, event_key = %>::event_key(self), invalid_keys = %>::event_keys_as_string(self, event), @@ -46,9 +49,11 @@ where event_id: &str, event: &Event, ) -> Result<(), Error> { - let selector = event.data[MODEL_INDEX]; + let mut offset = MODEL_INDEX; + let model_selector = event.keys[offset]; + offset += 1; - let model = db.model(selector).await?; + let model = db.model(model_selector).await?; info!( target: LOG_TARGET, @@ -56,19 +61,14 @@ where "Store set record.", ); - let keys_start = NUM_KEYS_INDEX + 1; - let keys_end: usize = - keys_start + event.data[NUM_KEYS_INDEX].to_usize().context("invalid usize")?; - let keys = event.data[keys_start..keys_end].to_vec(); + // Skip the length to only get the keys as they will be deserialized. + offset += 1; + let keys = event.keys[offset..].to_vec(); - // keys_end is already the length of the values array. - - let values_start = keys_end + 1; - let values_end: usize = - values_start + event.data[keys_end].to_usize().context("invalid usize")?; - - let values = event.data[values_start..values_end].to_vec(); - let mut keys_and_unpacked = [keys, values].concat(); + // Values are serialized as a span. We need to skip the first key which is the + // length of the serialized span to only consider the data. + let data = event.data[1..].to_vec(); + let mut keys_and_unpacked = [keys, data].concat(); let mut entity = model.schema; entity.deserialize(&mut keys_and_unpacked)?; diff --git a/crates/torii/core/src/processors/store_update_member.rs b/crates/torii/core/src/processors/store_update_member.rs index 01f1c92c95..ac17ea2315 100644 --- a/crates/torii/core/src/processors/store_update_member.rs +++ b/crates/torii/core/src/processors/store_update_member.rs @@ -2,20 +2,17 @@ use anyhow::{Context, Error, Result}; use async_trait::async_trait; use dojo_world::contracts::naming; use dojo_world::contracts::world::WorldContractReader; -use num_traits::ToPrimitive; use starknet::core::types::Event; use starknet::core::utils::get_selector_from_name; use starknet::providers::Provider; use tracing::{info, warn}; use super::EventProcessor; -use crate::processors::{ENTITY_ID_INDEX, MODEL_INDEX}; +use crate::processors::MODEL_INDEX; use crate::sql::Sql; pub(crate) const LOG_TARGET: &str = "torii_core::processors::store_update_member"; -const MEMBER_INDEX: usize = 2; - #[derive(Default, Debug)] pub struct StoreUpdateMemberProcessor; @@ -29,8 +26,13 @@ where } fn validate(&self, event: &Event) -> bool { - if event.keys.len() > 1 { - info!( + // At least 4: + // 0: Event selector + // 1: table + // 2: entity_id + // 3: member selector + if event.keys.len() < 4 { + warn!( target: LOG_TARGET, event_key = %>::event_key(self), invalid_keys = %>::event_keys_as_string(self, event), @@ -50,9 +52,14 @@ where event_id: &str, event: &Event, ) -> Result<(), Error> { - let selector = event.data[MODEL_INDEX]; - let entity_id = event.data[ENTITY_ID_INDEX]; - let member_selector = event.data[MEMBER_INDEX]; + let mut offset = MODEL_INDEX; + let selector = event.keys[offset]; + offset += 1; + + let entity_id = event.keys[offset]; + offset += 1; + + let member_selector = event.keys[offset]; let model = db.model(selector).await?; let schema = model.schema; @@ -77,12 +84,8 @@ where "Store update member.", ); - let values_start = MEMBER_INDEX + 1; - let values_end: usize = - values_start + event.data[values_start].to_usize().context("invalid usize")?; - // Skip the length to only get the values as they will be deserialized. - let mut values = event.data[values_start + 1..=values_end].to_vec(); + let mut values = event.data[1..].to_vec(); let tag = naming::get_tag(&model.namespace, &model.name); diff --git a/crates/torii/core/src/processors/store_update_record.rs b/crates/torii/core/src/processors/store_update_record.rs index df2d99a723..8cbae67421 100644 --- a/crates/torii/core/src/processors/store_update_record.rs +++ b/crates/torii/core/src/processors/store_update_record.rs @@ -1,14 +1,13 @@ -use anyhow::{Context, Error, Ok, Result}; +use anyhow::{Error, Ok, Result}; use async_trait::async_trait; use dojo_world::contracts::naming; use dojo_world::contracts::world::WorldContractReader; -use num_traits::ToPrimitive; use starknet::core::types::Event; use starknet::providers::Provider; -use tracing::info; +use tracing::{info, warn}; use super::EventProcessor; -use crate::processors::{ENTITY_ID_INDEX, MODEL_INDEX}; +use crate::processors::MODEL_INDEX; use crate::sql::Sql; pub(crate) const LOG_TARGET: &str = "torii_core::processors::store_update_record"; @@ -26,8 +25,12 @@ where } fn validate(&self, event: &Event) -> bool { - if event.keys.len() > 1 { - info!( + // At least 3: + // 0: Event selector + // 1: table + // 2: entity id + if event.keys.len() < 3 { + warn!( target: LOG_TARGET, event_key = %>::event_key(self), invalid_keys = %>::event_keys_as_string(self, event), @@ -47,8 +50,11 @@ where event_id: &str, event: &Event, ) -> Result<(), Error> { - let selector = event.data[MODEL_INDEX]; - let entity_id = event.data[ENTITY_ID_INDEX]; + let mut offset = MODEL_INDEX; + let selector = event.keys[offset]; + offset += 1; + + let entity_id = event.keys[offset]; let model = db.model(selector).await?; @@ -59,12 +65,8 @@ where "Store update record.", ); - let values_start = ENTITY_ID_INDEX + 1; - let values_end: usize = - values_start + event.data[values_start].to_usize().context("invalid usize")?; - // Skip the length to only get the values as they will be deserialized. - let values = event.data[values_start + 1..=values_end].to_vec(); + let values = event.data[1..].to_vec(); let tag = naming::get_tag(&model.namespace, &model.name); diff --git a/examples/spawn-and-move/dojo_dev.toml b/examples/spawn-and-move/dojo_dev.toml index b468dae76b..6c846e2a16 100644 --- a/examples/spawn-and-move/dojo_dev.toml +++ b/examples/spawn-and-move/dojo_dev.toml @@ -14,4 +14,4 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x6a5152f02567ffb01e5da73a92253dacd50f74932e1a87f3cb58723237a6dda" +world_address = "0x3ec9d15f66dd4d3470fdc87ce7a6b89db67ab05f74ebec45177b5c2caaeafc0" diff --git a/examples/spawn-and-move/dojo_release.toml b/examples/spawn-and-move/dojo_release.toml index 053cc2118e..2876678669 100644 --- a/examples/spawn-and-move/dojo_release.toml +++ b/examples/spawn-and-move/dojo_release.toml @@ -14,7 +14,7 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x577ff0295103774d1bedd597a1c5673670eea0bb2cdeba6b8205d79396825b3" +world_address = "0x3029b5ee7b2f42d51ef14ce18c18131396d8037f3c44ce018b7798a518f4cd9" [migration] skip_contracts = [ 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 897b4d959c..6fd1873630 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 @@ -749,7 +749,7 @@ { "name": "creator", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" } ] }, @@ -758,29 +758,29 @@ "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ - { - "name": "salt", - "type": "core::felt252", - "kind": "data" - }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "name", "type": "core::byte_array::ByteArray", + "kind": "key" + }, + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", "kind": "data" } ] @@ -793,7 +793,7 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" + "kind": "key" }, { "name": "address", @@ -839,7 +839,7 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "uri", @@ -856,7 +856,7 @@ { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "hash", @@ -873,12 +873,12 @@ { "name": "name", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "class_hash", @@ -937,12 +937,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "keys", "type": "core::array::Span::", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -959,12 +959,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -981,17 +981,17 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "member_selector", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -1008,12 +1008,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" } ] }, @@ -1025,12 +1025,12 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "contract", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "value", @@ -1047,12 +1047,12 @@ { "name": "address", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "value", 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 d387ebd05e..15875c8942 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 = "0x31df0c74e76e64d5701a806c62961a7ca62eda8978666e14c34497b48a7a501" -original_class_hash = "0x31df0c74e76e64d5701a806c62961a7ca62eda8978666e14c34497b48a7a501" +class_hash = "0x270c8ffb9f92d3711fd67d9842f7519c663ddb17f15ddafd08bfc2aeb7d86d9" +original_class_hash = "0x270c8ffb9f92d3711fd67d9842f7519c663ddb17f15ddafd08bfc2aeb7d86d9" 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-others-61de2c18.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml index 5a43d3fad8..06c88eef3d 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 = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" -original_class_hash = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" +class_hash = "0x25395f6651e97bc6ada3d5de989a1e73cb35f75621097d4e19017c70a285ed6" +original_class_hash = "0x25395f6651e97bc6ada3d5de989a1e73cb35f75621097d4e19017c70a285ed6" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml index 2b3b1409df..266d7972da 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 = "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597" -original_class_hash = "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597" +class_hash = "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6" +original_class_hash = "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" 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 897b4d959c..6fd1873630 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 @@ -749,7 +749,7 @@ { "name": "creator", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" } ] }, @@ -758,29 +758,29 @@ "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ - { - "name": "salt", - "type": "core::felt252", - "kind": "data" - }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "name", "type": "core::byte_array::ByteArray", + "kind": "key" + }, + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", "kind": "data" } ] @@ -793,7 +793,7 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" + "kind": "key" }, { "name": "address", @@ -839,7 +839,7 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "uri", @@ -856,7 +856,7 @@ { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "hash", @@ -873,12 +873,12 @@ { "name": "name", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "class_hash", @@ -937,12 +937,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "keys", "type": "core::array::Span::", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -959,12 +959,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -981,17 +981,17 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "member_selector", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -1008,12 +1008,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" } ] }, @@ -1025,12 +1025,12 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "contract", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "value", @@ -1047,12 +1047,12 @@ { "name": "address", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "value", diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.json b/examples/spawn-and-move/manifests/dev/deployment/manifest.json index 65a049ad32..68859adc5b 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.json +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597", - "original_class_hash": "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597", + "class_hash": "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6", + "original_class_hash": "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6", "abi": [ { "type": "impl", @@ -754,7 +754,7 @@ { "name": "creator", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" } ] }, @@ -763,29 +763,29 @@ "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ - { - "name": "salt", - "type": "core::felt252", - "kind": "data" - }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "name", "type": "core::byte_array::ByteArray", + "kind": "key" + }, + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", "kind": "data" } ] @@ -798,7 +798,7 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" + "kind": "key" }, { "name": "address", @@ -844,7 +844,7 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "uri", @@ -861,7 +861,7 @@ { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "hash", @@ -878,12 +878,12 @@ { "name": "name", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "class_hash", @@ -942,12 +942,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "keys", "type": "core::array::Span::", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -964,12 +964,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -986,17 +986,17 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "member_selector", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -1013,12 +1013,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" } ] }, @@ -1030,12 +1030,12 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "contract", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "value", @@ -1052,12 +1052,12 @@ { "name": "address", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "value", @@ -1229,8 +1229,8 @@ ] } ], - "address": "0x6a5152f02567ffb01e5da73a92253dacd50f74932e1a87f3cb58723237a6dda", - "transaction_hash": "0x67359c73d4f29e73a35f681bc3e807b3dc694c3ea699a9b2f7d3cd166e6d877", + "address": "0x3ec9d15f66dd4d3470fdc87ce7a6b89db67ab05f74ebec45177b5c2caaeafc0", + "transaction_hash": "0x35633ec19ce1ee5261ce49c47d4f1dcfcfbdf22d193afe9515eb5a3318a9c97", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -1250,9 +1250,9 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x643578322854b652b2f84bcce2cc8db6707cc80dcef1def20d9c4c6a8bb1a8e", - "class_hash": "0x31df0c74e76e64d5701a806c62961a7ca62eda8978666e14c34497b48a7a501", - "original_class_hash": "0x31df0c74e76e64d5701a806c62961a7ca62eda8978666e14c34497b48a7a501", + "address": "0x4333a11b916d2217adcfeb1f6c4c87e502cb91d9ac35a608f3d1c25bb03f76a", + "class_hash": "0x270c8ffb9f92d3711fd67d9842f7519c663ddb17f15ddafd08bfc2aeb7d86d9", + "original_class_hash": "0x270c8ffb9f92d3711fd67d9842f7519c663ddb17f15ddafd08bfc2aeb7d86d9", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -1664,7 +1664,7 @@ }, { "kind": "DojoContract", - "address": "0x544e5f126803b8c09711533d4f1731da3a0552841cd2c8fdc656cc9f6bb8bde", + "address": "0x31fe487805a6795b6883afca8e630ac81d6064237373a0576bf484c36fc4b49", "class_hash": "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d", "original_class_hash": "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", @@ -1903,7 +1903,7 @@ }, { "kind": "DojoContract", - "address": "0x32c35d3816051018bb7f79e5c7a7e6384b320f9f777515faa554f74a9ed6231", + "address": "0x4e16bc7b899d8d9ee5dd2c028f4e4fc063598b4e6519d008add54de0960a1c4", "class_hash": "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393", "original_class_hash": "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", @@ -2124,9 +2124,9 @@ }, { "kind": "DojoContract", - "address": "0x79c9d1c008b6550c8fc92e3a0a6a24f3d461f7d1fea09f9c33127051d61c2c0", - "class_hash": "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87", - "original_class_hash": "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87", + "address": "0x22d292f7dc128cbd8c58b026ed4f98c399b0e9c753068e025d67c86cdd168df", + "class_hash": "0x25395f6651e97bc6ada3d5de989a1e73cb35f75621097d4e19017c70a285ed6", + "original_class_hash": "0x25395f6651e97bc6ada3d5de989a1e73cb35f75621097d4e19017c70a285ed6", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.toml b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml index 62a597cb00..62b252cc1e 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 = "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597" -original_class_hash = "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597" +class_hash = "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6" +original_class_hash = "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6" abi = "manifests/dev/deployment/abis/dojo-world.json" -address = "0x6a5152f02567ffb01e5da73a92253dacd50f74932e1a87f3cb58723237a6dda" -transaction_hash = "0x67359c73d4f29e73a35f681bc3e807b3dc694c3ea699a9b2f7d3cd166e6d877" +address = "0x3ec9d15f66dd4d3470fdc87ce7a6b89db67ab05f74ebec45177b5c2caaeafc0" +transaction_hash = "0x35633ec19ce1ee5261ce49c47d4f1dcfcfbdf22d193afe9515eb5a3318a9c97" block_number = 3 seed = "dojo_examples" manifest_name = "dojo-world" @@ -23,9 +23,9 @@ manifest_name = "dojo-base" [[contracts]] kind = "DojoContract" -address = "0x643578322854b652b2f84bcce2cc8db6707cc80dcef1def20d9c4c6a8bb1a8e" -class_hash = "0x31df0c74e76e64d5701a806c62961a7ca62eda8978666e14c34497b48a7a501" -original_class_hash = "0x31df0c74e76e64d5701a806c62961a7ca62eda8978666e14c34497b48a7a501" +address = "0x4333a11b916d2217adcfeb1f6c4c87e502cb91d9ac35a608f3d1c25bb03f76a" +class_hash = "0x270c8ffb9f92d3711fd67d9842f7519c663ddb17f15ddafd08bfc2aeb7d86d9" +original_class_hash = "0x270c8ffb9f92d3711fd67d9842f7519c663ddb17f15ddafd08bfc2aeb7d86d9" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] @@ -46,7 +46,7 @@ manifest_name = "dojo_examples-actions-40b6994c" [[contracts]] kind = "DojoContract" -address = "0x544e5f126803b8c09711533d4f1731da3a0552841cd2c8fdc656cc9f6bb8bde" +address = "0x31fe487805a6795b6883afca8e630ac81d6064237373a0576bf484c36fc4b49" class_hash = "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d" original_class_hash = "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" @@ -60,7 +60,7 @@ manifest_name = "dojo_examples-dungeon-6620e0e6" [[contracts]] kind = "DojoContract" -address = "0x32c35d3816051018bb7f79e5c7a7e6384b320f9f777515faa554f74a9ed6231" +address = "0x4e16bc7b899d8d9ee5dd2c028f4e4fc063598b4e6519d008add54de0960a1c4" class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" original_class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" @@ -74,9 +74,9 @@ manifest_name = "dojo_examples-mock_token-31599eb2" [[contracts]] kind = "DojoContract" -address = "0x79c9d1c008b6550c8fc92e3a0a6a24f3d461f7d1fea09f9c33127051d61c2c0" -class_hash = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" -original_class_hash = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" +address = "0x22d292f7dc128cbd8c58b026ed4f98c399b0e9c753068e025d67c86cdd168df" +class_hash = "0x25395f6651e97bc6ada3d5de989a1e73cb35f75621097d4e19017c70a285ed6" +original_class_hash = "0x25395f6651e97bc6ada3d5de989a1e73cb35f75621097d4e19017c70a285ed6" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] 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 897b4d959c..6fd1873630 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 @@ -749,7 +749,7 @@ { "name": "creator", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" } ] }, @@ -758,29 +758,29 @@ "name": "dojo::world::world_contract::world::ContractDeployed", "kind": "struct", "members": [ - { - "name": "salt", - "type": "core::felt252", - "kind": "data" - }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "name", "type": "core::byte_array::ByteArray", + "kind": "key" + }, + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", "kind": "data" } ] @@ -793,7 +793,7 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", - "kind": "data" + "kind": "key" }, { "name": "address", @@ -839,7 +839,7 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "uri", @@ -856,7 +856,7 @@ { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "hash", @@ -873,12 +873,12 @@ { "name": "name", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "namespace", "type": "core::byte_array::ByteArray", - "kind": "data" + "kind": "key" }, { "name": "class_hash", @@ -937,12 +937,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "keys", "type": "core::array::Span::", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -959,12 +959,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -981,17 +981,17 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "member_selector", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "values", @@ -1008,12 +1008,12 @@ { "name": "table", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "entity_id", "type": "core::felt252", - "kind": "data" + "kind": "key" } ] }, @@ -1025,12 +1025,12 @@ { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "contract", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "value", @@ -1047,12 +1047,12 @@ { "name": "address", "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" + "kind": "key" }, { "name": "resource", "type": "core::felt252", - "kind": "data" + "kind": "key" }, { "name": "value", 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 a56fc9b106..6dd727ace6 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 = "0x31df0c74e76e64d5701a806c62961a7ca62eda8978666e14c34497b48a7a501" -original_class_hash = "0x31df0c74e76e64d5701a806c62961a7ca62eda8978666e14c34497b48a7a501" +class_hash = "0x270c8ffb9f92d3711fd67d9842f7519c663ddb17f15ddafd08bfc2aeb7d86d9" +original_class_hash = "0x270c8ffb9f92d3711fd67d9842f7519c663ddb17f15ddafd08bfc2aeb7d86d9" 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-others-61de2c18.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml index 0e3f247385..80e0fc3e3b 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 = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" -original_class_hash = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" +class_hash = "0x25395f6651e97bc6ada3d5de989a1e73cb35f75621097d4e19017c70a285ed6" +original_class_hash = "0x25395f6651e97bc6ada3d5de989a1e73cb35f75621097d4e19017c70a285ed6" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] diff --git a/examples/spawn-and-move/manifests/release/base/dojo-world.toml b/examples/spawn-and-move/manifests/release/base/dojo-world.toml index 48b34c3f4d..b1435eee03 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 = "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597" -original_class_hash = "0xa349b743d361ce4567361475a89b84a386bb383448c6926954e5fe0b525597" +class_hash = "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6" +original_class_hash = "0x479648c316ee5f9b6999362aa9e72c5cb881ee12e0017559a29025de04a55b6" abi = "manifests/release/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/spawn-and-move-db.tar.gz b/spawn-and-move-db.tar.gz index 65fa481ffd..b147c3197d 100644 Binary files a/spawn-and-move-db.tar.gz and b/spawn-and-move-db.tar.gz differ diff --git a/types-test-db.tar.gz b/types-test-db.tar.gz index 5bae29e25d..26009f9a4f 100644 Binary files a/types-test-db.tar.gz and b/types-test-db.tar.gz differ