diff --git a/contracts/.tool-versions b/contracts/.tool-versions index e1e700a..0d7b3cc 100644 --- a/contracts/.tool-versions +++ b/contracts/.tool-versions @@ -1,2 +1,2 @@ -dojo 1.0.0-alpha.11 +dojo 1.0.0-alpha.16 scarb 2.7.0 diff --git a/contracts/Scarb.lock b/contracts/Scarb.lock index 020ee45..ecad479 100644 --- a/contracts/Scarb.lock +++ b/contracts/Scarb.lock @@ -4,15 +4,7 @@ version = 1 [[package]] name = "dojo" version = "1.0.0-alpha.4" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.11#fbff45b249e2b931f5007edf2d526beef7dc553f" -dependencies = [ - "dojo_plugin", -] - -[[package]] -name = "dojo_plugin" -version = "1.0.0-alpha.4" -source = "git+https://github.com/dojoengine/dojo?rev=f15def33#f15def330c0d099e79351d11c197f63e8cc1ff36" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.16#3b3a78cd8239ca2ee524c49c83f36db4d79cb4bc" [[package]] name = "pixelaw" diff --git a/contracts/Scarb.toml b/contracts/Scarb.toml index 50a2855..baa5bf5 100644 --- a/contracts/Scarb.toml +++ b/contracts/Scarb.toml @@ -9,7 +9,7 @@ edition = "2024_07" sierra-replace-ids = true [dependencies] -dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.11" } +dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.16" } [tool.fmt] sort-module-level-items = true diff --git a/contracts/Scarb_deploy.toml b/contracts/Scarb_deploy.toml index 8aaca53..a803950 100644 --- a/contracts/Scarb_deploy.toml +++ b/contracts/Scarb_deploy.toml @@ -9,7 +9,7 @@ edition = "2024_07" sierra-replace-ids = true [dependencies] -dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.11" } +dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.16" } [tool.fmt] sort-module-level-items = true diff --git a/contracts/dojo_dev.toml b/contracts/dojo_dev.toml index 14b92a4..72de283 100644 --- a/contracts/dojo_dev.toml +++ b/contracts/dojo_dev.toml @@ -11,4 +11,4 @@ mappings = {} rpc_url = "http://localhost:5050/" account_address = "0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca" private_key = "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a" -world_address = "0x263ae44e5414519a5c5a135cccaf3d9d7ee196d37e8de47a178da91f3de9b34" +world_address = "0x4adbe4bfe631a95a5ce99d8200a8721b1ac8096ff8941cecddc4e79a7b2d5d5" diff --git a/contracts/manifests/dev-pop/base/abis/contracts/pixelaw-actions-16928a49.json b/contracts/manifests/dev-pop/base/abis/contracts/pixelaw-actions-16928a49.json new file mode 100644 index 0000000..1c14017 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/contracts/pixelaw-actions-16928a49.json @@ -0,0 +1,803 @@ +[ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "pixelaw::core::actions::IActions" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permission", + "members": [ + { + "name": "app", + "type": "core::bool" + }, + { + "name": "color", + "type": "core::bool" + }, + { + "name": "owner", + "type": "core::bool" + }, + { + "name": "text", + "type": "core::bool" + }, + { + "name": "timestamp", + "type": "core::bool" + }, + { + "name": "action", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::Pixel", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "color", + "type": "core::integer::u32" + }, + { + "name": "created_at", + "type": "core::integer::u64" + }, + { + "name": "updated_at", + "type": "core::integer::u64" + }, + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "text", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::felt252" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u64" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::PixelUpdate", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "color", + "type": "core::option::Option::" + }, + { + "name": "owner", + "type": "core::option::Option::" + }, + { + "name": "app", + "type": "core::option::Option::" + }, + { + "name": "text", + "type": "core::option::Option::" + }, + { + "name": "timestamp", + "type": "core::option::Option::" + }, + { + "name": "action", + "type": "core::option::Option::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Position", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::actions::IActions", + "items": [ + { + "type": "function", + "name": "init", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_permission", + "inputs": [ + { + "name": "for_system", + "type": "core::felt252" + }, + { + "name": "permission", + "type": "pixelaw::core::models::permissions::Permission" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_app", + "inputs": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "has_write_access", + "inputs": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "pixel", + "type": "pixelaw::core::models::pixel::Pixel" + }, + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "process_queue", + "inputs": [ + { + "name": "id", + "type": "core::felt252" + }, + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "called_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "calldata", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "schedule_queue", + "inputs": [ + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "called_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "calldata", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_pixel", + "inputs": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "new_app", + "inputs": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "pixelaw::core::models::registry::App" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_system_address", + "inputs": [ + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_player_address", + "inputs": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "alert_player", + "inputs": [ + { + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "message", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_instruction", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "instruction", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "pixelaw::core::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "pixelaw::core::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::QueueScheduled", + "kind": "struct", + "members": [ + { + "name": "id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "timestamp", + "type": "core::integer::u64", + "kind": "data" + }, + { + "name": "called_system", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "selector", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "calldata", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::QueueProcessed", + "kind": "struct", + "members": [ + { + "name": "id", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::AppNameUpdated", + "kind": "struct", + "members": [ + { + "name": "app", + "type": "pixelaw::core::models::registry::App", + "kind": "data" + }, + { + "name": "caller", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::Alert", + "kind": "struct", + "members": [ + { + "name": "position", + "type": "pixelaw::core::utils::Position", + "kind": "data" + }, + { + "name": "caller", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "message", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + }, + { + "name": "QueueScheduled", + "type": "pixelaw::core::actions::actions::QueueScheduled", + "kind": "nested" + }, + { + "name": "QueueProcessed", + "type": "pixelaw::core::actions::actions::QueueProcessed", + "kind": "nested" + }, + { + "name": "AppNameUpdated", + "type": "pixelaw::core::actions::actions::AppNameUpdated", + "kind": "nested" + }, + { + "name": "Alert", + "type": "pixelaw::core::actions::actions::Alert", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/contracts/pixelaw-paint_actions-2afb94fe.json b/contracts/manifests/dev-pop/base/abis/contracts/pixelaw-paint_actions-2afb94fe.json new file mode 100644 index 0000000..6d410a9 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/contracts/pixelaw-paint_actions-2afb94fe.json @@ -0,0 +1,493 @@ +[ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsInteroperability", + "interface_name": "pixelaw::core::traits::IInteroperability" + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::felt252" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u64" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::PixelUpdate", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "color", + "type": "core::option::Option::" + }, + { + "name": "owner", + "type": "core::option::Option::" + }, + { + "name": "app", + "type": "core::option::Option::" + }, + { + "name": "text", + "type": "core::option::Option::" + }, + { + "name": "timestamp", + "type": "core::option::Option::" + }, + { + "name": "action", + "type": "core::option::Option::" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::traits::IInteroperability", + "items": [ + { + "type": "function", + "name": "on_pre_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "on_post_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "pixelaw::apps::paint::app::IPaintActions" + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Position", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::DefaultParameters", + "members": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "color", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::paint::app::IPaintActions", + "items": [ + { + "type": "function", + "name": "init", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "interact", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "put_color", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "fade", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "pixel_row", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + }, + { + "name": "image_data", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "pixelaw::apps::paint::app::paint_actions::IDojoInit" + }, + { + "type": "interface", + "name": "pixelaw::apps::paint::app::paint_actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::paint::app::paint_actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/contracts/pixelaw-snake_actions-4f967106.json b/contracts/manifests/dev-pop/base/abis/contracts/pixelaw-snake_actions-4f967106.json new file mode 100644 index 0000000..7de987a --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/contracts/pixelaw-snake_actions-4f967106.json @@ -0,0 +1,538 @@ +[ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsInteroperability", + "interface_name": "pixelaw::core::traits::IInteroperability" + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::felt252" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u64" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::PixelUpdate", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "color", + "type": "core::option::Option::" + }, + { + "name": "owner", + "type": "core::option::Option::" + }, + { + "name": "app", + "type": "core::option::Option::" + }, + { + "name": "text", + "type": "core::option::Option::" + }, + { + "name": "timestamp", + "type": "core::option::Option::" + }, + { + "name": "action", + "type": "core::option::Option::" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::traits::IInteroperability", + "items": [ + { + "type": "function", + "name": "on_pre_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "on_post_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "pixelaw::apps::snake::app::ISnakeActions" + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Position", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::DefaultParameters", + "members": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "color", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "pixelaw::core::utils::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::ISnakeActions", + "items": [ + { + "type": "function", + "name": "init", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "interact", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + }, + { + "name": "direction", + "type": "pixelaw::core::utils::Direction" + } + ], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "move", + "inputs": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "pixelaw::apps::snake::app::snake_actions::IDojoInit" + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::snake_actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_actions::Moved", + "kind": "struct", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "direction", + "type": "pixelaw::core::utils::Direction", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_actions::Died", + "kind": "struct", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "x", + "type": "core::integer::u32", + "kind": "data" + }, + { + "name": "y", + "type": "core::integer::u32", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + }, + { + "name": "Moved", + "type": "pixelaw::apps::snake::app::snake_actions::Moved", + "kind": "nested" + }, + { + "name": "Died", + "type": "pixelaw::apps::snake::app::snake_actions::Died", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/dojo-base.json b/contracts/manifests/dev-pop/base/abis/dojo-base.json new file mode 100644 index 0000000..4800464 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/dojo-base.json @@ -0,0 +1,98 @@ +[ + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::base_contract::base::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "flat" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/dojo-world.json b/contracts/manifests/dev-pop/base/abis/dojo-world.json new file mode 100644 index 0000000..8553809 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/dojo-world.json @@ -0,0 +1,1231 @@ +[ + { + "type": "impl", + "name": "World", + "interface_name": "dojo::world::world_contract::IWorld" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::metadata::ResourceMetadata", + "members": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::model::ModelIndex", + "variants": [ + { + "name": "Keys", + "type": "core::array::Span::" + }, + { + "name": "Id", + "type": "core::felt252" + }, + { + "name": "MemberId", + "type": "(core::felt252, core::felt252)" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "enum", + "name": "dojo::world::world_contract::Resource", + "variants": [ + { + "name": "Model", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, + { + "name": "Contract", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, + { + "name": "Namespace", + "type": "()" + }, + { + "name": "World", + "type": "()" + }, + { + "name": "Unregistered", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorld", + "items": [ + { + "type": "function", + "name": "metadata", + "inputs": [ + { + "name": "resource_selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::model::metadata::ResourceMetadata" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_metadata", + "inputs": [ + { + "name": "metadata", + "type": "dojo::model::metadata::ResourceMetadata" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "register_namespace", + "inputs": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "register_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_contract", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "init_contract", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "uuid", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "emit", + "inputs": [ + { + "name": "keys", + "type": "core::array::Array::" + }, + { + "name": "values", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "entity", + "inputs": [ + { + "name": "model_selector", + "type": "core::felt252" + }, + { + "name": "index", + "type": "dojo::model::model::ModelIndex" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ], + "outputs": [ + { + "type": "core::array::Span::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_entity", + "inputs": [ + { + "name": "model_selector", + "type": "core::felt252" + }, + { + "name": "index", + "type": "dojo::model::model::ModelIndex" + }, + { + "name": "values", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "delete_entity", + "inputs": [ + { + "name": "model_selector", + "type": "core::felt252" + }, + { + "name": "index", + "type": "dojo::model::model::ModelIndex" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "resource", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::world::world_contract::Resource" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_owner", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_owner", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_owner", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_writer", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_writer", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_writer", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableWorld", + "interface_name": "dojo::world::world_contract::IUpgradeableWorld" + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IUpgradeableWorld", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableState", + "interface_name": "dojo::world::update::IUpgradeableState" + }, + { + "type": "struct", + "name": "dojo::world::update::StorageUpdate", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::world::update::ProgramOutput", + "members": [ + { + "name": "prev_state_root", + "type": "core::felt252" + }, + { + "name": "new_state_root", + "type": "core::felt252" + }, + { + "name": "block_number", + "type": "core::felt252" + }, + { + "name": "block_hash", + "type": "core::felt252" + }, + { + "name": "config_hash", + "type": "core::felt252" + }, + { + "name": "world_da_hash", + "type": "core::felt252" + }, + { + "name": "message_to_starknet_segment", + "type": "core::array::Span::" + }, + { + "name": "message_to_appchain_segment", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::update::IUpgradeableState", + "items": [ + { + "type": "function", + "name": "upgrade_state", + "inputs": [ + { + "name": "new_state", + "type": "core::array::Span::" + }, + { + "name": "program_output", + "type": "dojo::world::update::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ConfigImpl", + "interface_name": "dojo::world::config::IConfig" + }, + { + "type": "interface", + "name": "dojo::world::config::IConfig", + "items": [ + { + "type": "function", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_facts_registry", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_facts_registry", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::WorldSpawned", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_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" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ContractUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ContractInitialized", + "kind": "struct", + "members": [ + { + "name": "selector", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "init_calldata", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::WorldUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "uri", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::NamespaceRegistered", + "kind": "struct", + "members": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ModelRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ModelUpgraded", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreSetRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreUpdateRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreUpdateMember", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "member_selector", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreDelRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::WriterUpdated", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::OwnerUpdated", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::MergerProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::FactsRegistryUpdate", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::Event", + "kind": "enum", + "variants": [ + { + "name": "DifferProgramHashUpdate", + "type": "dojo::world::config::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::world::config::Config::MergerProgramHashUpdate", + "kind": "nested" + }, + { + "name": "FactsRegistryUpdate", + "type": "dojo::world::config::Config::FactsRegistryUpdate", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StateUpdated", + "kind": "struct", + "members": [ + { + "name": "da_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::Event", + "kind": "enum", + "variants": [ + { + "name": "WorldSpawned", + "type": "dojo::world::world_contract::world::WorldSpawned", + "kind": "nested" + }, + { + "name": "ContractDeployed", + "type": "dojo::world::world_contract::world::ContractDeployed", + "kind": "nested" + }, + { + "name": "ContractUpgraded", + "type": "dojo::world::world_contract::world::ContractUpgraded", + "kind": "nested" + }, + { + "name": "ContractInitialized", + "type": "dojo::world::world_contract::world::ContractInitialized", + "kind": "nested" + }, + { + "name": "WorldUpgraded", + "type": "dojo::world::world_contract::world::WorldUpgraded", + "kind": "nested" + }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world_contract::world::MetadataUpdate", + "kind": "nested" + }, + { + "name": "NamespaceRegistered", + "type": "dojo::world::world_contract::world::NamespaceRegistered", + "kind": "nested" + }, + { + "name": "ModelRegistered", + "type": "dojo::world::world_contract::world::ModelRegistered", + "kind": "nested" + }, + { + "name": "ModelUpgraded", + "type": "dojo::world::world_contract::world::ModelUpgraded", + "kind": "nested" + }, + { + "name": "StoreSetRecord", + "type": "dojo::world::world_contract::world::StoreSetRecord", + "kind": "nested" + }, + { + "name": "StoreUpdateRecord", + "type": "dojo::world::world_contract::world::StoreUpdateRecord", + "kind": "nested" + }, + { + "name": "StoreUpdateMember", + "type": "dojo::world::world_contract::world::StoreUpdateMember", + "kind": "nested" + }, + { + "name": "StoreDelRecord", + "type": "dojo::world::world_contract::world::StoreDelRecord", + "kind": "nested" + }, + { + "name": "WriterUpdated", + "type": "dojo::world::world_contract::world::WriterUpdated", + "kind": "nested" + }, + { + "name": "OwnerUpdated", + "type": "dojo::world::world_contract::world::OwnerUpdated", + "kind": "nested" + }, + { + "name": "ConfigEvent", + "type": "dojo::world::config::Config::Event", + "kind": "nested" + }, + { + "name": "StateUpdated", + "type": "dojo::world::world_contract::world::StateUpdated", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-App-36504565.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-App-36504565.json new file mode 100644 index 0000000..a462073 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-App-36504565.json @@ -0,0 +1,419 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "appImpl", + "interface_name": "pixelaw::core::models::registry::Iapp" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iapp", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::App" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::app::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-AppName-3b816829.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-AppName-3b816829.json new file mode 100644 index 0000000..87a5e61 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-AppName-3b816829.json @@ -0,0 +1,407 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "app_nameImpl", + "interface_name": "pixelaw::core::models::registry::Iapp_name" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::AppName", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iapp_name", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::AppName" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::app_name::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-AppUser-4eda3c52.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-AppUser-4eda3c52.json new file mode 100644 index 0000000..a578a2c --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-AppUser-4eda3c52.json @@ -0,0 +1,411 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "app_userImpl", + "interface_name": "pixelaw::core::models::registry::Iapp_user" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::AppUser", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iapp_user", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::AppUser" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::app_user::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-CoreActionsAddress-5379e1ce.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-CoreActionsAddress-5379e1ce.json new file mode 100644 index 0000000..512af25 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-CoreActionsAddress-5379e1ce.json @@ -0,0 +1,407 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "core_actions_addressImpl", + "interface_name": "pixelaw::core::models::registry::Icore_actions_address" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::CoreActionsAddress", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Icore_actions_address", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::CoreActionsAddress" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::core_actions_address::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-Instruction-4c7c4844.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-Instruction-4c7c4844.json new file mode 100644 index 0000000..a79b066 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-Instruction-4c7c4844.json @@ -0,0 +1,411 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "instructionImpl", + "interface_name": "pixelaw::core::models::registry::Iinstruction" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::Instruction", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "instruction", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iinstruction", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::Instruction" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::instruction::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-Permissions-72b77307.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-Permissions-72b77307.json new file mode 100644 index 0000000..2e1a096 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-Permissions-72b77307.json @@ -0,0 +1,455 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "permissionsImpl", + "interface_name": "pixelaw::core::models::permissions::Ipermissions" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permission", + "members": [ + { + "name": "app", + "type": "core::bool" + }, + { + "name": "color", + "type": "core::bool" + }, + { + "name": "owner", + "type": "core::bool" + }, + { + "name": "text", + "type": "core::bool" + }, + { + "name": "timestamp", + "type": "core::bool" + }, + { + "name": "action", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permissions", + "members": [ + { + "name": "allowing_app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "allowed_app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "permission", + "type": "pixelaw::core::models::permissions::Permission" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::permissions::Ipermissions", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::permissions::Permissions" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::permissions::permissions::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-Pixel-7e607b2f.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-Pixel-7e607b2f.json new file mode 100644 index 0000000..8f6c36a --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-Pixel-7e607b2f.json @@ -0,0 +1,439 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "pixelImpl", + "interface_name": "pixelaw::core::models::pixel::Ipixel" + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::Pixel", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "color", + "type": "core::integer::u32" + }, + { + "name": "created_at", + "type": "core::integer::u64" + }, + { + "name": "updated_at", + "type": "core::integer::u64" + }, + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "text", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::pixel::Ipixel", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::pixel::Pixel" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::pixel::pixel::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-QueueItem-549a17f2.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-QueueItem-549a17f2.json new file mode 100644 index 0000000..8496a6c --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-QueueItem-549a17f2.json @@ -0,0 +1,421 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "queue_itemImpl", + "interface_name": "pixelaw::core::models::queue::Iqueue_item" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::queue::QueueItem", + "members": [ + { + "name": "id", + "type": "core::felt252" + }, + { + "name": "valid", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::queue::Iqueue_item", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::queue::QueueItem" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::queue::queue_item::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-Snake-62b876d4.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-Snake-62b876d4.json new file mode 100644 index 0000000..427033f --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-Snake-62b876d4.json @@ -0,0 +1,471 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "snakeImpl", + "interface_name": "pixelaw::apps::snake::app::Isnake" + }, + { + "type": "enum", + "name": "pixelaw::core::utils::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::apps::snake::app::Snake", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "length", + "type": "core::integer::u8" + }, + { + "name": "first_segment_id", + "type": "core::integer::u32" + }, + { + "name": "last_segment_id", + "type": "core::integer::u32" + }, + { + "name": "direction", + "type": "pixelaw::core::utils::Direction" + }, + { + "name": "color", + "type": "core::integer::u32" + }, + { + "name": "text", + "type": "core::felt252" + }, + { + "name": "is_dying", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::Isnake", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::apps::snake::app::Snake" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/abis/models/pixelaw-SnakeSegment-302de0d8.json b/contracts/manifests/dev-pop/base/abis/models/pixelaw-SnakeSegment-302de0d8.json new file mode 100644 index 0000000..7baeb86 --- /dev/null +++ b/contracts/manifests/dev-pop/base/abis/models/pixelaw-SnakeSegment-302de0d8.json @@ -0,0 +1,431 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "snake_segmentImpl", + "interface_name": "pixelaw::apps::snake::app::Isnake_segment" + }, + { + "type": "struct", + "name": "pixelaw::apps::snake::app::SnakeSegment", + "members": [ + { + "name": "id", + "type": "core::integer::u32" + }, + { + "name": "previous_id", + "type": "core::integer::u32" + }, + { + "name": "next_id", + "type": "core::integer::u32" + }, + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "pixel_original_color", + "type": "core::integer::u32" + }, + { + "name": "pixel_original_text", + "type": "core::felt252" + }, + { + "name": "pixel_original_app", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::Isnake_segment", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::apps::snake::app::SnakeSegment" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_segment::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/base/contracts/pixelaw-actions-16928a49.toml b/contracts/manifests/dev-pop/base/contracts/pixelaw-actions-16928a49.toml new file mode 100644 index 0000000..a38d6f1 --- /dev/null +++ b/contracts/manifests/dev-pop/base/contracts/pixelaw-actions-16928a49.toml @@ -0,0 +1,20 @@ +kind = "DojoContract" +class_hash = "0x31ad47b55f3d18e932dd541e5686084703b0f7d123558c0a9bec6d6e09720b0" +original_class_hash = "0x31ad47b55f3d18e932dd541e5686084703b0f7d123558c0a9bec6d6e09720b0" +base_class_hash = "0x0" +abi = "manifests/dev-pop/base/abis/contracts/pixelaw-actions-16928a49.json" +reads = [] +writes = [] +init_calldata = [] +tag = "pixelaw-actions" +systems = [ + "init", + "update_permission", + "update_app", + "schedule_queue", + "process_queue", + "update_pixel", + "alert_player", + "set_instruction", +] +manifest_name = "pixelaw-actions-16928a49" diff --git a/contracts/manifests/dev-pop/base/contracts/pixelaw-paint_actions-2afb94fe.toml b/contracts/manifests/dev-pop/base/contracts/pixelaw-paint_actions-2afb94fe.toml new file mode 100644 index 0000000..790f55f --- /dev/null +++ b/contracts/manifests/dev-pop/base/contracts/pixelaw-paint_actions-2afb94fe.toml @@ -0,0 +1,19 @@ +kind = "DojoContract" +class_hash = "0x36aa9f769c7b79280ee0f6c85b660b4b113b60d79cdcd79a12d47faec8555aa" +original_class_hash = "0x36aa9f769c7b79280ee0f6c85b660b4b113b60d79cdcd79a12d47faec8555aa" +base_class_hash = "0x0" +abi = "manifests/dev-pop/base/abis/contracts/pixelaw-paint_actions-2afb94fe.json" +reads = [] +writes = [] +init_calldata = [] +tag = "pixelaw-paint_actions" +systems = [ + "on_pre_update", + "on_post_update", + "init", + "interact", + "put_color", + "pixel_row", + "fade", +] +manifest_name = "pixelaw-paint_actions-2afb94fe" diff --git a/contracts/manifests/dev-pop/base/contracts/pixelaw-snake_actions-4f967106.toml b/contracts/manifests/dev-pop/base/contracts/pixelaw-snake_actions-4f967106.toml new file mode 100644 index 0000000..0db75a4 --- /dev/null +++ b/contracts/manifests/dev-pop/base/contracts/pixelaw-snake_actions-4f967106.toml @@ -0,0 +1,16 @@ +kind = "DojoContract" +class_hash = "0x566a961335e1183fe83b156d6349a0320f401b4f0b4b20485e2b709e748dcd0" +original_class_hash = "0x566a961335e1183fe83b156d6349a0320f401b4f0b4b20485e2b709e748dcd0" +base_class_hash = "0x0" +abi = "manifests/dev-pop/base/abis/contracts/pixelaw-snake_actions-4f967106.json" +reads = [] +writes = [] +init_calldata = [] +tag = "pixelaw-snake_actions" +systems = [ + "on_pre_update", + "on_post_update", + "init", + "move", +] +manifest_name = "pixelaw-snake_actions-4f967106" diff --git a/contracts/manifests/dev-pop/base/dojo-base.toml b/contracts/manifests/dev-pop/base/dojo-base.toml new file mode 100644 index 0000000..8c8b1cd --- /dev/null +++ b/contracts/manifests/dev-pop/base/dojo-base.toml @@ -0,0 +1,6 @@ +kind = "Class" +class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +original_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +abi = "manifests/dev-pop/base/abis/dojo-base.json" +tag = "dojo-base" +manifest_name = "dojo-base" diff --git a/contracts/manifests/dev-pop/base/dojo-world.toml b/contracts/manifests/dev-pop/base/dojo-world.toml new file mode 100644 index 0000000..995caec --- /dev/null +++ b/contracts/manifests/dev-pop/base/dojo-world.toml @@ -0,0 +1,6 @@ +kind = "Class" +class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +original_class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +abi = "manifests/dev-pop/base/abis/dojo-world.json" +tag = "dojo-world" +manifest_name = "dojo-world" diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-App-36504565.toml b/contracts/manifests/dev-pop/base/models/pixelaw-App-36504565.toml new file mode 100644 index 0000000..be6dc5f --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-App-36504565.toml @@ -0,0 +1,32 @@ +kind = "DojoModel" +class_hash = "0x34204d56b9f6a93b305e54a27b5e8e593f159f87212fcf39c770020b03bfce5" +original_class_hash = "0x34204d56b9f6a93b305e54a27b5e8e593f159f87212fcf39c770020b03bfce5" +abi = "manifests/dev-pop/base/abis/models/pixelaw-App-36504565.json" +tag = "pixelaw-App" +qualified_path = "pixelaw::core::models::registry::app" +manifest_name = "pixelaw-App-36504565" + +[[members]] +name = "system" +type = "ContractAddress" +key = true + +[[members]] +name = "name" +type = "felt252" +key = false + +[[members]] +name = "manifest" +type = "felt252" +key = false + +[[members]] +name = "icon" +type = "felt252" +key = false + +[[members]] +name = "action" +type = "felt252" +key = false diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-AppName-3b816829.toml b/contracts/manifests/dev-pop/base/models/pixelaw-AppName-3b816829.toml new file mode 100644 index 0000000..44632a8 --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-AppName-3b816829.toml @@ -0,0 +1,17 @@ +kind = "DojoModel" +class_hash = "0x7d54c34e9b4215ceaada6950e0b521ef3892de01fbaea2c8323e8c2cf3329c8" +original_class_hash = "0x7d54c34e9b4215ceaada6950e0b521ef3892de01fbaea2c8323e8c2cf3329c8" +abi = "manifests/dev-pop/base/abis/models/pixelaw-AppName-3b816829.json" +tag = "pixelaw-AppName" +qualified_path = "pixelaw::core::models::registry::app_name" +manifest_name = "pixelaw-AppName-3b816829" + +[[members]] +name = "name" +type = "felt252" +key = true + +[[members]] +name = "system" +type = "ContractAddress" +key = false diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-AppUser-4eda3c52.toml b/contracts/manifests/dev-pop/base/models/pixelaw-AppUser-4eda3c52.toml new file mode 100644 index 0000000..38338d9 --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-AppUser-4eda3c52.toml @@ -0,0 +1,22 @@ +kind = "DojoModel" +class_hash = "0x3d55e23acf8df5ef0c25b76d5a6b7765c241c494af075c7ce3858568bec45f1" +original_class_hash = "0x3d55e23acf8df5ef0c25b76d5a6b7765c241c494af075c7ce3858568bec45f1" +abi = "manifests/dev-pop/base/abis/models/pixelaw-AppUser-4eda3c52.json" +tag = "pixelaw-AppUser" +qualified_path = "pixelaw::core::models::registry::app_user" +manifest_name = "pixelaw-AppUser-4eda3c52" + +[[members]] +name = "system" +type = "ContractAddress" +key = true + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "action" +type = "felt252" +key = false diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-CoreActionsAddress-5379e1ce.toml b/contracts/manifests/dev-pop/base/models/pixelaw-CoreActionsAddress-5379e1ce.toml new file mode 100644 index 0000000..1828295 --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-CoreActionsAddress-5379e1ce.toml @@ -0,0 +1,17 @@ +kind = "DojoModel" +class_hash = "0x296cfe5fb82a8b03b4aa78e35955bc70971babeb414d70a6a8acc52a4eacab2" +original_class_hash = "0x296cfe5fb82a8b03b4aa78e35955bc70971babeb414d70a6a8acc52a4eacab2" +abi = "manifests/dev-pop/base/abis/models/pixelaw-CoreActionsAddress-5379e1ce.json" +tag = "pixelaw-CoreActionsAddress" +qualified_path = "pixelaw::core::models::registry::core_actions_address" +manifest_name = "pixelaw-CoreActionsAddress-5379e1ce" + +[[members]] +name = "key" +type = "felt252" +key = true + +[[members]] +name = "value" +type = "ContractAddress" +key = false diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-Instruction-4c7c4844.toml b/contracts/manifests/dev-pop/base/models/pixelaw-Instruction-4c7c4844.toml new file mode 100644 index 0000000..d9763c3 --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-Instruction-4c7c4844.toml @@ -0,0 +1,22 @@ +kind = "DojoModel" +class_hash = "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af" +original_class_hash = "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af" +abi = "manifests/dev-pop/base/abis/models/pixelaw-Instruction-4c7c4844.json" +tag = "pixelaw-Instruction" +qualified_path = "pixelaw::core::models::registry::instruction" +manifest_name = "pixelaw-Instruction-4c7c4844" + +[[members]] +name = "system" +type = "ContractAddress" +key = true + +[[members]] +name = "selector" +type = "felt252" +key = true + +[[members]] +name = "instruction" +type = "felt252" +key = false diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-Permissions-72b77307.toml b/contracts/manifests/dev-pop/base/models/pixelaw-Permissions-72b77307.toml new file mode 100644 index 0000000..594cb10 --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-Permissions-72b77307.toml @@ -0,0 +1,22 @@ +kind = "DojoModel" +class_hash = "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302" +original_class_hash = "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302" +abi = "manifests/dev-pop/base/abis/models/pixelaw-Permissions-72b77307.json" +tag = "pixelaw-Permissions" +qualified_path = "pixelaw::core::models::permissions::permissions" +manifest_name = "pixelaw-Permissions-72b77307" + +[[members]] +name = "allowing_app" +type = "ContractAddress" +key = true + +[[members]] +name = "allowed_app" +type = "ContractAddress" +key = true + +[[members]] +name = "permission" +type = "Permission" +key = false diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-Pixel-7e607b2f.toml b/contracts/manifests/dev-pop/base/models/pixelaw-Pixel-7e607b2f.toml new file mode 100644 index 0000000..3e26db9 --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-Pixel-7e607b2f.toml @@ -0,0 +1,57 @@ +kind = "DojoModel" +class_hash = "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d" +original_class_hash = "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d" +abi = "manifests/dev-pop/base/abis/models/pixelaw-Pixel-7e607b2f.json" +tag = "pixelaw-Pixel" +qualified_path = "pixelaw::core::models::pixel::pixel" +manifest_name = "pixelaw-Pixel-7e607b2f" + +[[members]] +name = "x" +type = "u32" +key = true + +[[members]] +name = "y" +type = "u32" +key = true + +[[members]] +name = "app" +type = "ContractAddress" +key = false + +[[members]] +name = "color" +type = "u32" +key = false + +[[members]] +name = "created_at" +type = "u64" +key = false + +[[members]] +name = "updated_at" +type = "u64" +key = false + +[[members]] +name = "timestamp" +type = "u64" +key = false + +[[members]] +name = "owner" +type = "ContractAddress" +key = false + +[[members]] +name = "text" +type = "felt252" +key = false + +[[members]] +name = "action" +type = "felt252" +key = false diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-QueueItem-549a17f2.toml b/contracts/manifests/dev-pop/base/models/pixelaw-QueueItem-549a17f2.toml new file mode 100644 index 0000000..8216de8 --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-QueueItem-549a17f2.toml @@ -0,0 +1,17 @@ +kind = "DojoModel" +class_hash = "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70" +original_class_hash = "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70" +abi = "manifests/dev-pop/base/abis/models/pixelaw-QueueItem-549a17f2.json" +tag = "pixelaw-QueueItem" +qualified_path = "pixelaw::core::models::queue::queue_item" +manifest_name = "pixelaw-QueueItem-549a17f2" + +[[members]] +name = "id" +type = "felt252" +key = true + +[[members]] +name = "valid" +type = "bool" +key = false diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-Snake-62b876d4.toml b/contracts/manifests/dev-pop/base/models/pixelaw-Snake-62b876d4.toml new file mode 100644 index 0000000..aefdcf5 --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-Snake-62b876d4.toml @@ -0,0 +1,47 @@ +kind = "DojoModel" +class_hash = "0x5a3afeed7a51a51cab27a99c9d99064fc467ecdb9a8cc606c4d4899dffb7f6c" +original_class_hash = "0x5a3afeed7a51a51cab27a99c9d99064fc467ecdb9a8cc606c4d4899dffb7f6c" +abi = "manifests/dev-pop/base/abis/models/pixelaw-Snake-62b876d4.json" +tag = "pixelaw-Snake" +qualified_path = "pixelaw::apps::snake::app::snake" +manifest_name = "pixelaw-Snake-62b876d4" + +[[members]] +name = "owner" +type = "ContractAddress" +key = true + +[[members]] +name = "length" +type = "u8" +key = false + +[[members]] +name = "first_segment_id" +type = "u32" +key = false + +[[members]] +name = "last_segment_id" +type = "u32" +key = false + +[[members]] +name = "direction" +type = "Direction" +key = false + +[[members]] +name = "color" +type = "u32" +key = false + +[[members]] +name = "text" +type = "felt252" +key = false + +[[members]] +name = "is_dying" +type = "bool" +key = false diff --git a/contracts/manifests/dev-pop/base/models/pixelaw-SnakeSegment-302de0d8.toml b/contracts/manifests/dev-pop/base/models/pixelaw-SnakeSegment-302de0d8.toml new file mode 100644 index 0000000..bb23750 --- /dev/null +++ b/contracts/manifests/dev-pop/base/models/pixelaw-SnakeSegment-302de0d8.toml @@ -0,0 +1,47 @@ +kind = "DojoModel" +class_hash = "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f" +original_class_hash = "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f" +abi = "manifests/dev-pop/base/abis/models/pixelaw-SnakeSegment-302de0d8.json" +tag = "pixelaw-SnakeSegment" +qualified_path = "pixelaw::apps::snake::app::snake_segment" +manifest_name = "pixelaw-SnakeSegment-302de0d8" + +[[members]] +name = "id" +type = "u32" +key = true + +[[members]] +name = "previous_id" +type = "u32" +key = false + +[[members]] +name = "next_id" +type = "u32" +key = false + +[[members]] +name = "x" +type = "u32" +key = false + +[[members]] +name = "y" +type = "u32" +key = false + +[[members]] +name = "pixel_original_color" +type = "u32" +key = false + +[[members]] +name = "pixel_original_text" +type = "felt252" +key = false + +[[members]] +name = "pixel_original_app" +type = "ContractAddress" +key = false diff --git a/contracts/manifests/dev-pop/deployment/abis/contracts/pixelaw-actions-16928a49.json b/contracts/manifests/dev-pop/deployment/abis/contracts/pixelaw-actions-16928a49.json new file mode 100644 index 0000000..1c14017 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/contracts/pixelaw-actions-16928a49.json @@ -0,0 +1,803 @@ +[ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "pixelaw::core::actions::IActions" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permission", + "members": [ + { + "name": "app", + "type": "core::bool" + }, + { + "name": "color", + "type": "core::bool" + }, + { + "name": "owner", + "type": "core::bool" + }, + { + "name": "text", + "type": "core::bool" + }, + { + "name": "timestamp", + "type": "core::bool" + }, + { + "name": "action", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::Pixel", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "color", + "type": "core::integer::u32" + }, + { + "name": "created_at", + "type": "core::integer::u64" + }, + { + "name": "updated_at", + "type": "core::integer::u64" + }, + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "text", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::felt252" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u64" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::PixelUpdate", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "color", + "type": "core::option::Option::" + }, + { + "name": "owner", + "type": "core::option::Option::" + }, + { + "name": "app", + "type": "core::option::Option::" + }, + { + "name": "text", + "type": "core::option::Option::" + }, + { + "name": "timestamp", + "type": "core::option::Option::" + }, + { + "name": "action", + "type": "core::option::Option::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Position", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::actions::IActions", + "items": [ + { + "type": "function", + "name": "init", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_permission", + "inputs": [ + { + "name": "for_system", + "type": "core::felt252" + }, + { + "name": "permission", + "type": "pixelaw::core::models::permissions::Permission" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_app", + "inputs": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "has_write_access", + "inputs": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "pixel", + "type": "pixelaw::core::models::pixel::Pixel" + }, + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "process_queue", + "inputs": [ + { + "name": "id", + "type": "core::felt252" + }, + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "called_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "calldata", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "schedule_queue", + "inputs": [ + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "called_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "calldata", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_pixel", + "inputs": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "new_app", + "inputs": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "pixelaw::core::models::registry::App" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_system_address", + "inputs": [ + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_player_address", + "inputs": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "alert_player", + "inputs": [ + { + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "message", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_instruction", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "instruction", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "pixelaw::core::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "pixelaw::core::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::QueueScheduled", + "kind": "struct", + "members": [ + { + "name": "id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "timestamp", + "type": "core::integer::u64", + "kind": "data" + }, + { + "name": "called_system", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "selector", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "calldata", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::QueueProcessed", + "kind": "struct", + "members": [ + { + "name": "id", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::AppNameUpdated", + "kind": "struct", + "members": [ + { + "name": "app", + "type": "pixelaw::core::models::registry::App", + "kind": "data" + }, + { + "name": "caller", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::Alert", + "kind": "struct", + "members": [ + { + "name": "position", + "type": "pixelaw::core::utils::Position", + "kind": "data" + }, + { + "name": "caller", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "message", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + }, + { + "name": "QueueScheduled", + "type": "pixelaw::core::actions::actions::QueueScheduled", + "kind": "nested" + }, + { + "name": "QueueProcessed", + "type": "pixelaw::core::actions::actions::QueueProcessed", + "kind": "nested" + }, + { + "name": "AppNameUpdated", + "type": "pixelaw::core::actions::actions::AppNameUpdated", + "kind": "nested" + }, + { + "name": "Alert", + "type": "pixelaw::core::actions::actions::Alert", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/contracts/pixelaw-paint_actions-2afb94fe.json b/contracts/manifests/dev-pop/deployment/abis/contracts/pixelaw-paint_actions-2afb94fe.json new file mode 100644 index 0000000..6d410a9 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/contracts/pixelaw-paint_actions-2afb94fe.json @@ -0,0 +1,493 @@ +[ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsInteroperability", + "interface_name": "pixelaw::core::traits::IInteroperability" + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::felt252" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u64" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::PixelUpdate", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "color", + "type": "core::option::Option::" + }, + { + "name": "owner", + "type": "core::option::Option::" + }, + { + "name": "app", + "type": "core::option::Option::" + }, + { + "name": "text", + "type": "core::option::Option::" + }, + { + "name": "timestamp", + "type": "core::option::Option::" + }, + { + "name": "action", + "type": "core::option::Option::" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::traits::IInteroperability", + "items": [ + { + "type": "function", + "name": "on_pre_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "on_post_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "pixelaw::apps::paint::app::IPaintActions" + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Position", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::DefaultParameters", + "members": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "color", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::paint::app::IPaintActions", + "items": [ + { + "type": "function", + "name": "init", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "interact", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "put_color", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "fade", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "pixel_row", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + }, + { + "name": "image_data", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "pixelaw::apps::paint::app::paint_actions::IDojoInit" + }, + { + "type": "interface", + "name": "pixelaw::apps::paint::app::paint_actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::paint::app::paint_actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/contracts/pixelaw-snake_actions-4f967106.json b/contracts/manifests/dev-pop/deployment/abis/contracts/pixelaw-snake_actions-4f967106.json new file mode 100644 index 0000000..7de987a --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/contracts/pixelaw-snake_actions-4f967106.json @@ -0,0 +1,538 @@ +[ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsInteroperability", + "interface_name": "pixelaw::core::traits::IInteroperability" + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::felt252" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u64" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::PixelUpdate", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "color", + "type": "core::option::Option::" + }, + { + "name": "owner", + "type": "core::option::Option::" + }, + { + "name": "app", + "type": "core::option::Option::" + }, + { + "name": "text", + "type": "core::option::Option::" + }, + { + "name": "timestamp", + "type": "core::option::Option::" + }, + { + "name": "action", + "type": "core::option::Option::" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::traits::IInteroperability", + "items": [ + { + "type": "function", + "name": "on_pre_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "on_post_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "pixelaw::apps::snake::app::ISnakeActions" + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Position", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::DefaultParameters", + "members": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "color", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "pixelaw::core::utils::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::ISnakeActions", + "items": [ + { + "type": "function", + "name": "init", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "interact", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + }, + { + "name": "direction", + "type": "pixelaw::core::utils::Direction" + } + ], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "move", + "inputs": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "pixelaw::apps::snake::app::snake_actions::IDojoInit" + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::snake_actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_actions::Moved", + "kind": "struct", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "direction", + "type": "pixelaw::core::utils::Direction", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_actions::Died", + "kind": "struct", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "x", + "type": "core::integer::u32", + "kind": "data" + }, + { + "name": "y", + "type": "core::integer::u32", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + }, + { + "name": "Moved", + "type": "pixelaw::apps::snake::app::snake_actions::Moved", + "kind": "nested" + }, + { + "name": "Died", + "type": "pixelaw::apps::snake::app::snake_actions::Died", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/dojo-base.json b/contracts/manifests/dev-pop/deployment/abis/dojo-base.json new file mode 100644 index 0000000..4800464 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/dojo-base.json @@ -0,0 +1,98 @@ +[ + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::base_contract::base::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "flat" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/dojo-world.json b/contracts/manifests/dev-pop/deployment/abis/dojo-world.json new file mode 100644 index 0000000..8553809 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/dojo-world.json @@ -0,0 +1,1231 @@ +[ + { + "type": "impl", + "name": "World", + "interface_name": "dojo::world::world_contract::IWorld" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::metadata::ResourceMetadata", + "members": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::model::ModelIndex", + "variants": [ + { + "name": "Keys", + "type": "core::array::Span::" + }, + { + "name": "Id", + "type": "core::felt252" + }, + { + "name": "MemberId", + "type": "(core::felt252, core::felt252)" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "enum", + "name": "dojo::world::world_contract::Resource", + "variants": [ + { + "name": "Model", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, + { + "name": "Contract", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, + { + "name": "Namespace", + "type": "()" + }, + { + "name": "World", + "type": "()" + }, + { + "name": "Unregistered", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorld", + "items": [ + { + "type": "function", + "name": "metadata", + "inputs": [ + { + "name": "resource_selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::model::metadata::ResourceMetadata" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_metadata", + "inputs": [ + { + "name": "metadata", + "type": "dojo::model::metadata::ResourceMetadata" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "register_namespace", + "inputs": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "register_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_contract", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "init_contract", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "uuid", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "emit", + "inputs": [ + { + "name": "keys", + "type": "core::array::Array::" + }, + { + "name": "values", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "entity", + "inputs": [ + { + "name": "model_selector", + "type": "core::felt252" + }, + { + "name": "index", + "type": "dojo::model::model::ModelIndex" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ], + "outputs": [ + { + "type": "core::array::Span::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_entity", + "inputs": [ + { + "name": "model_selector", + "type": "core::felt252" + }, + { + "name": "index", + "type": "dojo::model::model::ModelIndex" + }, + { + "name": "values", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "delete_entity", + "inputs": [ + { + "name": "model_selector", + "type": "core::felt252" + }, + { + "name": "index", + "type": "dojo::model::model::ModelIndex" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "resource", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::world::world_contract::Resource" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_owner", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_owner", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_owner", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_writer", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_writer", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_writer", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableWorld", + "interface_name": "dojo::world::world_contract::IUpgradeableWorld" + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IUpgradeableWorld", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableState", + "interface_name": "dojo::world::update::IUpgradeableState" + }, + { + "type": "struct", + "name": "dojo::world::update::StorageUpdate", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::world::update::ProgramOutput", + "members": [ + { + "name": "prev_state_root", + "type": "core::felt252" + }, + { + "name": "new_state_root", + "type": "core::felt252" + }, + { + "name": "block_number", + "type": "core::felt252" + }, + { + "name": "block_hash", + "type": "core::felt252" + }, + { + "name": "config_hash", + "type": "core::felt252" + }, + { + "name": "world_da_hash", + "type": "core::felt252" + }, + { + "name": "message_to_starknet_segment", + "type": "core::array::Span::" + }, + { + "name": "message_to_appchain_segment", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::update::IUpgradeableState", + "items": [ + { + "type": "function", + "name": "upgrade_state", + "inputs": [ + { + "name": "new_state", + "type": "core::array::Span::" + }, + { + "name": "program_output", + "type": "dojo::world::update::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ConfigImpl", + "interface_name": "dojo::world::config::IConfig" + }, + { + "type": "interface", + "name": "dojo::world::config::IConfig", + "items": [ + { + "type": "function", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_facts_registry", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_facts_registry", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::WorldSpawned", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_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" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ContractUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ContractInitialized", + "kind": "struct", + "members": [ + { + "name": "selector", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "init_calldata", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::WorldUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "uri", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::NamespaceRegistered", + "kind": "struct", + "members": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ModelRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ModelUpgraded", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreSetRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreUpdateRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreUpdateMember", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "member_selector", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreDelRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::WriterUpdated", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::OwnerUpdated", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::MergerProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::FactsRegistryUpdate", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::Event", + "kind": "enum", + "variants": [ + { + "name": "DifferProgramHashUpdate", + "type": "dojo::world::config::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::world::config::Config::MergerProgramHashUpdate", + "kind": "nested" + }, + { + "name": "FactsRegistryUpdate", + "type": "dojo::world::config::Config::FactsRegistryUpdate", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StateUpdated", + "kind": "struct", + "members": [ + { + "name": "da_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::Event", + "kind": "enum", + "variants": [ + { + "name": "WorldSpawned", + "type": "dojo::world::world_contract::world::WorldSpawned", + "kind": "nested" + }, + { + "name": "ContractDeployed", + "type": "dojo::world::world_contract::world::ContractDeployed", + "kind": "nested" + }, + { + "name": "ContractUpgraded", + "type": "dojo::world::world_contract::world::ContractUpgraded", + "kind": "nested" + }, + { + "name": "ContractInitialized", + "type": "dojo::world::world_contract::world::ContractInitialized", + "kind": "nested" + }, + { + "name": "WorldUpgraded", + "type": "dojo::world::world_contract::world::WorldUpgraded", + "kind": "nested" + }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world_contract::world::MetadataUpdate", + "kind": "nested" + }, + { + "name": "NamespaceRegistered", + "type": "dojo::world::world_contract::world::NamespaceRegistered", + "kind": "nested" + }, + { + "name": "ModelRegistered", + "type": "dojo::world::world_contract::world::ModelRegistered", + "kind": "nested" + }, + { + "name": "ModelUpgraded", + "type": "dojo::world::world_contract::world::ModelUpgraded", + "kind": "nested" + }, + { + "name": "StoreSetRecord", + "type": "dojo::world::world_contract::world::StoreSetRecord", + "kind": "nested" + }, + { + "name": "StoreUpdateRecord", + "type": "dojo::world::world_contract::world::StoreUpdateRecord", + "kind": "nested" + }, + { + "name": "StoreUpdateMember", + "type": "dojo::world::world_contract::world::StoreUpdateMember", + "kind": "nested" + }, + { + "name": "StoreDelRecord", + "type": "dojo::world::world_contract::world::StoreDelRecord", + "kind": "nested" + }, + { + "name": "WriterUpdated", + "type": "dojo::world::world_contract::world::WriterUpdated", + "kind": "nested" + }, + { + "name": "OwnerUpdated", + "type": "dojo::world::world_contract::world::OwnerUpdated", + "kind": "nested" + }, + { + "name": "ConfigEvent", + "type": "dojo::world::config::Config::Event", + "kind": "nested" + }, + { + "name": "StateUpdated", + "type": "dojo::world::world_contract::world::StateUpdated", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-App-36504565.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-App-36504565.json new file mode 100644 index 0000000..a462073 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-App-36504565.json @@ -0,0 +1,419 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "appImpl", + "interface_name": "pixelaw::core::models::registry::Iapp" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iapp", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::App" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::app::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-AppName-3b816829.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-AppName-3b816829.json new file mode 100644 index 0000000..87a5e61 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-AppName-3b816829.json @@ -0,0 +1,407 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "app_nameImpl", + "interface_name": "pixelaw::core::models::registry::Iapp_name" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::AppName", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iapp_name", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::AppName" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::app_name::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-AppUser-4eda3c52.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-AppUser-4eda3c52.json new file mode 100644 index 0000000..a578a2c --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-AppUser-4eda3c52.json @@ -0,0 +1,411 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "app_userImpl", + "interface_name": "pixelaw::core::models::registry::Iapp_user" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::AppUser", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iapp_user", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::AppUser" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::app_user::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-CoreActionsAddress-5379e1ce.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-CoreActionsAddress-5379e1ce.json new file mode 100644 index 0000000..512af25 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-CoreActionsAddress-5379e1ce.json @@ -0,0 +1,407 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "core_actions_addressImpl", + "interface_name": "pixelaw::core::models::registry::Icore_actions_address" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::CoreActionsAddress", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Icore_actions_address", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::CoreActionsAddress" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::core_actions_address::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Instruction-4c7c4844.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Instruction-4c7c4844.json new file mode 100644 index 0000000..a79b066 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Instruction-4c7c4844.json @@ -0,0 +1,411 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "instructionImpl", + "interface_name": "pixelaw::core::models::registry::Iinstruction" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::Instruction", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "instruction", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iinstruction", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::Instruction" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::instruction::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Permissions-72b77307.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Permissions-72b77307.json new file mode 100644 index 0000000..2e1a096 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Permissions-72b77307.json @@ -0,0 +1,455 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "permissionsImpl", + "interface_name": "pixelaw::core::models::permissions::Ipermissions" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permission", + "members": [ + { + "name": "app", + "type": "core::bool" + }, + { + "name": "color", + "type": "core::bool" + }, + { + "name": "owner", + "type": "core::bool" + }, + { + "name": "text", + "type": "core::bool" + }, + { + "name": "timestamp", + "type": "core::bool" + }, + { + "name": "action", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permissions", + "members": [ + { + "name": "allowing_app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "allowed_app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "permission", + "type": "pixelaw::core::models::permissions::Permission" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::permissions::Ipermissions", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::permissions::Permissions" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::permissions::permissions::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Pixel-7e607b2f.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Pixel-7e607b2f.json new file mode 100644 index 0000000..8f6c36a --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Pixel-7e607b2f.json @@ -0,0 +1,439 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "pixelImpl", + "interface_name": "pixelaw::core::models::pixel::Ipixel" + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::Pixel", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "color", + "type": "core::integer::u32" + }, + { + "name": "created_at", + "type": "core::integer::u64" + }, + { + "name": "updated_at", + "type": "core::integer::u64" + }, + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "text", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::pixel::Ipixel", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::pixel::Pixel" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::pixel::pixel::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-QueueItem-549a17f2.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-QueueItem-549a17f2.json new file mode 100644 index 0000000..8496a6c --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-QueueItem-549a17f2.json @@ -0,0 +1,421 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "queue_itemImpl", + "interface_name": "pixelaw::core::models::queue::Iqueue_item" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::queue::QueueItem", + "members": [ + { + "name": "id", + "type": "core::felt252" + }, + { + "name": "valid", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::queue::Iqueue_item", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::queue::QueueItem" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::queue::queue_item::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Snake-62b876d4.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Snake-62b876d4.json new file mode 100644 index 0000000..427033f --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-Snake-62b876d4.json @@ -0,0 +1,471 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "snakeImpl", + "interface_name": "pixelaw::apps::snake::app::Isnake" + }, + { + "type": "enum", + "name": "pixelaw::core::utils::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::apps::snake::app::Snake", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "length", + "type": "core::integer::u8" + }, + { + "name": "first_segment_id", + "type": "core::integer::u32" + }, + { + "name": "last_segment_id", + "type": "core::integer::u32" + }, + { + "name": "direction", + "type": "pixelaw::core::utils::Direction" + }, + { + "name": "color", + "type": "core::integer::u32" + }, + { + "name": "text", + "type": "core::felt252" + }, + { + "name": "is_dying", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::Isnake", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::apps::snake::app::Snake" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-SnakeSegment-302de0d8.json b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-SnakeSegment-302de0d8.json new file mode 100644 index 0000000..7baeb86 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/abis/models/pixelaw-SnakeSegment-302de0d8.json @@ -0,0 +1,431 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "snake_segmentImpl", + "interface_name": "pixelaw::apps::snake::app::Isnake_segment" + }, + { + "type": "struct", + "name": "pixelaw::apps::snake::app::SnakeSegment", + "members": [ + { + "name": "id", + "type": "core::integer::u32" + }, + { + "name": "previous_id", + "type": "core::integer::u32" + }, + { + "name": "next_id", + "type": "core::integer::u32" + }, + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "pixel_original_color", + "type": "core::integer::u32" + }, + { + "name": "pixel_original_text", + "type": "core::felt252" + }, + { + "name": "pixel_original_app", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::Isnake_segment", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::apps::snake::app::SnakeSegment" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_segment::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/manifest.json b/contracts/manifests/dev-pop/deployment/manifest.json new file mode 100644 index 0000000..e6ffaae --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/manifest.json @@ -0,0 +1,7756 @@ +{ + "world": { + "kind": "WorldContract", + "class_hash": "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e", + "original_class_hash": "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e", + "abi": [ + { + "type": "impl", + "name": "World", + "interface_name": "dojo::world::world_contract::IWorld" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::metadata::ResourceMetadata", + "members": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::model::ModelIndex", + "variants": [ + { + "name": "Keys", + "type": "core::array::Span::" + }, + { + "name": "Id", + "type": "core::felt252" + }, + { + "name": "MemberId", + "type": "(core::felt252, core::felt252)" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "enum", + "name": "dojo::world::world_contract::Resource", + "variants": [ + { + "name": "Model", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, + { + "name": "Contract", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, + { + "name": "Namespace", + "type": "()" + }, + { + "name": "World", + "type": "()" + }, + { + "name": "Unregistered", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorld", + "items": [ + { + "type": "function", + "name": "metadata", + "inputs": [ + { + "name": "resource_selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::model::metadata::ResourceMetadata" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_metadata", + "inputs": [ + { + "name": "metadata", + "type": "dojo::model::metadata::ResourceMetadata" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "register_namespace", + "inputs": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "register_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_contract", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "init_contract", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "uuid", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "emit", + "inputs": [ + { + "name": "keys", + "type": "core::array::Array::" + }, + { + "name": "values", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "entity", + "inputs": [ + { + "name": "model_selector", + "type": "core::felt252" + }, + { + "name": "index", + "type": "dojo::model::model::ModelIndex" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ], + "outputs": [ + { + "type": "core::array::Span::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_entity", + "inputs": [ + { + "name": "model_selector", + "type": "core::felt252" + }, + { + "name": "index", + "type": "dojo::model::model::ModelIndex" + }, + { + "name": "values", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "delete_entity", + "inputs": [ + { + "name": "model_selector", + "type": "core::felt252" + }, + { + "name": "index", + "type": "dojo::model::model::ModelIndex" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "resource", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::world::world_contract::Resource" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_owner", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_owner", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_owner", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_writer", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_writer", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_writer", + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableWorld", + "interface_name": "dojo::world::world_contract::IUpgradeableWorld" + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IUpgradeableWorld", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableState", + "interface_name": "dojo::world::update::IUpgradeableState" + }, + { + "type": "struct", + "name": "dojo::world::update::StorageUpdate", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::world::update::ProgramOutput", + "members": [ + { + "name": "prev_state_root", + "type": "core::felt252" + }, + { + "name": "new_state_root", + "type": "core::felt252" + }, + { + "name": "block_number", + "type": "core::felt252" + }, + { + "name": "block_hash", + "type": "core::felt252" + }, + { + "name": "config_hash", + "type": "core::felt252" + }, + { + "name": "world_da_hash", + "type": "core::felt252" + }, + { + "name": "message_to_starknet_segment", + "type": "core::array::Span::" + }, + { + "name": "message_to_appchain_segment", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::update::IUpgradeableState", + "items": [ + { + "type": "function", + "name": "upgrade_state", + "inputs": [ + { + "name": "new_state", + "type": "core::array::Span::" + }, + { + "name": "program_output", + "type": "dojo::world::update::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ConfigImpl", + "interface_name": "dojo::world::config::IConfig" + }, + { + "type": "interface", + "name": "dojo::world::config::IConfig", + "items": [ + { + "type": "function", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_facts_registry", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_facts_registry", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::WorldSpawned", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_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" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ContractUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ContractInitialized", + "kind": "struct", + "members": [ + { + "name": "selector", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "init_calldata", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::WorldUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "uri", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::NamespaceRegistered", + "kind": "struct", + "members": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ModelRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::ModelUpgraded", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreSetRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreUpdateRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreUpdateMember", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "member_selector", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StoreDelRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "entity_id", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::WriterUpdated", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::OwnerUpdated", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::MergerProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::FactsRegistryUpdate", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::config::Config::Event", + "kind": "enum", + "variants": [ + { + "name": "DifferProgramHashUpdate", + "type": "dojo::world::config::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::world::config::Config::MergerProgramHashUpdate", + "kind": "nested" + }, + { + "name": "FactsRegistryUpdate", + "type": "dojo::world::config::Config::FactsRegistryUpdate", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::StateUpdated", + "kind": "struct", + "members": [ + { + "name": "da_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::Event", + "kind": "enum", + "variants": [ + { + "name": "WorldSpawned", + "type": "dojo::world::world_contract::world::WorldSpawned", + "kind": "nested" + }, + { + "name": "ContractDeployed", + "type": "dojo::world::world_contract::world::ContractDeployed", + "kind": "nested" + }, + { + "name": "ContractUpgraded", + "type": "dojo::world::world_contract::world::ContractUpgraded", + "kind": "nested" + }, + { + "name": "ContractInitialized", + "type": "dojo::world::world_contract::world::ContractInitialized", + "kind": "nested" + }, + { + "name": "WorldUpgraded", + "type": "dojo::world::world_contract::world::WorldUpgraded", + "kind": "nested" + }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world_contract::world::MetadataUpdate", + "kind": "nested" + }, + { + "name": "NamespaceRegistered", + "type": "dojo::world::world_contract::world::NamespaceRegistered", + "kind": "nested" + }, + { + "name": "ModelRegistered", + "type": "dojo::world::world_contract::world::ModelRegistered", + "kind": "nested" + }, + { + "name": "ModelUpgraded", + "type": "dojo::world::world_contract::world::ModelUpgraded", + "kind": "nested" + }, + { + "name": "StoreSetRecord", + "type": "dojo::world::world_contract::world::StoreSetRecord", + "kind": "nested" + }, + { + "name": "StoreUpdateRecord", + "type": "dojo::world::world_contract::world::StoreUpdateRecord", + "kind": "nested" + }, + { + "name": "StoreUpdateMember", + "type": "dojo::world::world_contract::world::StoreUpdateMember", + "kind": "nested" + }, + { + "name": "StoreDelRecord", + "type": "dojo::world::world_contract::world::StoreDelRecord", + "kind": "nested" + }, + { + "name": "WriterUpdated", + "type": "dojo::world::world_contract::world::WriterUpdated", + "kind": "nested" + }, + { + "name": "OwnerUpdated", + "type": "dojo::world::world_contract::world::OwnerUpdated", + "kind": "nested" + }, + { + "name": "ConfigEvent", + "type": "dojo::world::config::Config::Event", + "kind": "nested" + }, + { + "name": "StateUpdated", + "type": "dojo::world::world_contract::world::StateUpdated", + "kind": "nested" + } + ] + } + ], + "address": "0x14e1fa1d0be613f796880118d4b437212775a7344229d532d33a58dc825fdd9", + "transaction_hash": "0x1863b8da9d423607a64e8982539a2ed144917cd460449b45806ed64f2dd7770", + "block_number": 3, + "seed": "dev-pop", + "metadata": { + "profile_name": "dev-pop", + "rpc_url": "http://localhost:5050/" + }, + "manifest_name": "dojo-world" + }, + "base": { + "kind": "Class", + "class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", + "original_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", + "abi": "manifests/dev-pop/deployment/abis/dojo-base.json", + "tag": "dojo-base", + "manifest_name": "dojo-base" + }, + "contracts": [ + { + "kind": "DojoContract", + "address": "0x5da0028faad63d0a210730d3f8d6f0d849dc4965ae82b7e82c5655648e918e3", + "class_hash": "0x31ad47b55f3d18e932dd541e5686084703b0f7d123558c0a9bec6d6e09720b0", + "original_class_hash": "0x31ad47b55f3d18e932dd541e5686084703b0f7d123558c0a9bec6d6e09720b0", + "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", + "abi": [ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "pixelaw::core::actions::IActions" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permission", + "members": [ + { + "name": "app", + "type": "core::bool" + }, + { + "name": "color", + "type": "core::bool" + }, + { + "name": "owner", + "type": "core::bool" + }, + { + "name": "text", + "type": "core::bool" + }, + { + "name": "timestamp", + "type": "core::bool" + }, + { + "name": "action", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::Pixel", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "color", + "type": "core::integer::u32" + }, + { + "name": "created_at", + "type": "core::integer::u64" + }, + { + "name": "updated_at", + "type": "core::integer::u64" + }, + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "text", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::felt252" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u64" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::PixelUpdate", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "color", + "type": "core::option::Option::" + }, + { + "name": "owner", + "type": "core::option::Option::" + }, + { + "name": "app", + "type": "core::option::Option::" + }, + { + "name": "text", + "type": "core::option::Option::" + }, + { + "name": "timestamp", + "type": "core::option::Option::" + }, + { + "name": "action", + "type": "core::option::Option::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Position", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::actions::IActions", + "items": [ + { + "type": "function", + "name": "init", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_permission", + "inputs": [ + { + "name": "for_system", + "type": "core::felt252" + }, + { + "name": "permission", + "type": "pixelaw::core::models::permissions::Permission" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_app", + "inputs": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "has_write_access", + "inputs": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "pixel", + "type": "pixelaw::core::models::pixel::Pixel" + }, + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "process_queue", + "inputs": [ + { + "name": "id", + "type": "core::felt252" + }, + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "called_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "calldata", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "schedule_queue", + "inputs": [ + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "called_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "calldata", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_pixel", + "inputs": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "new_app", + "inputs": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "pixelaw::core::models::registry::App" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_system_address", + "inputs": [ + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_player_address", + "inputs": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "alert_player", + "inputs": [ + { + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "message", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_instruction", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "instruction", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "pixelaw::core::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "pixelaw::core::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::QueueScheduled", + "kind": "struct", + "members": [ + { + "name": "id", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "timestamp", + "type": "core::integer::u64", + "kind": "data" + }, + { + "name": "called_system", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "selector", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "calldata", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::QueueProcessed", + "kind": "struct", + "members": [ + { + "name": "id", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::AppNameUpdated", + "kind": "struct", + "members": [ + { + "name": "app", + "type": "pixelaw::core::models::registry::App", + "kind": "data" + }, + { + "name": "caller", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::Alert", + "kind": "struct", + "members": [ + { + "name": "position", + "type": "pixelaw::core::utils::Position", + "kind": "data" + }, + { + "name": "caller", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "message", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + }, + { + "name": "QueueScheduled", + "type": "pixelaw::core::actions::actions::QueueScheduled", + "kind": "nested" + }, + { + "name": "QueueProcessed", + "type": "pixelaw::core::actions::actions::QueueProcessed", + "kind": "nested" + }, + { + "name": "AppNameUpdated", + "type": "pixelaw::core::actions::actions::AppNameUpdated", + "kind": "nested" + }, + { + "name": "Alert", + "type": "pixelaw::core::actions::actions::Alert", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "init_calldata": [], + "tag": "pixelaw-actions", + "systems": [ + "init", + "update_permission", + "update_app", + "schedule_queue", + "process_queue", + "update_pixel", + "alert_player", + "set_instruction" + ], + "manifest_name": "pixelaw-actions-16928a49" + }, + { + "kind": "DojoContract", + "address": "0x4ad0858ee045ac649c267384d468077f1340f2cc08fdce052ba0c04685c751a", + "class_hash": "0x36aa9f769c7b79280ee0f6c85b660b4b113b60d79cdcd79a12d47faec8555aa", + "original_class_hash": "0x36aa9f769c7b79280ee0f6c85b660b4b113b60d79cdcd79a12d47faec8555aa", + "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", + "abi": [ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsInteroperability", + "interface_name": "pixelaw::core::traits::IInteroperability" + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::felt252" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u64" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::PixelUpdate", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "color", + "type": "core::option::Option::" + }, + { + "name": "owner", + "type": "core::option::Option::" + }, + { + "name": "app", + "type": "core::option::Option::" + }, + { + "name": "text", + "type": "core::option::Option::" + }, + { + "name": "timestamp", + "type": "core::option::Option::" + }, + { + "name": "action", + "type": "core::option::Option::" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::traits::IInteroperability", + "items": [ + { + "type": "function", + "name": "on_pre_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "on_post_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "pixelaw::apps::paint::app::IPaintActions" + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Position", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::DefaultParameters", + "members": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "color", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::paint::app::IPaintActions", + "items": [ + { + "type": "function", + "name": "init", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "interact", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "put_color", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "fade", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "pixel_row", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + }, + { + "name": "image_data", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "pixelaw::apps::paint::app::paint_actions::IDojoInit" + }, + { + "type": "interface", + "name": "pixelaw::apps::paint::app::paint_actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::paint::app::paint_actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "init_calldata": [], + "tag": "pixelaw-paint_actions", + "systems": [ + "on_pre_update", + "on_post_update", + "init", + "interact", + "put_color", + "pixel_row", + "fade" + ], + "manifest_name": "pixelaw-paint_actions-2afb94fe" + }, + { + "kind": "DojoContract", + "address": "0x74d82e8e5059354c66d413adff20a18b854c00961a29673119457d2a535bef1", + "class_hash": "0x566a961335e1183fe83b156d6349a0320f401b4f0b4b20485e2b709e748dcd0", + "original_class_hash": "0x566a961335e1183fe83b156d6349a0320f401b4f0b4b20485e2b709e748dcd0", + "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", + "abi": [ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsInteroperability", + "interface_name": "pixelaw::core::traits::IInteroperability" + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::felt252" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u64" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::PixelUpdate", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "color", + "type": "core::option::Option::" + }, + { + "name": "owner", + "type": "core::option::Option::" + }, + { + "name": "app", + "type": "core::option::Option::" + }, + { + "name": "text", + "type": "core::option::Option::" + }, + { + "name": "timestamp", + "type": "core::option::Option::" + }, + { + "name": "action", + "type": "core::option::Option::" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::traits::IInteroperability", + "items": [ + { + "type": "function", + "name": "on_pre_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "on_post_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "pixelaw::apps::snake::app::ISnakeActions" + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Position", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::DefaultParameters", + "members": [ + { + "name": "for_player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "for_system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "color", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "pixelaw::core::utils::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::ISnakeActions", + "items": [ + { + "type": "function", + "name": "init", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "interact", + "inputs": [ + { + "name": "default_params", + "type": "pixelaw::core::utils::DefaultParameters" + }, + { + "name": "direction", + "type": "pixelaw::core::utils::Direction" + } + ], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "move", + "inputs": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "pixelaw::apps::snake::app::snake_actions::IDojoInit" + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::snake_actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_actions::Moved", + "kind": "struct", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "direction", + "type": "pixelaw::core::utils::Direction", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_actions::Died", + "kind": "struct", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "x", + "type": "core::integer::u32", + "kind": "data" + }, + { + "name": "y", + "type": "core::integer::u32", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + }, + { + "name": "Moved", + "type": "pixelaw::apps::snake::app::snake_actions::Moved", + "kind": "nested" + }, + { + "name": "Died", + "type": "pixelaw::apps::snake::app::snake_actions::Died", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "init_calldata": [], + "tag": "pixelaw-snake_actions", + "systems": [ + "on_pre_update", + "on_post_update", + "init", + "move" + ], + "manifest_name": "pixelaw-snake_actions-4f967106" + } + ], + "models": [ + { + "kind": "DojoModel", + "members": [ + { + "name": "system", + "type": "ContractAddress", + "key": true + }, + { + "name": "name", + "type": "felt252", + "key": false + }, + { + "name": "manifest", + "type": "felt252", + "key": false + }, + { + "name": "icon", + "type": "felt252", + "key": false + }, + { + "name": "action", + "type": "felt252", + "key": false + } + ], + "class_hash": "0x34204d56b9f6a93b305e54a27b5e8e593f159f87212fcf39c770020b03bfce5", + "original_class_hash": "0x34204d56b9f6a93b305e54a27b5e8e593f159f87212fcf39c770020b03bfce5", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "appImpl", + "interface_name": "pixelaw::core::models::registry::Iapp" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::App", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "manifest", + "type": "core::felt252" + }, + { + "name": "icon", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iapp", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::App" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::app::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-App", + "qualified_path": "pixelaw::core::models::registry::app", + "manifest_name": "pixelaw-App-36504565" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "name", + "type": "felt252", + "key": true + }, + { + "name": "system", + "type": "ContractAddress", + "key": false + } + ], + "class_hash": "0x7d54c34e9b4215ceaada6950e0b521ef3892de01fbaea2c8323e8c2cf3329c8", + "original_class_hash": "0x7d54c34e9b4215ceaada6950e0b521ef3892de01fbaea2c8323e8c2cf3329c8", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "app_nameImpl", + "interface_name": "pixelaw::core::models::registry::Iapp_name" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::AppName", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iapp_name", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::AppName" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::app_name::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-AppName", + "qualified_path": "pixelaw::core::models::registry::app_name", + "manifest_name": "pixelaw-AppName-3b816829" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "system", + "type": "ContractAddress", + "key": true + }, + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "action", + "type": "felt252", + "key": false + } + ], + "class_hash": "0x3d55e23acf8df5ef0c25b76d5a6b7765c241c494af075c7ce3858568bec45f1", + "original_class_hash": "0x3d55e23acf8df5ef0c25b76d5a6b7765c241c494af075c7ce3858568bec45f1", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "app_userImpl", + "interface_name": "pixelaw::core::models::registry::Iapp_user" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::AppUser", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iapp_user", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::AppUser" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::app_user::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-AppUser", + "qualified_path": "pixelaw::core::models::registry::app_user", + "manifest_name": "pixelaw-AppUser-4eda3c52" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "key", + "type": "felt252", + "key": true + }, + { + "name": "value", + "type": "ContractAddress", + "key": false + } + ], + "class_hash": "0x296cfe5fb82a8b03b4aa78e35955bc70971babeb414d70a6a8acc52a4eacab2", + "original_class_hash": "0x296cfe5fb82a8b03b4aa78e35955bc70971babeb414d70a6a8acc52a4eacab2", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "core_actions_addressImpl", + "interface_name": "pixelaw::core::models::registry::Icore_actions_address" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::CoreActionsAddress", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Icore_actions_address", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::CoreActionsAddress" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::core_actions_address::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-CoreActionsAddress", + "qualified_path": "pixelaw::core::models::registry::core_actions_address", + "manifest_name": "pixelaw-CoreActionsAddress-5379e1ce" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "system", + "type": "ContractAddress", + "key": true + }, + { + "name": "selector", + "type": "felt252", + "key": true + }, + { + "name": "instruction", + "type": "felt252", + "key": false + } + ], + "class_hash": "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af", + "original_class_hash": "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "instructionImpl", + "interface_name": "pixelaw::core::models::registry::Iinstruction" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::Instruction", + "members": [ + { + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "instruction", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Iinstruction", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::Instruction" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::instruction::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-Instruction", + "qualified_path": "pixelaw::core::models::registry::instruction", + "manifest_name": "pixelaw-Instruction-4c7c4844" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "allowing_app", + "type": "ContractAddress", + "key": true + }, + { + "name": "allowed_app", + "type": "ContractAddress", + "key": true + }, + { + "name": "permission", + "type": "Permission", + "key": false + } + ], + "class_hash": "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302", + "original_class_hash": "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "permissionsImpl", + "interface_name": "pixelaw::core::models::permissions::Ipermissions" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permission", + "members": [ + { + "name": "app", + "type": "core::bool" + }, + { + "name": "color", + "type": "core::bool" + }, + { + "name": "owner", + "type": "core::bool" + }, + { + "name": "text", + "type": "core::bool" + }, + { + "name": "timestamp", + "type": "core::bool" + }, + { + "name": "action", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permissions", + "members": [ + { + "name": "allowing_app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "allowed_app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "permission", + "type": "pixelaw::core::models::permissions::Permission" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::permissions::Ipermissions", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::permissions::Permissions" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::permissions::permissions::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-Permissions", + "qualified_path": "pixelaw::core::models::permissions::permissions", + "manifest_name": "pixelaw-Permissions-72b77307" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "x", + "type": "u32", + "key": true + }, + { + "name": "y", + "type": "u32", + "key": true + }, + { + "name": "app", + "type": "ContractAddress", + "key": false + }, + { + "name": "color", + "type": "u32", + "key": false + }, + { + "name": "created_at", + "type": "u64", + "key": false + }, + { + "name": "updated_at", + "type": "u64", + "key": false + }, + { + "name": "timestamp", + "type": "u64", + "key": false + }, + { + "name": "owner", + "type": "ContractAddress", + "key": false + }, + { + "name": "text", + "type": "felt252", + "key": false + }, + { + "name": "action", + "type": "felt252", + "key": false + } + ], + "class_hash": "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d", + "original_class_hash": "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "pixelImpl", + "interface_name": "pixelaw::core::models::pixel::Ipixel" + }, + { + "type": "struct", + "name": "pixelaw::core::models::pixel::Pixel", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "app", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "color", + "type": "core::integer::u32" + }, + { + "name": "created_at", + "type": "core::integer::u64" + }, + { + "name": "updated_at", + "type": "core::integer::u64" + }, + { + "name": "timestamp", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "text", + "type": "core::felt252" + }, + { + "name": "action", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::pixel::Ipixel", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::pixel::Pixel" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::pixel::pixel::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-Pixel", + "qualified_path": "pixelaw::core::models::pixel::pixel", + "manifest_name": "pixelaw-Pixel-7e607b2f" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "id", + "type": "felt252", + "key": true + }, + { + "name": "valid", + "type": "bool", + "key": false + } + ], + "class_hash": "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70", + "original_class_hash": "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "queue_itemImpl", + "interface_name": "pixelaw::core::models::queue::Iqueue_item" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::queue::QueueItem", + "members": [ + { + "name": "id", + "type": "core::felt252" + }, + { + "name": "valid", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::queue::Iqueue_item", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::queue::QueueItem" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::queue::queue_item::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-QueueItem", + "qualified_path": "pixelaw::core::models::queue::queue_item", + "manifest_name": "pixelaw-QueueItem-549a17f2" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "owner", + "type": "ContractAddress", + "key": true + }, + { + "name": "length", + "type": "u8", + "key": false + }, + { + "name": "first_segment_id", + "type": "u32", + "key": false + }, + { + "name": "last_segment_id", + "type": "u32", + "key": false + }, + { + "name": "direction", + "type": "Direction", + "key": false + }, + { + "name": "color", + "type": "u32", + "key": false + }, + { + "name": "text", + "type": "felt252", + "key": false + }, + { + "name": "is_dying", + "type": "bool", + "key": false + } + ], + "class_hash": "0x5a3afeed7a51a51cab27a99c9d99064fc467ecdb9a8cc606c4d4899dffb7f6c", + "original_class_hash": "0x5a3afeed7a51a51cab27a99c9d99064fc467ecdb9a8cc606c4d4899dffb7f6c", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "snakeImpl", + "interface_name": "pixelaw::apps::snake::app::Isnake" + }, + { + "type": "enum", + "name": "pixelaw::core::utils::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::apps::snake::app::Snake", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "length", + "type": "core::integer::u8" + }, + { + "name": "first_segment_id", + "type": "core::integer::u32" + }, + { + "name": "last_segment_id", + "type": "core::integer::u32" + }, + { + "name": "direction", + "type": "pixelaw::core::utils::Direction" + }, + { + "name": "color", + "type": "core::integer::u32" + }, + { + "name": "text", + "type": "core::felt252" + }, + { + "name": "is_dying", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::Isnake", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::apps::snake::app::Snake" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-Snake", + "qualified_path": "pixelaw::apps::snake::app::snake", + "manifest_name": "pixelaw-Snake-62b876d4" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "id", + "type": "u32", + "key": true + }, + { + "name": "previous_id", + "type": "u32", + "key": false + }, + { + "name": "next_id", + "type": "u32", + "key": false + }, + { + "name": "x", + "type": "u32", + "key": false + }, + { + "name": "y", + "type": "u32", + "key": false + }, + { + "name": "pixel_original_color", + "type": "u32", + "key": false + }, + { + "name": "pixel_original_text", + "type": "felt252", + "key": false + }, + { + "name": "pixel_original_app", + "type": "ContractAddress", + "key": false + } + ], + "class_hash": "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f", + "original_class_hash": "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "snake_segmentImpl", + "interface_name": "pixelaw::apps::snake::app::Isnake_segment" + }, + { + "type": "struct", + "name": "pixelaw::apps::snake::app::SnakeSegment", + "members": [ + { + "name": "id", + "type": "core::integer::u32" + }, + { + "name": "previous_id", + "type": "core::integer::u32" + }, + { + "name": "next_id", + "type": "core::integer::u32" + }, + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + }, + { + "name": "pixel_original_color", + "type": "core::integer::u32" + }, + { + "name": "pixel_original_text", + "type": "core::felt252" + }, + { + "name": "pixel_original_app", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::apps::snake::app::Isnake_segment", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::apps::snake::app::SnakeSegment" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::apps::snake::app::snake_segment::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-SnakeSegment", + "qualified_path": "pixelaw::apps::snake::app::snake_segment", + "manifest_name": "pixelaw-SnakeSegment-302de0d8" + } + ] +} \ No newline at end of file diff --git a/contracts/manifests/dev-pop/deployment/manifest.toml b/contracts/manifests/dev-pop/deployment/manifest.toml new file mode 100644 index 0000000..8b3e955 --- /dev/null +++ b/contracts/manifests/dev-pop/deployment/manifest.toml @@ -0,0 +1,406 @@ +[world] +kind = "WorldContract" +class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +original_class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +abi = "manifests/dev-pop/deployment/abis/dojo-world.json" +address = "0x14e1fa1d0be613f796880118d4b437212775a7344229d532d33a58dc825fdd9" +transaction_hash = "0x1863b8da9d423607a64e8982539a2ed144917cd460449b45806ed64f2dd7770" +block_number = 3 +seed = "dev-pop" +manifest_name = "dojo-world" + +[world.metadata] +profile_name = "dev-pop" +rpc_url = "http://localhost:5050/" + +[base] +kind = "Class" +class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +original_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +abi = "manifests/dev-pop/deployment/abis/dojo-base.json" +tag = "dojo-base" +manifest_name = "dojo-base" + +[[contracts]] +kind = "DojoContract" +address = "0x5da0028faad63d0a210730d3f8d6f0d849dc4965ae82b7e82c5655648e918e3" +class_hash = "0x31ad47b55f3d18e932dd541e5686084703b0f7d123558c0a9bec6d6e09720b0" +original_class_hash = "0x31ad47b55f3d18e932dd541e5686084703b0f7d123558c0a9bec6d6e09720b0" +base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +abi = "manifests/dev-pop/deployment/abis/contracts/pixelaw-actions-16928a49.json" +reads = [] +writes = [] +init_calldata = [] +tag = "pixelaw-actions" +systems = [ + "init", + "update_permission", + "update_app", + "schedule_queue", + "process_queue", + "update_pixel", + "alert_player", + "set_instruction", +] +manifest_name = "pixelaw-actions-16928a49" + +[[contracts]] +kind = "DojoContract" +address = "0x4ad0858ee045ac649c267384d468077f1340f2cc08fdce052ba0c04685c751a" +class_hash = "0x36aa9f769c7b79280ee0f6c85b660b4b113b60d79cdcd79a12d47faec8555aa" +original_class_hash = "0x36aa9f769c7b79280ee0f6c85b660b4b113b60d79cdcd79a12d47faec8555aa" +base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +abi = "manifests/dev-pop/deployment/abis/contracts/pixelaw-paint_actions-2afb94fe.json" +reads = [] +writes = [] +init_calldata = [] +tag = "pixelaw-paint_actions" +systems = [ + "on_pre_update", + "on_post_update", + "init", + "interact", + "put_color", + "pixel_row", + "fade", +] +manifest_name = "pixelaw-paint_actions-2afb94fe" + +[[contracts]] +kind = "DojoContract" +address = "0x74d82e8e5059354c66d413adff20a18b854c00961a29673119457d2a535bef1" +class_hash = "0x566a961335e1183fe83b156d6349a0320f401b4f0b4b20485e2b709e748dcd0" +original_class_hash = "0x566a961335e1183fe83b156d6349a0320f401b4f0b4b20485e2b709e748dcd0" +base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +abi = "manifests/dev-pop/deployment/abis/contracts/pixelaw-snake_actions-4f967106.json" +reads = [] +writes = [] +init_calldata = [] +tag = "pixelaw-snake_actions" +systems = [ + "on_pre_update", + "on_post_update", + "init", + "move", +] +manifest_name = "pixelaw-snake_actions-4f967106" + +[[models]] +kind = "DojoModel" +class_hash = "0x34204d56b9f6a93b305e54a27b5e8e593f159f87212fcf39c770020b03bfce5" +original_class_hash = "0x34204d56b9f6a93b305e54a27b5e8e593f159f87212fcf39c770020b03bfce5" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-App-36504565.json" +tag = "pixelaw-App" +qualified_path = "pixelaw::core::models::registry::app" +manifest_name = "pixelaw-App-36504565" + +[[models.members]] +name = "system" +type = "ContractAddress" +key = true + +[[models.members]] +name = "name" +type = "felt252" +key = false + +[[models.members]] +name = "manifest" +type = "felt252" +key = false + +[[models.members]] +name = "icon" +type = "felt252" +key = false + +[[models.members]] +name = "action" +type = "felt252" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x7d54c34e9b4215ceaada6950e0b521ef3892de01fbaea2c8323e8c2cf3329c8" +original_class_hash = "0x7d54c34e9b4215ceaada6950e0b521ef3892de01fbaea2c8323e8c2cf3329c8" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-AppName-3b816829.json" +tag = "pixelaw-AppName" +qualified_path = "pixelaw::core::models::registry::app_name" +manifest_name = "pixelaw-AppName-3b816829" + +[[models.members]] +name = "name" +type = "felt252" +key = true + +[[models.members]] +name = "system" +type = "ContractAddress" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x3d55e23acf8df5ef0c25b76d5a6b7765c241c494af075c7ce3858568bec45f1" +original_class_hash = "0x3d55e23acf8df5ef0c25b76d5a6b7765c241c494af075c7ce3858568bec45f1" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-AppUser-4eda3c52.json" +tag = "pixelaw-AppUser" +qualified_path = "pixelaw::core::models::registry::app_user" +manifest_name = "pixelaw-AppUser-4eda3c52" + +[[models.members]] +name = "system" +type = "ContractAddress" +key = true + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "action" +type = "felt252" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x296cfe5fb82a8b03b4aa78e35955bc70971babeb414d70a6a8acc52a4eacab2" +original_class_hash = "0x296cfe5fb82a8b03b4aa78e35955bc70971babeb414d70a6a8acc52a4eacab2" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-CoreActionsAddress-5379e1ce.json" +tag = "pixelaw-CoreActionsAddress" +qualified_path = "pixelaw::core::models::registry::core_actions_address" +manifest_name = "pixelaw-CoreActionsAddress-5379e1ce" + +[[models.members]] +name = "key" +type = "felt252" +key = true + +[[models.members]] +name = "value" +type = "ContractAddress" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af" +original_class_hash = "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-Instruction-4c7c4844.json" +tag = "pixelaw-Instruction" +qualified_path = "pixelaw::core::models::registry::instruction" +manifest_name = "pixelaw-Instruction-4c7c4844" + +[[models.members]] +name = "system" +type = "ContractAddress" +key = true + +[[models.members]] +name = "selector" +type = "felt252" +key = true + +[[models.members]] +name = "instruction" +type = "felt252" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302" +original_class_hash = "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-Permissions-72b77307.json" +tag = "pixelaw-Permissions" +qualified_path = "pixelaw::core::models::permissions::permissions" +manifest_name = "pixelaw-Permissions-72b77307" + +[[models.members]] +name = "allowing_app" +type = "ContractAddress" +key = true + +[[models.members]] +name = "allowed_app" +type = "ContractAddress" +key = true + +[[models.members]] +name = "permission" +type = "Permission" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d" +original_class_hash = "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-Pixel-7e607b2f.json" +tag = "pixelaw-Pixel" +qualified_path = "pixelaw::core::models::pixel::pixel" +manifest_name = "pixelaw-Pixel-7e607b2f" + +[[models.members]] +name = "x" +type = "u32" +key = true + +[[models.members]] +name = "y" +type = "u32" +key = true + +[[models.members]] +name = "app" +type = "ContractAddress" +key = false + +[[models.members]] +name = "color" +type = "u32" +key = false + +[[models.members]] +name = "created_at" +type = "u64" +key = false + +[[models.members]] +name = "updated_at" +type = "u64" +key = false + +[[models.members]] +name = "timestamp" +type = "u64" +key = false + +[[models.members]] +name = "owner" +type = "ContractAddress" +key = false + +[[models.members]] +name = "text" +type = "felt252" +key = false + +[[models.members]] +name = "action" +type = "felt252" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70" +original_class_hash = "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-QueueItem-549a17f2.json" +tag = "pixelaw-QueueItem" +qualified_path = "pixelaw::core::models::queue::queue_item" +manifest_name = "pixelaw-QueueItem-549a17f2" + +[[models.members]] +name = "id" +type = "felt252" +key = true + +[[models.members]] +name = "valid" +type = "bool" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x5a3afeed7a51a51cab27a99c9d99064fc467ecdb9a8cc606c4d4899dffb7f6c" +original_class_hash = "0x5a3afeed7a51a51cab27a99c9d99064fc467ecdb9a8cc606c4d4899dffb7f6c" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-Snake-62b876d4.json" +tag = "pixelaw-Snake" +qualified_path = "pixelaw::apps::snake::app::snake" +manifest_name = "pixelaw-Snake-62b876d4" + +[[models.members]] +name = "owner" +type = "ContractAddress" +key = true + +[[models.members]] +name = "length" +type = "u8" +key = false + +[[models.members]] +name = "first_segment_id" +type = "u32" +key = false + +[[models.members]] +name = "last_segment_id" +type = "u32" +key = false + +[[models.members]] +name = "direction" +type = "Direction" +key = false + +[[models.members]] +name = "color" +type = "u32" +key = false + +[[models.members]] +name = "text" +type = "felt252" +key = false + +[[models.members]] +name = "is_dying" +type = "bool" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f" +original_class_hash = "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f" +abi = "manifests/dev-pop/deployment/abis/models/pixelaw-SnakeSegment-302de0d8.json" +tag = "pixelaw-SnakeSegment" +qualified_path = "pixelaw::apps::snake::app::snake_segment" +manifest_name = "pixelaw-SnakeSegment-302de0d8" + +[[models.members]] +name = "id" +type = "u32" +key = true + +[[models.members]] +name = "previous_id" +type = "u32" +key = false + +[[models.members]] +name = "next_id" +type = "u32" +key = false + +[[models.members]] +name = "x" +type = "u32" +key = false + +[[models.members]] +name = "y" +type = "u32" +key = false + +[[models.members]] +name = "pixel_original_color" +type = "u32" +key = false + +[[models.members]] +name = "pixel_original_text" +type = "felt252" +key = false + +[[models.members]] +name = "pixel_original_app" +type = "ContractAddress" +key = false diff --git a/contracts/manifests/dev/base/abis/contracts/pixelaw-actions-16928a49.json b/contracts/manifests/dev/base/abis/contracts/pixelaw-actions-16928a49.json index e71ba18..b5bbc76 100644 --- a/contracts/manifests/dev/base/abis/contracts/pixelaw-actions-16928a49.json +++ b/contracts/manifests/dev/base/abis/contracts/pixelaw-actions-16928a49.json @@ -28,7 +28,7 @@ "items": [ { "type": "function", - "name": "contract_name", + "name": "name", "inputs": [], "outputs": [ { @@ -181,11 +181,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "app", @@ -283,11 +283,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "color", @@ -353,14 +353,78 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", + "type": "core::integer::u16" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Bounds", + "members": [ + { + "name": "x_min", + "type": "core::integer::u16" + }, + { + "name": "y_min", + "type": "core::integer::u16" + }, + { + "name": "x_max", + "type": "core::integer::u16" + }, + { + "name": "y_max", + "type": "core::integer::u16" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::area::Area", + "members": [ + { + "name": "id", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "default_color", "type": "core::integer::u32" } ] }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "pixelaw::core::models::area::Area" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, { "type": "interface", "name": "pixelaw::core::actions::IActions", @@ -407,6 +471,10 @@ { "name": "pixel_update", "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "area_id_hint", + "type": "core::option::Option::" } ], "outputs": [ @@ -514,70 +582,106 @@ }, { "type": "function", - "name": "get_system_address", + "name": "alert_player", "inputs": [ { - "name": "for_system", + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "player", "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "message", + "type": "core::felt252" } ], - "outputs": [ + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_instruction", + "inputs": [ { - "type": "core::starknet::contract_address::ContractAddress" + "name": "selector", + "type": "core::felt252" + }, + { + "name": "instruction", + "type": "core::felt252" } ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" }, { "type": "function", - "name": "get_player_address", + "name": "add_area", "inputs": [ { - "name": "for_player", + "name": "bounds", + "type": "pixelaw::core::utils::Bounds" + }, + { + "name": "owner", "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "default_color", + "type": "core::integer::u32" } ], "outputs": [ { - "type": "core::starknet::contract_address::ContractAddress" + "type": "pixelaw::core::models::area::Area" } ], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", - "name": "alert_player", + "name": "remove_area", + "inputs": [ + { + "name": "area_id", + "type": "core::integer::u64" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "find_area_by_position", "inputs": [ { "name": "position", "type": "pixelaw::core::utils::Position" - }, - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, + } + ], + "outputs": [ { - "name": "message", - "type": "core::felt252" + "type": "core::option::Option::" } ], - "outputs": [], "state_mutability": "external" }, { "type": "function", - "name": "set_instruction", + "name": "find_areas_inside_bounds", "inputs": [ { - "name": "selector", - "type": "core::felt252" - }, + "name": "bounds", + "type": "pixelaw::core::utils::Bounds" + } + ], + "outputs": [ { - "name": "instruction", - "type": "core::felt252" + "type": "core::array::Span::" } ], - "outputs": [], "state_mutability": "external" } ] diff --git a/contracts/manifests/dev/base/abis/contracts/pixelaw-paint_actions-2afb94fe.json b/contracts/manifests/dev/base/abis/contracts/pixelaw-paint_actions-2afb94fe.json index 43c7d6b..39cfdee 100644 --- a/contracts/manifests/dev/base/abis/contracts/pixelaw-paint_actions-2afb94fe.json +++ b/contracts/manifests/dev/base/abis/contracts/pixelaw-paint_actions-2afb94fe.json @@ -28,7 +28,7 @@ "items": [ { "type": "function", - "name": "contract_name", + "name": "name", "inputs": [], "outputs": [ { @@ -128,8 +128,8 @@ }, { "type": "impl", - "name": "ActionsInteroperability", - "interface_name": "pixelaw::core::traits::IInteroperability" + "name": "Actions", + "interface_name": "pixelaw::apps::paint::app::IPaintActions" }, { "type": "enum", @@ -193,11 +193,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "color", @@ -247,68 +247,17 @@ } ] }, - { - "type": "interface", - "name": "pixelaw::core::traits::IInteroperability", - "items": [ - { - "type": "function", - "name": "on_pre_update", - "inputs": [ - { - "name": "pixel_update", - "type": "pixelaw::core::models::pixel::PixelUpdate" - }, - { - "name": "app_caller", - "type": "pixelaw::core::models::registry::App" - }, - { - "name": "player_caller", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "on_post_update", - "inputs": [ - { - "name": "pixel_update", - "type": "pixelaw::core::models::pixel::PixelUpdate" - }, - { - "name": "app_caller", - "type": "pixelaw::core::models::registry::App" - }, - { - "name": "player_caller", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "impl", - "name": "ActionsImpl", - "interface_name": "pixelaw::apps::paint::app::IPaintActions" - }, { "type": "struct", "name": "pixelaw::core::utils::Position", "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" } ] }, @@ -317,12 +266,12 @@ "name": "pixelaw::core::utils::DefaultParameters", "members": [ { - "name": "for_player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "player_override", + "type": "core::option::Option::" }, { - "name": "for_system", - "type": "core::starknet::contract_address::ContractAddress" + "name": "system_override", + "type": "core::option::Option::" }, { "name": "position", @@ -355,6 +304,46 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "on_pre_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "on_post_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "interact", diff --git a/contracts/manifests/dev/base/abis/contracts/pixelaw-snake_actions-4f967106.json b/contracts/manifests/dev/base/abis/contracts/pixelaw-snake_actions-4f967106.json index 7db4153..93dbe91 100644 --- a/contracts/manifests/dev/base/abis/contracts/pixelaw-snake_actions-4f967106.json +++ b/contracts/manifests/dev/base/abis/contracts/pixelaw-snake_actions-4f967106.json @@ -28,7 +28,7 @@ "items": [ { "type": "function", - "name": "contract_name", + "name": "name", "inputs": [], "outputs": [ { @@ -129,7 +129,7 @@ { "type": "impl", "name": "ActionsInteroperability", - "interface_name": "pixelaw::core::traits::IInteroperability" + "interface_name": "pixelaw::core::traits::IHooks" }, { "type": "enum", @@ -193,11 +193,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "color", @@ -249,7 +249,7 @@ }, { "type": "interface", - "name": "pixelaw::core::traits::IInteroperability", + "name": "pixelaw::core::traits::IHooks", "items": [ { "type": "function", @@ -304,11 +304,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" } ] }, @@ -317,12 +317,12 @@ "name": "pixelaw::core::utils::DefaultParameters", "members": [ { - "name": "for_player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "player_override", + "type": "core::option::Option::" }, { - "name": "for_system", - "type": "core::starknet::contract_address::ContractAddress" + "name": "system_override", + "type": "core::option::Option::" }, { "name": "position", @@ -499,12 +499,12 @@ }, { "name": "x", - "type": "core::integer::u32", + "type": "core::integer::u16", "kind": "data" }, { "name": "y", - "type": "core::integer::u32", + "type": "core::integer::u16", "kind": "data" } ] diff --git a/contracts/manifests/dev/base/abis/models/pixelaw-Area-41f22f17.json b/contracts/manifests/dev/base/abis/models/pixelaw-Area-41f22f17.json new file mode 100644 index 0000000..0e18974 --- /dev/null +++ b/contracts/manifests/dev/base/abis/models/pixelaw-Area-41f22f17.json @@ -0,0 +1,411 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "areaImpl", + "interface_name": "pixelaw::core::models::area::Iarea" + }, + { + "type": "struct", + "name": "pixelaw::core::models::area::Area", + "members": [ + { + "name": "id", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "default_color", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::area::Iarea", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::area::Area" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::area::area::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev/base/abis/models/pixelaw-Pixel-7e607b2f.json b/contracts/manifests/dev/base/abis/models/pixelaw-Pixel-7e607b2f.json index 8f6c36a..f667dbb 100644 --- a/contracts/manifests/dev/base/abis/models/pixelaw-Pixel-7e607b2f.json +++ b/contracts/manifests/dev/base/abis/models/pixelaw-Pixel-7e607b2f.json @@ -372,11 +372,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "app", diff --git a/contracts/manifests/dev/base/abis/models/pixelaw-RTree-3baaf9fe.json b/contracts/manifests/dev/base/abis/models/pixelaw-RTree-3baaf9fe.json new file mode 100644 index 0000000..0a1e645 --- /dev/null +++ b/contracts/manifests/dev/base/abis/models/pixelaw-RTree-3baaf9fe.json @@ -0,0 +1,407 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "r_treeImpl", + "interface_name": "pixelaw::core::models::area::Ir_tree" + }, + { + "type": "struct", + "name": "pixelaw::core::models::area::RTree", + "members": [ + { + "name": "id", + "type": "core::integer::u64" + }, + { + "name": "children", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::area::Ir_tree", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::area::RTree" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::area::r_tree::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev/base/abis/models/pixelaw-SnakeSegment-302de0d8.json b/contracts/manifests/dev/base/abis/models/pixelaw-SnakeSegment-302de0d8.json index 7baeb86..9b9778b 100644 --- a/contracts/manifests/dev/base/abis/models/pixelaw-SnakeSegment-302de0d8.json +++ b/contracts/manifests/dev/base/abis/models/pixelaw-SnakeSegment-302de0d8.json @@ -384,11 +384,11 @@ }, { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "pixel_original_color", diff --git a/contracts/manifests/dev/base/contracts/pixelaw-actions-16928a49.toml b/contracts/manifests/dev/base/contracts/pixelaw-actions-16928a49.toml index 5ab4bd2..d2af145 100644 --- a/contracts/manifests/dev/base/contracts/pixelaw-actions-16928a49.toml +++ b/contracts/manifests/dev/base/contracts/pixelaw-actions-16928a49.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x17d390af6c3b449b52da5a0969a00006a3b7935ffc08192dc8cefdeb563488f" -original_class_hash = "0x17d390af6c3b449b52da5a0969a00006a3b7935ffc08192dc8cefdeb563488f" +class_hash = "0x123a3081ef2ee10896770486a01bbb72fc98dbe1d638b11cd0928516e2f4589" +original_class_hash = "0x123a3081ef2ee10896770486a01bbb72fc98dbe1d638b11cd0928516e2f4589" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/pixelaw-actions-16928a49.json" reads = [] @@ -15,5 +15,6 @@ systems = [ "update_pixel", "alert_player", "set_instruction", + "remove_area", ] manifest_name = "pixelaw-actions-16928a49" diff --git a/contracts/manifests/dev/base/contracts/pixelaw-paint_actions-2afb94fe.toml b/contracts/manifests/dev/base/contracts/pixelaw-paint_actions-2afb94fe.toml index 52dac22..4e78f81 100644 --- a/contracts/manifests/dev/base/contracts/pixelaw-paint_actions-2afb94fe.toml +++ b/contracts/manifests/dev/base/contracts/pixelaw-paint_actions-2afb94fe.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0xcd76621d6a3678a27c2d5424907d1151e04b4ceb28c02d800b3ddfe2d016f2" -original_class_hash = "0xcd76621d6a3678a27c2d5424907d1151e04b4ceb28c02d800b3ddfe2d016f2" +class_hash = "0x360a33b4d17c3858ae5a1850cb4e22866d88f2e710d897643af4813f1ec2d3c" +original_class_hash = "0x360a33b4d17c3858ae5a1850cb4e22866d88f2e710d897643af4813f1ec2d3c" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/pixelaw-paint_actions-2afb94fe.json" reads = [] @@ -8,9 +8,9 @@ writes = [] init_calldata = [] tag = "pixelaw-paint_actions" systems = [ + "init", "on_pre_update", "on_post_update", - "init", "interact", "put_color", "pixel_row", diff --git a/contracts/manifests/dev/base/contracts/pixelaw-snake_actions-4f967106.toml b/contracts/manifests/dev/base/contracts/pixelaw-snake_actions-4f967106.toml index 4c8653d..a6fcc57 100644 --- a/contracts/manifests/dev/base/contracts/pixelaw-snake_actions-4f967106.toml +++ b/contracts/manifests/dev/base/contracts/pixelaw-snake_actions-4f967106.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x6dbe6fed41677edc917050c80b2e15727f48534fd7752e153e7cf74542ebad9" -original_class_hash = "0x6dbe6fed41677edc917050c80b2e15727f48534fd7752e153e7cf74542ebad9" +class_hash = "0x17502315bf1d1704ad7a1203887b14a4728f829b9337d16b1a1e78821842079" +original_class_hash = "0x17502315bf1d1704ad7a1203887b14a4728f829b9337d16b1a1e78821842079" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/pixelaw-snake_actions-4f967106.json" reads = [] diff --git a/contracts/manifests/dev/base/dojo-world.toml b/contracts/manifests/dev/base/dojo-world.toml index ff32465..4dfc391 100644 --- a/contracts/manifests/dev/base/dojo-world.toml +++ b/contracts/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" -original_class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" +original_class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/contracts/manifests/dev/base/models/pixelaw-Area-41f22f17.toml b/contracts/manifests/dev/base/models/pixelaw-Area-41f22f17.toml new file mode 100644 index 0000000..e773388 --- /dev/null +++ b/contracts/manifests/dev/base/models/pixelaw-Area-41f22f17.toml @@ -0,0 +1,22 @@ +kind = "DojoModel" +class_hash = "0x7974a29051adec721e79e8d6f107df99d710e9d1948684c8daf9459b9117f6e" +original_class_hash = "0x7974a29051adec721e79e8d6f107df99d710e9d1948684c8daf9459b9117f6e" +abi = "manifests/dev/base/abis/models/pixelaw-Area-41f22f17.json" +tag = "pixelaw-Area" +qualified_path = "pixelaw::core::models::area::area" +manifest_name = "pixelaw-Area-41f22f17" + +[[members]] +name = "id" +type = "u64" +key = true + +[[members]] +name = "owner" +type = "ContractAddress" +key = false + +[[members]] +name = "default_color" +type = "u32" +key = false diff --git a/contracts/manifests/dev/base/models/pixelaw-Pixel-7e607b2f.toml b/contracts/manifests/dev/base/models/pixelaw-Pixel-7e607b2f.toml index 31ddb3b..47db356 100644 --- a/contracts/manifests/dev/base/models/pixelaw-Pixel-7e607b2f.toml +++ b/contracts/manifests/dev/base/models/pixelaw-Pixel-7e607b2f.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d" -original_class_hash = "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d" +class_hash = "0x6363714e0e5ce09675144935223ff5390e7fefe6ee059a8d62ffc79a3e146ad" +original_class_hash = "0x6363714e0e5ce09675144935223ff5390e7fefe6ee059a8d62ffc79a3e146ad" abi = "manifests/dev/base/abis/models/pixelaw-Pixel-7e607b2f.json" tag = "pixelaw-Pixel" qualified_path = "pixelaw::core::models::pixel::pixel" @@ -8,12 +8,12 @@ manifest_name = "pixelaw-Pixel-7e607b2f" [[members]] name = "x" -type = "u32" +type = "u16" key = true [[members]] name = "y" -type = "u32" +type = "u16" key = true [[members]] diff --git a/contracts/manifests/dev/base/models/pixelaw-RTree-3baaf9fe.toml b/contracts/manifests/dev/base/models/pixelaw-RTree-3baaf9fe.toml new file mode 100644 index 0000000..ec68ee3 --- /dev/null +++ b/contracts/manifests/dev/base/models/pixelaw-RTree-3baaf9fe.toml @@ -0,0 +1,17 @@ +kind = "DojoModel" +class_hash = "0x615da1d9db8eef7b84db6c92211fd202646d12de041b3e6ea6f3a7abec73e49" +original_class_hash = "0x615da1d9db8eef7b84db6c92211fd202646d12de041b3e6ea6f3a7abec73e49" +abi = "manifests/dev/base/abis/models/pixelaw-RTree-3baaf9fe.json" +tag = "pixelaw-RTree" +qualified_path = "pixelaw::core::models::area::r_tree" +manifest_name = "pixelaw-RTree-3baaf9fe" + +[[members]] +name = "id" +type = "u64" +key = true + +[[members]] +name = "children" +type = "felt252" +key = false diff --git a/contracts/manifests/dev/base/models/pixelaw-SnakeSegment-302de0d8.toml b/contracts/manifests/dev/base/models/pixelaw-SnakeSegment-302de0d8.toml index b2091d4..c88af68 100644 --- a/contracts/manifests/dev/base/models/pixelaw-SnakeSegment-302de0d8.toml +++ b/contracts/manifests/dev/base/models/pixelaw-SnakeSegment-302de0d8.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f" -original_class_hash = "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f" +class_hash = "0x54ada9d75018f6625c9ec7f35222e0b8a717aa89ea4e3df21c030a3404c1160" +original_class_hash = "0x54ada9d75018f6625c9ec7f35222e0b8a717aa89ea4e3df21c030a3404c1160" abi = "manifests/dev/base/abis/models/pixelaw-SnakeSegment-302de0d8.json" tag = "pixelaw-SnakeSegment" qualified_path = "pixelaw::apps::snake::app::snake_segment" @@ -23,12 +23,12 @@ key = false [[members]] name = "x" -type = "u32" +type = "u16" key = false [[members]] name = "y" -type = "u32" +type = "u16" key = false [[members]] diff --git a/contracts/manifests/dev/deployment/abis/contracts/pixelaw-actions-16928a49.json b/contracts/manifests/dev/deployment/abis/contracts/pixelaw-actions-16928a49.json index e71ba18..b5bbc76 100644 --- a/contracts/manifests/dev/deployment/abis/contracts/pixelaw-actions-16928a49.json +++ b/contracts/manifests/dev/deployment/abis/contracts/pixelaw-actions-16928a49.json @@ -28,7 +28,7 @@ "items": [ { "type": "function", - "name": "contract_name", + "name": "name", "inputs": [], "outputs": [ { @@ -181,11 +181,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "app", @@ -283,11 +283,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "color", @@ -353,14 +353,78 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", + "type": "core::integer::u16" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Bounds", + "members": [ + { + "name": "x_min", + "type": "core::integer::u16" + }, + { + "name": "y_min", + "type": "core::integer::u16" + }, + { + "name": "x_max", + "type": "core::integer::u16" + }, + { + "name": "y_max", + "type": "core::integer::u16" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::area::Area", + "members": [ + { + "name": "id", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "default_color", "type": "core::integer::u32" } ] }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "pixelaw::core::models::area::Area" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, { "type": "interface", "name": "pixelaw::core::actions::IActions", @@ -407,6 +471,10 @@ { "name": "pixel_update", "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "area_id_hint", + "type": "core::option::Option::" } ], "outputs": [ @@ -514,70 +582,106 @@ }, { "type": "function", - "name": "get_system_address", + "name": "alert_player", "inputs": [ { - "name": "for_system", + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "player", "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "message", + "type": "core::felt252" } ], - "outputs": [ + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_instruction", + "inputs": [ { - "type": "core::starknet::contract_address::ContractAddress" + "name": "selector", + "type": "core::felt252" + }, + { + "name": "instruction", + "type": "core::felt252" } ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" }, { "type": "function", - "name": "get_player_address", + "name": "add_area", "inputs": [ { - "name": "for_player", + "name": "bounds", + "type": "pixelaw::core::utils::Bounds" + }, + { + "name": "owner", "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "default_color", + "type": "core::integer::u32" } ], "outputs": [ { - "type": "core::starknet::contract_address::ContractAddress" + "type": "pixelaw::core::models::area::Area" } ], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", - "name": "alert_player", + "name": "remove_area", + "inputs": [ + { + "name": "area_id", + "type": "core::integer::u64" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "find_area_by_position", "inputs": [ { "name": "position", "type": "pixelaw::core::utils::Position" - }, - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, + } + ], + "outputs": [ { - "name": "message", - "type": "core::felt252" + "type": "core::option::Option::" } ], - "outputs": [], "state_mutability": "external" }, { "type": "function", - "name": "set_instruction", + "name": "find_areas_inside_bounds", "inputs": [ { - "name": "selector", - "type": "core::felt252" - }, + "name": "bounds", + "type": "pixelaw::core::utils::Bounds" + } + ], + "outputs": [ { - "name": "instruction", - "type": "core::felt252" + "type": "core::array::Span::" } ], - "outputs": [], "state_mutability": "external" } ] diff --git a/contracts/manifests/dev/deployment/abis/contracts/pixelaw-paint_actions-2afb94fe.json b/contracts/manifests/dev/deployment/abis/contracts/pixelaw-paint_actions-2afb94fe.json index 43c7d6b..39cfdee 100644 --- a/contracts/manifests/dev/deployment/abis/contracts/pixelaw-paint_actions-2afb94fe.json +++ b/contracts/manifests/dev/deployment/abis/contracts/pixelaw-paint_actions-2afb94fe.json @@ -28,7 +28,7 @@ "items": [ { "type": "function", - "name": "contract_name", + "name": "name", "inputs": [], "outputs": [ { @@ -128,8 +128,8 @@ }, { "type": "impl", - "name": "ActionsInteroperability", - "interface_name": "pixelaw::core::traits::IInteroperability" + "name": "Actions", + "interface_name": "pixelaw::apps::paint::app::IPaintActions" }, { "type": "enum", @@ -193,11 +193,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "color", @@ -247,68 +247,17 @@ } ] }, - { - "type": "interface", - "name": "pixelaw::core::traits::IInteroperability", - "items": [ - { - "type": "function", - "name": "on_pre_update", - "inputs": [ - { - "name": "pixel_update", - "type": "pixelaw::core::models::pixel::PixelUpdate" - }, - { - "name": "app_caller", - "type": "pixelaw::core::models::registry::App" - }, - { - "name": "player_caller", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "on_post_update", - "inputs": [ - { - "name": "pixel_update", - "type": "pixelaw::core::models::pixel::PixelUpdate" - }, - { - "name": "app_caller", - "type": "pixelaw::core::models::registry::App" - }, - { - "name": "player_caller", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "impl", - "name": "ActionsImpl", - "interface_name": "pixelaw::apps::paint::app::IPaintActions" - }, { "type": "struct", "name": "pixelaw::core::utils::Position", "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" } ] }, @@ -317,12 +266,12 @@ "name": "pixelaw::core::utils::DefaultParameters", "members": [ { - "name": "for_player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "player_override", + "type": "core::option::Option::" }, { - "name": "for_system", - "type": "core::starknet::contract_address::ContractAddress" + "name": "system_override", + "type": "core::option::Option::" }, { "name": "position", @@ -355,6 +304,46 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "on_pre_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "on_post_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "interact", diff --git a/contracts/manifests/dev/deployment/abis/contracts/pixelaw-snake_actions-4f967106.json b/contracts/manifests/dev/deployment/abis/contracts/pixelaw-snake_actions-4f967106.json index 7db4153..93dbe91 100644 --- a/contracts/manifests/dev/deployment/abis/contracts/pixelaw-snake_actions-4f967106.json +++ b/contracts/manifests/dev/deployment/abis/contracts/pixelaw-snake_actions-4f967106.json @@ -28,7 +28,7 @@ "items": [ { "type": "function", - "name": "contract_name", + "name": "name", "inputs": [], "outputs": [ { @@ -129,7 +129,7 @@ { "type": "impl", "name": "ActionsInteroperability", - "interface_name": "pixelaw::core::traits::IInteroperability" + "interface_name": "pixelaw::core::traits::IHooks" }, { "type": "enum", @@ -193,11 +193,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "color", @@ -249,7 +249,7 @@ }, { "type": "interface", - "name": "pixelaw::core::traits::IInteroperability", + "name": "pixelaw::core::traits::IHooks", "items": [ { "type": "function", @@ -304,11 +304,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" } ] }, @@ -317,12 +317,12 @@ "name": "pixelaw::core::utils::DefaultParameters", "members": [ { - "name": "for_player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "player_override", + "type": "core::option::Option::" }, { - "name": "for_system", - "type": "core::starknet::contract_address::ContractAddress" + "name": "system_override", + "type": "core::option::Option::" }, { "name": "position", @@ -499,12 +499,12 @@ }, { "name": "x", - "type": "core::integer::u32", + "type": "core::integer::u16", "kind": "data" }, { "name": "y", - "type": "core::integer::u32", + "type": "core::integer::u16", "kind": "data" } ] diff --git a/contracts/manifests/dev/deployment/abis/models/pixelaw-Area-41f22f17.json b/contracts/manifests/dev/deployment/abis/models/pixelaw-Area-41f22f17.json new file mode 100644 index 0000000..0e18974 --- /dev/null +++ b/contracts/manifests/dev/deployment/abis/models/pixelaw-Area-41f22f17.json @@ -0,0 +1,411 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "areaImpl", + "interface_name": "pixelaw::core::models::area::Iarea" + }, + { + "type": "struct", + "name": "pixelaw::core::models::area::Area", + "members": [ + { + "name": "id", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "default_color", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::area::Iarea", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::area::Area" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::area::area::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev/deployment/abis/models/pixelaw-Pixel-7e607b2f.json b/contracts/manifests/dev/deployment/abis/models/pixelaw-Pixel-7e607b2f.json index 8f6c36a..f667dbb 100644 --- a/contracts/manifests/dev/deployment/abis/models/pixelaw-Pixel-7e607b2f.json +++ b/contracts/manifests/dev/deployment/abis/models/pixelaw-Pixel-7e607b2f.json @@ -372,11 +372,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "app", diff --git a/contracts/manifests/dev/deployment/abis/models/pixelaw-RTree-3baaf9fe.json b/contracts/manifests/dev/deployment/abis/models/pixelaw-RTree-3baaf9fe.json new file mode 100644 index 0000000..0a1e645 --- /dev/null +++ b/contracts/manifests/dev/deployment/abis/models/pixelaw-RTree-3baaf9fe.json @@ -0,0 +1,407 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "r_treeImpl", + "interface_name": "pixelaw::core::models::area::Ir_tree" + }, + { + "type": "struct", + "name": "pixelaw::core::models::area::RTree", + "members": [ + { + "name": "id", + "type": "core::integer::u64" + }, + { + "name": "children", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::area::Ir_tree", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::area::RTree" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::area::r_tree::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/contracts/manifests/dev/deployment/abis/models/pixelaw-SnakeSegment-302de0d8.json b/contracts/manifests/dev/deployment/abis/models/pixelaw-SnakeSegment-302de0d8.json index 7baeb86..9b9778b 100644 --- a/contracts/manifests/dev/deployment/abis/models/pixelaw-SnakeSegment-302de0d8.json +++ b/contracts/manifests/dev/deployment/abis/models/pixelaw-SnakeSegment-302de0d8.json @@ -384,11 +384,11 @@ }, { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "pixel_original_color", diff --git a/contracts/manifests/dev/deployment/manifest.json b/contracts/manifests/dev/deployment/manifest.json index 496323c..4573c84 100644 --- a/contracts/manifests/dev/deployment/manifest.json +++ b/contracts/manifests/dev/deployment/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e", - "original_class_hash": "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e", + "class_hash": "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce", + "original_class_hash": "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce", "abi": [ { "type": "impl", @@ -1234,8 +1234,8 @@ ] } ], - "address": "0x263ae44e5414519a5c5a135cccaf3d9d7ee196d37e8de47a178da91f3de9b34", - "transaction_hash": "0x507cd13b0e34b357d25bd0ddafa527c8caf0729f894e57ad9129c1f29311768", + "address": "0x4adbe4bfe631a95a5ce99d8200a8721b1ac8096ff8941cecddc4e79a7b2d5d5", + "transaction_hash": "0x58faca59d15ffd281872c1507d29a204c3c7f14a69cb7a6f26b1a7fbcbc541d", "block_number": 3, "seed": "pixelaw", "metadata": { @@ -1255,9 +1255,9 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x6c2ffdd97cb5a1bca13de416adb23a1d0e24ae3c805114b2100f6af95a7f60e", - "class_hash": "0x17d390af6c3b449b52da5a0969a00006a3b7935ffc08192dc8cefdeb563488f", - "original_class_hash": "0x17d390af6c3b449b52da5a0969a00006a3b7935ffc08192dc8cefdeb563488f", + "address": "0x23fc93581dff74d3d92a445b3f5eb8ea7c41da1e7848f370f244acbbf604a79", + "class_hash": "0x123a3081ef2ee10896770486a01bbb72fc98dbe1d638b11cd0928516e2f4589", + "original_class_hash": "0x123a3081ef2ee10896770486a01bbb72fc98dbe1d638b11cd0928516e2f4589", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -1289,7 +1289,7 @@ "items": [ { "type": "function", - "name": "contract_name", + "name": "name", "inputs": [], "outputs": [ { @@ -1442,11 +1442,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "app", @@ -1544,11 +1544,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "color", @@ -1614,14 +1614,78 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", + "type": "core::integer::u16" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::utils::Bounds", + "members": [ + { + "name": "x_min", + "type": "core::integer::u16" + }, + { + "name": "y_min", + "type": "core::integer::u16" + }, + { + "name": "x_max", + "type": "core::integer::u16" + }, + { + "name": "y_max", + "type": "core::integer::u16" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::area::Area", + "members": [ + { + "name": "id", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "default_color", "type": "core::integer::u32" } ] }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "pixelaw::core::models::area::Area" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, { "type": "interface", "name": "pixelaw::core::actions::IActions", @@ -1668,6 +1732,10 @@ { "name": "pixel_update", "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "area_id_hint", + "type": "core::option::Option::" } ], "outputs": [ @@ -1775,70 +1843,106 @@ }, { "type": "function", - "name": "get_system_address", + "name": "alert_player", "inputs": [ { - "name": "for_system", + "name": "position", + "type": "pixelaw::core::utils::Position" + }, + { + "name": "player", "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "message", + "type": "core::felt252" } ], - "outputs": [ + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_instruction", + "inputs": [ { - "type": "core::starknet::contract_address::ContractAddress" + "name": "selector", + "type": "core::felt252" + }, + { + "name": "instruction", + "type": "core::felt252" } ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" }, { "type": "function", - "name": "get_player_address", + "name": "add_area", "inputs": [ { - "name": "for_player", + "name": "bounds", + "type": "pixelaw::core::utils::Bounds" + }, + { + "name": "owner", "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "default_color", + "type": "core::integer::u32" } ], "outputs": [ { - "type": "core::starknet::contract_address::ContractAddress" + "type": "pixelaw::core::models::area::Area" } ], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", - "name": "alert_player", + "name": "remove_area", + "inputs": [ + { + "name": "area_id", + "type": "core::integer::u64" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "find_area_by_position", "inputs": [ { "name": "position", "type": "pixelaw::core::utils::Position" - }, - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, + } + ], + "outputs": [ { - "name": "message", - "type": "core::felt252" + "type": "core::option::Option::" } ], - "outputs": [], "state_mutability": "external" }, { "type": "function", - "name": "set_instruction", + "name": "find_areas_inside_bounds", "inputs": [ { - "name": "selector", - "type": "core::felt252" - }, + "name": "bounds", + "type": "pixelaw::core::utils::Bounds" + } + ], + "outputs": [ { - "name": "instruction", - "type": "core::felt252" + "type": "core::array::Span::" } ], - "outputs": [], "state_mutability": "external" } ] @@ -2035,7 +2139,16 @@ } ], "reads": [], - "writes": [], + "writes": [ + "pixelaw-App", + "pixelaw-AppName", + "pixelaw-CoreActionsAddress", + "pixelaw-Pixel", + "pixelaw-Permissions", + "pixelaw-QueueItem", + "pixelaw-Snake", + "pixelaw-Instruction" + ], "init_calldata": [], "tag": "pixelaw-actions", "systems": [ @@ -2045,15 +2158,16 @@ "process_queue", "update_pixel", "alert_player", - "set_instruction" + "set_instruction", + "remove_area" ], "manifest_name": "pixelaw-actions-16928a49" }, { "kind": "DojoContract", - "address": "0x41b6ece4125198c4de0d9d7efa2fad0af34376178b2c0a5a4487c676f35d5c6", - "class_hash": "0xcd76621d6a3678a27c2d5424907d1151e04b4ceb28c02d800b3ddfe2d016f2", - "original_class_hash": "0xcd76621d6a3678a27c2d5424907d1151e04b4ceb28c02d800b3ddfe2d016f2", + "address": "0x108da9b46a036a2b1c7bab7b9c1f4fe9b4895ce66b4dcca8580214f0f47b503", + "class_hash": "0x360a33b4d17c3858ae5a1850cb4e22866d88f2e710d897643af4813f1ec2d3c", + "original_class_hash": "0x360a33b4d17c3858ae5a1850cb4e22866d88f2e710d897643af4813f1ec2d3c", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -2085,7 +2199,7 @@ "items": [ { "type": "function", - "name": "contract_name", + "name": "name", "inputs": [], "outputs": [ { @@ -2185,8 +2299,8 @@ }, { "type": "impl", - "name": "ActionsInteroperability", - "interface_name": "pixelaw::core::traits::IInteroperability" + "name": "Actions", + "interface_name": "pixelaw::apps::paint::app::IPaintActions" }, { "type": "enum", @@ -2250,11 +2364,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "color", @@ -2304,68 +2418,17 @@ } ] }, - { - "type": "interface", - "name": "pixelaw::core::traits::IInteroperability", - "items": [ - { - "type": "function", - "name": "on_pre_update", - "inputs": [ - { - "name": "pixel_update", - "type": "pixelaw::core::models::pixel::PixelUpdate" - }, - { - "name": "app_caller", - "type": "pixelaw::core::models::registry::App" - }, - { - "name": "player_caller", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "on_post_update", - "inputs": [ - { - "name": "pixel_update", - "type": "pixelaw::core::models::pixel::PixelUpdate" - }, - { - "name": "app_caller", - "type": "pixelaw::core::models::registry::App" - }, - { - "name": "player_caller", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "impl", - "name": "ActionsImpl", - "interface_name": "pixelaw::apps::paint::app::IPaintActions" - }, { "type": "struct", "name": "pixelaw::core::utils::Position", "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" } ] }, @@ -2374,12 +2437,12 @@ "name": "pixelaw::core::utils::DefaultParameters", "members": [ { - "name": "for_player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "player_override", + "type": "core::option::Option::" }, { - "name": "for_system", - "type": "core::starknet::contract_address::ContractAddress" + "name": "system_override", + "type": "core::option::Option::" }, { "name": "position", @@ -2412,6 +2475,46 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "on_pre_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "on_post_update", + "inputs": [ + { + "name": "pixel_update", + "type": "pixelaw::core::models::pixel::PixelUpdate" + }, + { + "name": "app_caller", + "type": "pixelaw::core::models::registry::App" + }, + { + "name": "player_caller", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "interact", @@ -2545,17 +2648,27 @@ } ], "reads": [], - "writes": [], + "writes": [ + "pixelaw-Pixel" + ], "init_calldata": [], "tag": "pixelaw-paint_actions", - "systems": ["on_pre_update", "on_post_update", "init", "interact", "put_color", "pixel_row", "fade"], + "systems": [ + "init", + "on_pre_update", + "on_post_update", + "interact", + "put_color", + "pixel_row", + "fade" + ], "manifest_name": "pixelaw-paint_actions-2afb94fe" }, { "kind": "DojoContract", - "address": "0x7e90101cb87a2f0b670204fa83f70d42a48c64ef10ddf0aaf9862d84b4bc9df", - "class_hash": "0x6dbe6fed41677edc917050c80b2e15727f48534fd7752e153e7cf74542ebad9", - "original_class_hash": "0x6dbe6fed41677edc917050c80b2e15727f48534fd7752e153e7cf74542ebad9", + "address": "0x57531304fc089e7af76d7e29c73ca54583e22e88a9190d725cb9447373864db", + "class_hash": "0x17502315bf1d1704ad7a1203887b14a4728f829b9337d16b1a1e78821842079", + "original_class_hash": "0x17502315bf1d1704ad7a1203887b14a4728f829b9337d16b1a1e78821842079", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -2587,7 +2700,7 @@ "items": [ { "type": "function", - "name": "contract_name", + "name": "name", "inputs": [], "outputs": [ { @@ -2688,7 +2801,7 @@ { "type": "impl", "name": "ActionsInteroperability", - "interface_name": "pixelaw::core::traits::IInteroperability" + "interface_name": "pixelaw::core::traits::IHooks" }, { "type": "enum", @@ -2752,11 +2865,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "color", @@ -2808,7 +2921,7 @@ }, { "type": "interface", - "name": "pixelaw::core::traits::IInteroperability", + "name": "pixelaw::core::traits::IHooks", "items": [ { "type": "function", @@ -2863,11 +2976,11 @@ "members": [ { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" } ] }, @@ -2876,12 +2989,12 @@ "name": "pixelaw::core::utils::DefaultParameters", "members": [ { - "name": "for_player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "player_override", + "type": "core::option::Option::" }, { - "name": "for_system", - "type": "core::starknet::contract_address::ContractAddress" + "name": "system_override", + "type": "core::option::Option::" }, { "name": "position", @@ -3058,12 +3171,12 @@ }, { "name": "x", - "type": "core::integer::u32", + "type": "core::integer::u16", "kind": "data" }, { "name": "y", - "type": "core::integer::u32", + "type": "core::integer::u16", "kind": "data" } ] @@ -3092,10 +3205,18 @@ } ], "reads": [], - "writes": [], + "writes": [ + "pixelaw-Snake", + "pixelaw-SnakeSegment" + ], "init_calldata": [], "tag": "pixelaw-snake_actions", - "systems": ["on_pre_update", "on_post_update", "init", "move"], + "systems": [ + "on_pre_update", + "on_post_update", + "init", + "move" + ], "manifest_name": "pixelaw-snake_actions-4f967106" } ], @@ -4412,12 +4533,448 @@ "kind": "DojoModel", "members": [ { - "name": "key", - "type": "felt252", + "name": "id", + "type": "u64", "key": true }, { - "name": "value", + "name": "owner", + "type": "ContractAddress", + "key": false + }, + { + "name": "default_color", + "type": "u32", + "key": false + } + ], + "class_hash": "0x7974a29051adec721e79e8d6f107df99d710e9d1948684c8daf9459b9117f6e", + "original_class_hash": "0x7974a29051adec721e79e8d6f107df99d710e9d1948684c8daf9459b9117f6e", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "areaImpl", + "interface_name": "pixelaw::core::models::area::Iarea" + }, + { + "type": "struct", + "name": "pixelaw::core::models::area::Area", + "members": [ + { + "name": "id", + "type": "core::integer::u64" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "default_color", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::area::Iarea", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::area::Area" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::area::area::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-Area", + "qualified_path": "pixelaw::core::models::area::area", + "manifest_name": "pixelaw-Area-41f22f17" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "key", + "type": "felt252", + "key": true + }, + { + "name": "value", "type": "ContractAddress", "key": false } @@ -4789,26 +5346,462 @@ }, { "type": "impl", - "name": "core_actions_addressImpl", - "interface_name": "pixelaw::core::models::registry::Icore_actions_address" + "name": "core_actions_addressImpl", + "interface_name": "pixelaw::core::models::registry::Icore_actions_address" + }, + { + "type": "struct", + "name": "pixelaw::core::models::registry::CoreActionsAddress", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "pixelaw::core::models::registry::Icore_actions_address", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "pixelaw::core::models::registry::CoreActionsAddress" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "pixelaw::core::models::registry::core_actions_address::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "pixelaw-CoreActionsAddress", + "qualified_path": "pixelaw::core::models::registry::core_actions_address", + "manifest_name": "pixelaw-CoreActionsAddress-5379e1ce" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "system", + "type": "ContractAddress", + "key": true + }, + { + "name": "selector", + "type": "felt252", + "key": true + }, + { + "name": "instruction", + "type": "felt252", + "key": false + } + ], + "class_hash": "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af", + "original_class_hash": "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "instructionImpl", + "interface_name": "pixelaw::core::models::registry::Iinstruction" }, { "type": "struct", - "name": "pixelaw::core::models::registry::CoreActionsAddress", + "name": "pixelaw::core::models::registry::Instruction", "members": [ { - "name": "key", + "name": "system", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", "type": "core::felt252" }, { - "name": "value", - "type": "core::starknet::contract_address::ContractAddress" + "name": "instruction", + "type": "core::felt252" } ] }, { "type": "interface", - "name": "pixelaw::core::models::registry::Icore_actions_address", + "name": "pixelaw::core::models::registry::Iinstruction", "items": [ { "type": "function", @@ -4816,7 +5809,7 @@ "inputs": [ { "name": "model", - "type": "pixelaw::core::models::registry::CoreActionsAddress" + "type": "pixelaw::core::models::registry::Instruction" } ], "outputs": [], @@ -4826,36 +5819,36 @@ }, { "type": "event", - "name": "pixelaw::core::models::registry::core_actions_address::Event", + "name": "pixelaw::core::models::registry::instruction::Event", "kind": "enum", "variants": [] } ], - "tag": "pixelaw-CoreActionsAddress", - "qualified_path": "pixelaw::core::models::registry::core_actions_address", - "manifest_name": "pixelaw-CoreActionsAddress-5379e1ce" + "tag": "pixelaw-Instruction", + "qualified_path": "pixelaw::core::models::registry::instruction", + "manifest_name": "pixelaw-Instruction-4c7c4844" }, { "kind": "DojoModel", "members": [ { - "name": "system", + "name": "allowing_app", "type": "ContractAddress", "key": true }, { - "name": "selector", - "type": "felt252", + "name": "allowed_app", + "type": "ContractAddress", "key": true }, { - "name": "instruction", - "type": "felt252", + "name": "permission", + "type": "Permission", "key": false } ], - "class_hash": "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af", - "original_class_hash": "0x710dc73b9f03542890421c368ca53fe61416010f69709337bc7b40b9c3115af", + "class_hash": "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302", + "original_class_hash": "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302", "abi": [ { "type": "impl", @@ -5221,30 +6214,74 @@ }, { "type": "impl", - "name": "instructionImpl", - "interface_name": "pixelaw::core::models::registry::Iinstruction" + "name": "permissionsImpl", + "interface_name": "pixelaw::core::models::permissions::Ipermissions" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] }, { "type": "struct", - "name": "pixelaw::core::models::registry::Instruction", + "name": "pixelaw::core::models::permissions::Permission", "members": [ { - "name": "system", + "name": "app", + "type": "core::bool" + }, + { + "name": "color", + "type": "core::bool" + }, + { + "name": "owner", + "type": "core::bool" + }, + { + "name": "text", + "type": "core::bool" + }, + { + "name": "timestamp", + "type": "core::bool" + }, + { + "name": "action", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::permissions::Permissions", + "members": [ + { + "name": "allowing_app", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "selector", - "type": "core::felt252" + "name": "allowed_app", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "instruction", - "type": "core::felt252" + "name": "permission", + "type": "pixelaw::core::models::permissions::Permission" } ] }, { "type": "interface", - "name": "pixelaw::core::models::registry::Iinstruction", + "name": "pixelaw::core::models::permissions::Ipermissions", "items": [ { "type": "function", @@ -5252,7 +6289,7 @@ "inputs": [ { "name": "model", - "type": "pixelaw::core::models::registry::Instruction" + "type": "pixelaw::core::models::permissions::Permissions" } ], "outputs": [], @@ -5262,36 +6299,71 @@ }, { "type": "event", - "name": "pixelaw::core::models::registry::instruction::Event", + "name": "pixelaw::core::models::permissions::permissions::Event", "kind": "enum", "variants": [] } ], - "tag": "pixelaw-Instruction", - "qualified_path": "pixelaw::core::models::registry::instruction", - "manifest_name": "pixelaw-Instruction-4c7c4844" + "tag": "pixelaw-Permissions", + "qualified_path": "pixelaw::core::models::permissions::permissions", + "manifest_name": "pixelaw-Permissions-72b77307" }, { "kind": "DojoModel", "members": [ { - "name": "allowing_app", - "type": "ContractAddress", - "key": true + "name": "x", + "type": "u16", + "key": true + }, + { + "name": "y", + "type": "u16", + "key": true + }, + { + "name": "app", + "type": "ContractAddress", + "key": false + }, + { + "name": "color", + "type": "u32", + "key": false + }, + { + "name": "created_at", + "type": "u64", + "key": false + }, + { + "name": "updated_at", + "type": "u64", + "key": false }, { - "name": "allowed_app", + "name": "timestamp", + "type": "u64", + "key": false + }, + { + "name": "owner", "type": "ContractAddress", - "key": true + "key": false }, { - "name": "permission", - "type": "Permission", + "name": "text", + "type": "felt252", + "key": false + }, + { + "name": "action", + "type": "felt252", "key": false } ], - "class_hash": "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302", - "original_class_hash": "0x7083f333ceabd1e174c4f5b129b7d5cfeaccd7b4fcc5ea2e5a264cce7dc302", + "class_hash": "0x6363714e0e5ce09675144935223ff5390e7fefe6ee059a8d62ffc79a3e146ad", + "original_class_hash": "0x6363714e0e5ce09675144935223ff5390e7fefe6ee059a8d62ffc79a3e146ad", "abi": [ { "type": "impl", @@ -5657,74 +6729,58 @@ }, { "type": "impl", - "name": "permissionsImpl", - "interface_name": "pixelaw::core::models::permissions::Ipermissions" + "name": "pixelImpl", + "interface_name": "pixelaw::core::models::pixel::Ipixel" }, { - "type": "enum", - "name": "core::bool", - "variants": [ + "type": "struct", + "name": "pixelaw::core::models::pixel::Pixel", + "members": [ { - "name": "False", - "type": "()" + "name": "x", + "type": "core::integer::u16" }, { - "name": "True", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "pixelaw::core::models::permissions::Permission", - "members": [ + "name": "y", + "type": "core::integer::u16" + }, { "name": "app", - "type": "core::bool" + "type": "core::starknet::contract_address::ContractAddress" }, { "name": "color", - "type": "core::bool" + "type": "core::integer::u32" }, { - "name": "owner", - "type": "core::bool" + "name": "created_at", + "type": "core::integer::u64" }, { - "name": "text", - "type": "core::bool" + "name": "updated_at", + "type": "core::integer::u64" }, { "name": "timestamp", - "type": "core::bool" + "type": "core::integer::u64" }, { - "name": "action", - "type": "core::bool" - } - ] - }, - { - "type": "struct", - "name": "pixelaw::core::models::permissions::Permissions", - "members": [ - { - "name": "allowing_app", + "name": "owner", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "allowed_app", - "type": "core::starknet::contract_address::ContractAddress" + "name": "text", + "type": "core::felt252" }, { - "name": "permission", - "type": "pixelaw::core::models::permissions::Permission" + "name": "action", + "type": "core::felt252" } ] }, { "type": "interface", - "name": "pixelaw::core::models::permissions::Ipermissions", + "name": "pixelaw::core::models::pixel::Ipixel", "items": [ { "type": "function", @@ -5732,7 +6788,7 @@ "inputs": [ { "name": "model", - "type": "pixelaw::core::models::permissions::Permissions" + "type": "pixelaw::core::models::pixel::Pixel" } ], "outputs": [], @@ -5742,71 +6798,31 @@ }, { "type": "event", - "name": "pixelaw::core::models::permissions::permissions::Event", + "name": "pixelaw::core::models::pixel::pixel::Event", "kind": "enum", "variants": [] } ], - "tag": "pixelaw-Permissions", - "qualified_path": "pixelaw::core::models::permissions::permissions", - "manifest_name": "pixelaw-Permissions-72b77307" + "tag": "pixelaw-Pixel", + "qualified_path": "pixelaw::core::models::pixel::pixel", + "manifest_name": "pixelaw-Pixel-7e607b2f" }, { "kind": "DojoModel", "members": [ { - "name": "x", - "type": "u32", - "key": true - }, - { - "name": "y", - "type": "u32", - "key": true - }, - { - "name": "app", - "type": "ContractAddress", - "key": false - }, - { - "name": "color", - "type": "u32", - "key": false - }, - { - "name": "created_at", - "type": "u64", - "key": false - }, - { - "name": "updated_at", - "type": "u64", - "key": false - }, - { - "name": "timestamp", - "type": "u64", - "key": false - }, - { - "name": "owner", - "type": "ContractAddress", - "key": false - }, - { - "name": "text", + "name": "id", "type": "felt252", - "key": false + "key": true }, { - "name": "action", - "type": "felt252", + "name": "valid", + "type": "bool", "key": false } ], - "class_hash": "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d", - "original_class_hash": "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d", + "class_hash": "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70", + "original_class_hash": "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70", "abi": [ { "type": "impl", @@ -6172,58 +7188,40 @@ }, { "type": "impl", - "name": "pixelImpl", - "interface_name": "pixelaw::core::models::pixel::Ipixel" + "name": "queue_itemImpl", + "interface_name": "pixelaw::core::models::queue::Iqueue_item" }, { - "type": "struct", - "name": "pixelaw::core::models::pixel::Pixel", - "members": [ - { - "name": "x", - "type": "core::integer::u32" - }, - { - "name": "y", - "type": "core::integer::u32" - }, - { - "name": "app", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "color", - "type": "core::integer::u32" - }, - { - "name": "created_at", - "type": "core::integer::u64" - }, - { - "name": "updated_at", - "type": "core::integer::u64" - }, + "type": "enum", + "name": "core::bool", + "variants": [ { - "name": "timestamp", - "type": "core::integer::u64" + "name": "False", + "type": "()" }, { - "name": "owner", - "type": "core::starknet::contract_address::ContractAddress" - }, + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "pixelaw::core::models::queue::QueueItem", + "members": [ { - "name": "text", + "name": "id", "type": "core::felt252" }, { - "name": "action", - "type": "core::felt252" + "name": "valid", + "type": "core::bool" } ] }, { "type": "interface", - "name": "pixelaw::core::models::pixel::Ipixel", + "name": "pixelaw::core::models::queue::Iqueue_item", "items": [ { "type": "function", @@ -6231,7 +7229,7 @@ "inputs": [ { "name": "model", - "type": "pixelaw::core::models::pixel::Pixel" + "type": "pixelaw::core::models::queue::QueueItem" } ], "outputs": [], @@ -6241,31 +7239,31 @@ }, { "type": "event", - "name": "pixelaw::core::models::pixel::pixel::Event", + "name": "pixelaw::core::models::queue::queue_item::Event", "kind": "enum", "variants": [] } ], - "tag": "pixelaw-Pixel", - "qualified_path": "pixelaw::core::models::pixel::pixel", - "manifest_name": "pixelaw-Pixel-7e607b2f" + "tag": "pixelaw-QueueItem", + "qualified_path": "pixelaw::core::models::queue::queue_item", + "manifest_name": "pixelaw-QueueItem-549a17f2" }, { "kind": "DojoModel", "members": [ { "name": "id", - "type": "felt252", + "type": "u64", "key": true }, { - "name": "valid", - "type": "bool", + "name": "children", + "type": "felt252", "key": false } ], - "class_hash": "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70", - "original_class_hash": "0x672114a91934388e6a4950f164dc151894579281f4eab56fe439108fd4fca70", + "class_hash": "0x615da1d9db8eef7b84db6c92211fd202646d12de041b3e6ea6f3a7abec73e49", + "original_class_hash": "0x615da1d9db8eef7b84db6c92211fd202646d12de041b3e6ea6f3a7abec73e49", "abi": [ { "type": "impl", @@ -6631,40 +7629,26 @@ }, { "type": "impl", - "name": "queue_itemImpl", - "interface_name": "pixelaw::core::models::queue::Iqueue_item" - }, - { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] + "name": "r_treeImpl", + "interface_name": "pixelaw::core::models::area::Ir_tree" }, { "type": "struct", - "name": "pixelaw::core::models::queue::QueueItem", + "name": "pixelaw::core::models::area::RTree", "members": [ { "name": "id", - "type": "core::felt252" + "type": "core::integer::u64" }, { - "name": "valid", - "type": "core::bool" + "name": "children", + "type": "core::felt252" } ] }, { "type": "interface", - "name": "pixelaw::core::models::queue::Iqueue_item", + "name": "pixelaw::core::models::area::Ir_tree", "items": [ { "type": "function", @@ -6672,7 +7656,7 @@ "inputs": [ { "name": "model", - "type": "pixelaw::core::models::queue::QueueItem" + "type": "pixelaw::core::models::area::RTree" } ], "outputs": [], @@ -6682,14 +7666,14 @@ }, { "type": "event", - "name": "pixelaw::core::models::queue::queue_item::Event", + "name": "pixelaw::core::models::area::r_tree::Event", "kind": "enum", "variants": [] } ], - "tag": "pixelaw-QueueItem", - "qualified_path": "pixelaw::core::models::queue::queue_item", - "manifest_name": "pixelaw-QueueItem-549a17f2" + "tag": "pixelaw-RTree", + "qualified_path": "pixelaw::core::models::area::r_tree", + "manifest_name": "pixelaw-RTree-3baaf9fe" }, { "kind": "DojoModel", @@ -7232,12 +8216,12 @@ }, { "name": "x", - "type": "u32", + "type": "u16", "key": false }, { "name": "y", - "type": "u32", + "type": "u16", "key": false }, { @@ -7256,8 +8240,8 @@ "key": false } ], - "class_hash": "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f", - "original_class_hash": "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f", + "class_hash": "0x54ada9d75018f6625c9ec7f35222e0b8a717aa89ea4e3df21c030a3404c1160", + "original_class_hash": "0x54ada9d75018f6625c9ec7f35222e0b8a717aa89ea4e3df21c030a3404c1160", "abi": [ { "type": "impl", @@ -7644,11 +8628,11 @@ }, { "name": "x", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "y", - "type": "core::integer::u32" + "type": "core::integer::u16" }, { "name": "pixel_original_color", @@ -7694,4 +8678,4 @@ "manifest_name": "pixelaw-SnakeSegment-302de0d8" } ] -} +} \ No newline at end of file diff --git a/contracts/manifests/dev/deployment/manifest.toml b/contracts/manifests/dev/deployment/manifest.toml index 4be6ef1..50dffab 100644 --- a/contracts/manifests/dev/deployment/manifest.toml +++ b/contracts/manifests/dev/deployment/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" -original_class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" +original_class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" abi = "manifests/dev/deployment/abis/dojo-world.json" -address = "0x263ae44e5414519a5c5a135cccaf3d9d7ee196d37e8de47a178da91f3de9b34" -transaction_hash = "0x507cd13b0e34b357d25bd0ddafa527c8caf0729f894e57ad9129c1f29311768" +address = "0x4adbe4bfe631a95a5ce99d8200a8721b1ac8096ff8941cecddc4e79a7b2d5d5" +transaction_hash = "0x58faca59d15ffd281872c1507d29a204c3c7f14a69cb7a6f26b1a7fbcbc541d" block_number = 3 seed = "pixelaw" manifest_name = "dojo-world" @@ -23,60 +23,78 @@ manifest_name = "dojo-base" [[contracts]] kind = "DojoContract" -address = "0x6c2ffdd97cb5a1bca13de416adb23a1d0e24ae3c805114b2100f6af95a7f60e" -class_hash = "0x17d390af6c3b449b52da5a0969a00006a3b7935ffc08192dc8cefdeb563488f" -original_class_hash = "0x17d390af6c3b449b52da5a0969a00006a3b7935ffc08192dc8cefdeb563488f" +address = "0x23fc93581dff74d3d92a445b3f5eb8ea7c41da1e7848f370f244acbbf604a79" +class_hash = "0x123a3081ef2ee10896770486a01bbb72fc98dbe1d638b11cd0928516e2f4589" +original_class_hash = "0x123a3081ef2ee10896770486a01bbb72fc98dbe1d638b11cd0928516e2f4589" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/pixelaw-actions-16928a49.json" reads = [] -writes = [] +writes = [ + "pixelaw-App", + "pixelaw-AppName", + "pixelaw-CoreActionsAddress", + "pixelaw-Pixel", + "pixelaw-Permissions", + "pixelaw-QueueItem", + "pixelaw-Snake", + "pixelaw-Instruction", +] init_calldata = [] tag = "pixelaw-actions" systems = [ - "init", - "update_permission", - "schedule_queue", - "process_queue", - "update_pixel", - "alert_player", - "set_instruction", + "init", + "update_permission", + "schedule_queue", + "process_queue", + "update_pixel", + "alert_player", + "set_instruction", + "remove_area", ] manifest_name = "pixelaw-actions-16928a49" [[contracts]] kind = "DojoContract" -address = "0x41b6ece4125198c4de0d9d7efa2fad0af34376178b2c0a5a4487c676f35d5c6" -class_hash = "0xcd76621d6a3678a27c2d5424907d1151e04b4ceb28c02d800b3ddfe2d016f2" -original_class_hash = "0xcd76621d6a3678a27c2d5424907d1151e04b4ceb28c02d800b3ddfe2d016f2" +address = "0x108da9b46a036a2b1c7bab7b9c1f4fe9b4895ce66b4dcca8580214f0f47b503" +class_hash = "0x360a33b4d17c3858ae5a1850cb4e22866d88f2e710d897643af4813f1ec2d3c" +original_class_hash = "0x360a33b4d17c3858ae5a1850cb4e22866d88f2e710d897643af4813f1ec2d3c" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/pixelaw-paint_actions-2afb94fe.json" reads = [] -writes = [] +writes = ["pixelaw-Pixel"] init_calldata = [] tag = "pixelaw-paint_actions" systems = [ - "on_pre_update", - "on_post_update", - "init", - "interact", - "put_color", - "pixel_row", - "fade", + "init", + "on_pre_update", + "on_post_update", + "interact", + "put_color", + "pixel_row", + "fade", ] manifest_name = "pixelaw-paint_actions-2afb94fe" [[contracts]] kind = "DojoContract" -address = "0x7e90101cb87a2f0b670204fa83f70d42a48c64ef10ddf0aaf9862d84b4bc9df" -class_hash = "0x6dbe6fed41677edc917050c80b2e15727f48534fd7752e153e7cf74542ebad9" -original_class_hash = "0x6dbe6fed41677edc917050c80b2e15727f48534fd7752e153e7cf74542ebad9" +address = "0x57531304fc089e7af76d7e29c73ca54583e22e88a9190d725cb9447373864db" +class_hash = "0x17502315bf1d1704ad7a1203887b14a4728f829b9337d16b1a1e78821842079" +original_class_hash = "0x17502315bf1d1704ad7a1203887b14a4728f829b9337d16b1a1e78821842079" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/pixelaw-snake_actions-4f967106.json" reads = [] -writes = [] +writes = [ + "pixelaw-Snake", + "pixelaw-SnakeSegment", +] init_calldata = [] tag = "pixelaw-snake_actions" -systems = ["on_pre_update", "on_post_update", "init", "move"] +systems = [ + "on_pre_update", + "on_post_update", + "init", + "move", +] manifest_name = "pixelaw-snake_actions-4f967106" [[models]] @@ -151,6 +169,30 @@ name = "action" type = "felt252" key = false +[[models]] +kind = "DojoModel" +class_hash = "0x7974a29051adec721e79e8d6f107df99d710e9d1948684c8daf9459b9117f6e" +original_class_hash = "0x7974a29051adec721e79e8d6f107df99d710e9d1948684c8daf9459b9117f6e" +abi = "manifests/dev/deployment/abis/models/pixelaw-Area-41f22f17.json" +tag = "pixelaw-Area" +qualified_path = "pixelaw::core::models::area::area" +manifest_name = "pixelaw-Area-41f22f17" + +[[models.members]] +name = "id" +type = "u64" +key = true + +[[models.members]] +name = "owner" +type = "ContractAddress" +key = false + +[[models.members]] +name = "default_color" +type = "u32" +key = false + [[models]] kind = "DojoModel" class_hash = "0x296cfe5fb82a8b03b4aa78e35955bc70971babeb414d70a6a8acc52a4eacab2" @@ -220,8 +262,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d" -original_class_hash = "0x71570f33b7f66331952b84691bb5794ee6b19f43ad729cc654c3930f47c5f0d" +class_hash = "0x6363714e0e5ce09675144935223ff5390e7fefe6ee059a8d62ffc79a3e146ad" +original_class_hash = "0x6363714e0e5ce09675144935223ff5390e7fefe6ee059a8d62ffc79a3e146ad" abi = "manifests/dev/deployment/abis/models/pixelaw-Pixel-7e607b2f.json" tag = "pixelaw-Pixel" qualified_path = "pixelaw::core::models::pixel::pixel" @@ -229,12 +271,12 @@ manifest_name = "pixelaw-Pixel-7e607b2f" [[models.members]] name = "x" -type = "u32" +type = "u16" key = true [[models.members]] name = "y" -type = "u32" +type = "u16" key = true [[models.members]] @@ -296,6 +338,25 @@ name = "valid" type = "bool" key = false +[[models]] +kind = "DojoModel" +class_hash = "0x615da1d9db8eef7b84db6c92211fd202646d12de041b3e6ea6f3a7abec73e49" +original_class_hash = "0x615da1d9db8eef7b84db6c92211fd202646d12de041b3e6ea6f3a7abec73e49" +abi = "manifests/dev/deployment/abis/models/pixelaw-RTree-3baaf9fe.json" +tag = "pixelaw-RTree" +qualified_path = "pixelaw::core::models::area::r_tree" +manifest_name = "pixelaw-RTree-3baaf9fe" + +[[models.members]] +name = "id" +type = "u64" +key = true + +[[models.members]] +name = "children" +type = "felt252" +key = false + [[models]] kind = "DojoModel" class_hash = "0x5a3afeed7a51a51cab27a99c9d99064fc467ecdb9a8cc606c4d4899dffb7f6c" @@ -347,8 +408,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f" -original_class_hash = "0x19a1ae61a4fb0ac303e15a4ca4befa5ae3962625eb37f379b941815e321191f" +class_hash = "0x54ada9d75018f6625c9ec7f35222e0b8a717aa89ea4e3df21c030a3404c1160" +original_class_hash = "0x54ada9d75018f6625c9ec7f35222e0b8a717aa89ea4e3df21c030a3404c1160" abi = "manifests/dev/deployment/abis/models/pixelaw-SnakeSegment-302de0d8.json" tag = "pixelaw-SnakeSegment" qualified_path = "pixelaw::apps::snake::app::snake_segment" @@ -371,12 +432,12 @@ key = false [[models.members]] name = "x" -type = "u32" +type = "u16" key = false [[models.members]] name = "y" -type = "u32" +type = "u16" key = false [[models.members]] diff --git a/contracts/scripts/create_snapshot.sh b/contracts/scripts/create_snapshot.sh index d37e263..5cb137c 100755 --- a/contracts/scripts/create_snapshot.sh +++ b/contracts/scripts/create_snapshot.sh @@ -67,7 +67,9 @@ echo "sozo build" sozo \ --profile $PROFILE \ --manifest-path $DEPLOY_SCARB \ - build + build \ + --typescript \ + --bindings-output $OUT echo "sozo migrate plan" #starkli account deploy dev-account.json --keystore dev-keystore.json --rpc $STARKNET_RPC @@ -84,18 +86,18 @@ sozo \ migrate \ apply -sozo \ - build \ - --typescript \ - --manifest-path $DEPLOY_SCARB \ - --bindings-output $OUT +# sozo \ +# build \ +# --typescript \ +# --manifest-path $DEPLOY_SCARB \ +# --bindings-output $OUT sleep 1 # Setup PixeLAW auth and init declare "WORLD"=$(cat $MANIFEST | jq -r '.world.address') -CORE_MODELS=("pixelaw-App" "pixelaw-AppName" "pixelaw-CoreActionsAddress" "pixelaw-Pixel" "pixelaw-Permissions" "pixelaw-QueueItem" "pixelaw-Snake" "pixelaw-Instruction") +CORE_MODELS=("pixelaw-App" "pixelaw-AppName" "pixelaw-CoreActionsAddress" "pixelaw-Pixel" "pixelaw-QueueItem" "pixelaw-RTree" "pixelaw-Area" "pixelaw-Snake" "pixelaw-Instruction") SNAKE_MODELS=("pixelaw-Snake" "pixelaw-SnakeSegment") echo "Start Torii" @@ -190,7 +192,7 @@ done sleep 3 - +exit echo "Stopping katana and torii" pkill -f torii pkill -f katana diff --git a/contracts/src/apps/paint/app.cairo b/contracts/src/apps/paint/app.cairo index 708b5cd..aeec59b 100644 --- a/contracts/src/apps/paint/app.cairo +++ b/contracts/src/apps/paint/app.cairo @@ -1,6 +1,6 @@ use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; -use pixelaw::core::models::pixel::{Pixel, PixelUpdate}; -use pixelaw::core::utils::{get_core_actions, Direction, Position, DefaultParameters}; +use pixelaw::core::models::{pixel::{Pixel, PixelUpdate}, registry::{App}}; +use pixelaw::core::utils::{get_callers, get_core_actions, Direction, Position, DefaultParameters}; use starknet::{get_caller_address, get_contract_address, get_execution_info, ContractAddress}; #[dojo::interface] @@ -12,6 +12,20 @@ trait IPaintActions { /// * `world` - A reference to the world dispatcher. fn init(ref world: IWorldDispatcher); + fn on_pre_update( + ref world: IWorldDispatcher, + pixel_update: PixelUpdate, + app_caller: App, + player_caller: ContractAddress + ) -> Option; + + fn on_post_update( + ref world: IWorldDispatcher, + pixel_update: PixelUpdate, + app_caller: App, + player_caller: ContractAddress + ); + /// Interacts with a pixel based on default parameters. /// /// # Arguments @@ -44,14 +58,13 @@ trait IPaintActions { /// * `default_params` - The default parameters including position. /// * `image_data` - A span of felt252 representing the image data. fn pixel_row( - ref world: IWorldDispatcher, default_params: DefaultParameters, image_data: Span, + ref world: IWorldDispatcher, default_params: DefaultParameters, image_data: Span ); } pub const APP_KEY: felt252 = 'paint'; const APP_ICON: felt252 = 'U+1F58C'; -const PIXELS_PER_FELT: u32 = 7; -const APP_MANIFEST: felt252 = 'BASE/manifests/paint'; +const PIXELS_PER_FELT: u16 = 7; #[dojo::contract(namespace: "pixelaw", nomapping: true)] mod paint_actions { @@ -60,23 +73,34 @@ mod paint_actions { IActionsDispatcherTrait as ICoreActionsDispatcherTrait, }; - use pixelaw::core::models::permissions::Permission; use pixelaw::core::models::pixel::{Pixel, PixelUpdate}; use pixelaw::core::models::registry::App; - use pixelaw::core::traits::IInteroperability; use pixelaw::core::utils::{ - get_core_actions, decode_color, encode_color, subu8, Direction, Position, DefaultParameters, + get_callers, get_core_actions, decode_rgba, encode_rgba, subu8, Direction, Position, + DefaultParameters, }; use starknet::{ get_tx_info, get_caller_address, get_contract_address, get_execution_info, ContractAddress, contract_address_const, }; - use super::IPaintActions; - use super::{APP_KEY, APP_ICON, APP_MANIFEST, PIXELS_PER_FELT}; + use super::{APP_KEY, APP_ICON, PIXELS_PER_FELT}; #[abi(embed_v0)] - impl ActionsInteroperability of IInteroperability { + impl Actions of super::IPaintActions { + /// Initializes the Paint App. + /// + /// This function registers the app with core actions + /// + /// # Arguments + /// + /// * `world` - A reference to the world dispatcher. + fn init(ref world: IWorldDispatcher) { + let core_actions = pixelaw::core::utils::get_core_actions(world); + + core_actions.new_app(contract_address_const::<0>(), APP_KEY, APP_ICON); + } + /// Hook called before a pixel update. /// /// # Arguments @@ -90,9 +114,23 @@ mod paint_actions { pixel_update: PixelUpdate, app_caller: App, player_caller: ContractAddress, - ) { - // Do nothing + ) -> Option { let _world = world; + + let mut result = Option::None; //Default is to not allow anything + + // Check which app is calling + if app_caller.name == 'snake' { + if pixel_update.owner.is_some() || pixel_update.app.is_some() { + // If Snake wants to change the owner or app, we don't allow that. + result = Option::None; + } else { + // Anything else is okay unmodified + result = Option::Some(pixel_update); + } + } + + result } /// Hook called after a pixel update. @@ -111,35 +149,12 @@ mod paint_actions { ) { // Do nothing let _world = world; - } - } - - #[abi(embed_v0)] - impl ActionsImpl of IPaintActions { - /// Initializes the Paint App. - /// - /// This function registers the app with core actions and sets up initial permissions. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - fn init(ref world: IWorldDispatcher) { - let core_actions = pixelaw::core::utils::get_core_actions(world); - core_actions.new_app(contract_address_const::<0>(), APP_KEY, APP_ICON); - // // TODO: Replace this with proper granting of permission - // core_actions - // .update_permission( - // 'snake', - // Permission { - // app: true, - // color: true, - // owner: false, - // text: true, - // timestamp: false, - // action: false, - // }, - // ); + // Check which app is calling + if app_caller + .name == 'snake' { // TODO Something that happens when Snake tries to update a Paint pixel.. + // Maybe nice example is to keep a counter of "snakebites" for the paint app + } } /// Interacts with a pixel based on default parameters. @@ -176,8 +191,7 @@ mod paint_actions { // Load important variables let core_actions = get_core_actions(world); let position = default_params.position; - let player = core_actions.get_player_address(default_params.for_player); - let system = core_actions.get_system_address(default_params.for_system); + let (player, system) = get_callers(world, default_params); // Load the Pixel let mut pixel = get!(world, (position.x, position.y), (Pixel)); @@ -196,7 +210,7 @@ mod paint_actions { ); // Update color of the pixel - core_actions + let _ = core_actions .update_pixel( player, system, @@ -210,6 +224,8 @@ mod paint_actions { owner: Option::Some(player), action: Option::None, // Not using this feature for paint }, + Option::None, // TODO area_hint + false ); } @@ -237,11 +253,11 @@ mod paint_actions { let core_actions = get_core_actions(world); let position = default_params.position; - let player = core_actions.get_player_address(default_params.for_player); - let system = core_actions.get_system_address(default_params.for_system); + + let (player, system) = get_callers(world, default_params); let mut felt_index = 0; - let mut pixel_index = 0; + let mut pixel_index: u16 = 0; let mut felt: u256 = (*image_data.at(felt_index)).into(); let mut stop = false; @@ -250,7 +266,7 @@ mod paint_actions { // are 0 padded. // We unpack 4 bytes at a time and use them - core_actions + let _ = core_actions .update_pixel( player, system, @@ -266,6 +282,8 @@ mod paint_actions { owner: Option::Some(player), action: Option::None, // Not using this feature for paint }, + Option::None, // area_hint + false ); pixel_index += 1; @@ -296,11 +314,12 @@ mod paint_actions { fn fade(ref world: IWorldDispatcher, default_params: DefaultParameters) { let core_actions = get_core_actions(world); let position = default_params.position; - let player = core_actions.get_player_address(default_params.for_player); - let system = core_actions.get_system_address(default_params.for_system); + + let (player, system) = get_callers(world, default_params); + let pixel = get!(world, (position.x, position.y), Pixel); - let (r, g, b, a) = decode_color(pixel.color); + let (r, g, b, a) = decode_rgba(pixel.color); // If the color is 0,0,0, fading is done. if r == 0 && g == 0 && b == 0 { @@ -311,12 +330,12 @@ mod paint_actions { // Fade the color let FADE_STEP = 5; - let new_color = encode_color( + let new_color = encode_rgba( subu8(r, FADE_STEP), subu8(g, FADE_STEP), subu8(b, FADE_STEP), a, ); // Update color of the pixel - core_actions + let _ = core_actions .update_pixel( player, system, @@ -330,6 +349,8 @@ mod paint_actions { owner: Option::Some(player), action: Option::None, // Not using this feature for paint }, + Option::None, + false ); let FADE_SECONDS = 4; @@ -386,7 +407,7 @@ mod paint_actions { /// # Returns /// /// * `u32` - The extracted 32-bit value. - fn extract(felt: u256, index: u32) -> u32 { + fn extract(felt: u256, index: u16) -> u32 { let result: u32 = if index == 0 { (felt / TWO_POW_192).try_into().unwrap() } else if index == 1 { diff --git a/contracts/src/apps/paint/tests.cairo b/contracts/src/apps/paint/tests.cairo index 90e9aae..08e9d5e 100644 --- a/contracts/src/apps/paint/tests.cairo +++ b/contracts/src/apps/paint/tests.cairo @@ -8,68 +8,36 @@ mod tests { paint_actions, IPaintActionsDispatcher, IPaintActionsDispatcherTrait }; use pixelaw::core::actions::{actions, IActionsDispatcher, IActionsDispatcherTrait}; - use pixelaw::core::models::permissions::{permissions}; use pixelaw::core::models::pixel::{Pixel, PixelUpdate}; use pixelaw::core::models::pixel::{pixel}; use pixelaw::core::models::registry::{app, app_name, core_actions_address}; + use pixelaw::core::tests::helpers::{setup_core_initialized, setup_apps_initialized}; use pixelaw::core::utils::{ - get_core_actions, encode_color, decode_color, Direction, Position, DefaultParameters + get_core_actions, encode_rgba, decode_rgba, Direction, Position, DefaultParameters }; use starknet::{contract_address_const, testing::set_account_contract_address}; - // Helper function: deploys world and actions - fn deploy_world() -> (IWorldDispatcher, IActionsDispatcher, IPaintActionsDispatcher) { - // Deploy World and models - let mut models = array![ - pixel::TEST_CLASS_HASH, - app::TEST_CLASS_HASH, - app_name::TEST_CLASS_HASH, - core_actions_address::TEST_CLASS_HASH, - permissions::TEST_CLASS_HASH, - ]; - let world = spawn_test_world(["pixelaw"].span(), models.span()); - - // Deploy Core actions - let core_actions_address = world - .deploy_contract('salt1', actions::TEST_CLASS_HASH.try_into().unwrap()); - let core_actions = IActionsDispatcher { contract_address: core_actions_address }; - - // Deploy Paint actions - let paint_actions_address = world - .deploy_contract('salt2', paint_actions::TEST_CLASS_HASH.try_into().unwrap()); - let paint_actions = IPaintActionsDispatcher { contract_address: paint_actions_address }; - - world.grant_writer(selector_from_tag!("pixelaw-Pixel"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-App"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-AppName"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-Permissions"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-CoreActionsAddress"), core_actions_address); - - (world, core_actions, paint_actions) - } - #[test] #[available_gas(3000000000)] fn test_paint_actions() { // Deploy everything - let (world, core_actions, paint_actions) = deploy_world(); - - core_actions.init(); - paint_actions.init(); + let (world, _core_actions, _player_1, _player_2) = setup_core_initialized(); + let (paint_actions, _snake_actions) = setup_apps_initialized(world); let player1 = contract_address_const::<0x1337>(); set_account_contract_address(player1); - let color = encode_color(1, 0, 0, 1); + let color = encode_rgba(1, 0, 0, 1); paint_actions .interact( DefaultParameters { - for_player: contract_address_const::<0>(), - for_system: contract_address_const::<0>(), + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, position: Position { x: 1, y: 1 }, color: color }, @@ -77,7 +45,5 @@ mod tests { let pixel_1_1 = get!(world, (1, 1), (Pixel)); assert(pixel_1_1.color == color, 'should be the color'); - - println!("Passed test"); } } diff --git a/contracts/src/apps/snake/app.cairo b/contracts/src/apps/snake/app.cairo index f748818..49d512f 100644 --- a/contracts/src/apps/snake/app.cairo +++ b/contracts/src/apps/snake/app.cairo @@ -1,6 +1,11 @@ use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; -use pixelaw::core::utils::{Direction, Position, DefaultParameters, starknet_keccak}; -use starknet::{ContractAddress, ClassHash}; + + +use pixelaw::core::models::{pixel::{Pixel, PixelUpdate, PixelUpdateResultTrait}, registry::{App}}; +use pixelaw::core::utils::{get_callers, get_core_actions, Direction, Position, DefaultParameters}; +use starknet::{ + get_caller_address, get_contract_address, get_execution_info, ContractAddress, ClassHash +}; /// Calculates the next position based on the current coordinates and direction. /// @@ -12,9 +17,9 @@ use starknet::{ContractAddress, ClassHash}; /// /// # Returns /// -/// * `Option<(u32, u32)>` - The next position as an `Option`. Returns `None` if the move is +/// * `Option<(u16, u16)>` - The next position as an `Option`. Returns `None` if the move is /// invalid. -fn next_position(x: u32, y: u32, direction: Direction) -> Option<(u32, u32)> { +fn next_position(x: u16, y: u16, direction: Direction) -> Option<(u16, u16)> { match direction { Direction::None(()) => Option::Some((x, y)), Direction::Left(()) => { if x == 0 { @@ -79,8 +84,8 @@ pub struct SnakeSegment { pub id: u32, pub previous_id: u32, pub next_id: u32, - pub x: u32, - pub y: u32, + pub x: u16, + pub y: u16, pub pixel_original_color: u32, pub pixel_original_text: felt252, pub pixel_original_app: ContractAddress, @@ -131,12 +136,13 @@ mod snake_actions { IActionsDispatcher as ICoreActionsDispatcher, IActionsDispatcherTrait as ICoreActionsDispatcherTrait, }; - use pixelaw::core::models::pixel::{Pixel, PixelUpdate}; + use pixelaw::core::models::pixel::{ + Pixel, PixelUpdate, PixelUpdateResult, PixelUpdateResultTrait + }; use pixelaw::core::models::registry::App; - use pixelaw::core::traits::IInteroperability; use pixelaw::core::utils::{ - get_core_actions, Direction, Position, DefaultParameters, starknet_keccak, - get_core_actions_address, + MOVE_SELECTOR, INTERACT_SELECTOR, get_callers, get_core_actions, Direction, Position, + DefaultParameters, starknet_keccak, get_core_actions_address, }; use starknet::{ ContractAddress, get_caller_address, get_contract_address, get_execution_info, @@ -158,85 +164,25 @@ mod snake_actions { #[derive(Drop, starknet::Event)] struct Died { owner: ContractAddress, - x: u32, - y: u32, + x: u16, + y: u16, } - #[derive(Drop, starknet::Event)] - struct Moved { - owner: ContractAddress, - direction: Direction, + #[derive(PartialEq, Debug, Drop, starknet::Event)] + pub struct Moved { + pub owner: ContractAddress, + pub direction: Direction, } const SNAKE_MAX_LENGTH: u8 = 255; - /// Implementation of interoperability hooks for the Snake actions. - #[abi(embed_v0)] - impl ActionsInteroperability of IInteroperability { - /// Hook called before a pixel update. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `pixel_update` - The proposed update to the pixel. - /// * `app_caller` - The app initiating the update. - /// * `player_caller` - The player initiating the update. - fn on_pre_update( - ref world: IWorldDispatcher, - pixel_update: PixelUpdate, - app_caller: App, - player_caller: ContractAddress, - ) { - // Do nothing - let _world = world; - } - - /// Hook called after a pixel update. - /// - /// If the snake is reverting and the previous app was 'paint', it calls the fade function. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `pixel_update` - The update that was applied to the pixel. - /// * `app_caller` - The app that performed the update. - /// * `player_caller` - The player that performed the update. - fn on_post_update( - ref world: IWorldDispatcher, - pixel_update: PixelUpdate, - app_caller: App, - player_caller: ContractAddress, - ) { - let core_actions_address = get_core_actions_address(world); - assert!(core_actions_address == get_caller_address(), "caller is not core_actions"); - - // When the snake is reverting - if pixel_update.app.is_some() && app_caller.system == get_contract_address() { - let old_app = pixel_update.app.unwrap(); - let old_app = get!(world, old_app, (App)); - if old_app.name == 'paint' { - let pixel = get!(world, (pixel_update.x, pixel_update.y), (Pixel)); - let paint_actions = IPaintActionsDispatcher { - contract_address: old_app.system, - }; - let params = DefaultParameters { - for_player: pixel.owner, - for_system: old_app.system, - position: Position { x: pixel_update.x, y: pixel_update.y, }, - color: pixel_update.color.unwrap(), - }; - paint_actions.fade(params); - } - } - } - } /// Implementation of the Snake actions. #[abi(embed_v0)] impl ActionsImpl of ISnakeActions { /// Initializes the Snake App. /// - /// Registers the app with core actions and sets up initial instructions. + /// Registers the app with core actions /// /// # Arguments /// @@ -245,14 +191,9 @@ mod snake_actions { let core_actions = pixelaw::core::utils::get_core_actions(world); core_actions.new_app(contract_address_const::<0>(), APP_KEY, APP_ICON); - - // TODO: Should use something like: starknet_keccak(array!['interact'].span()) - let INTERACT_SELECTOR = - 0x476d5e1b17fd9d508bd621909241c5eb4c67380f3651f54873c5c1f2b891f4; - let INTERACT_INSTRUCTION = 'select direction for snake'; - core_actions.set_instruction(INTERACT_SELECTOR, INTERACT_INSTRUCTION); } + /// Starts a new snake or changes the direction of an existing snake. /// /// # Arguments @@ -270,20 +211,17 @@ mod snake_actions { let core_actions = get_core_actions(world); let position = default_params.position; - let player = core_actions.get_player_address(default_params.for_player); - let system = core_actions.get_system_address(default_params.for_system); + let (player, system) = get_callers(world, default_params); // Check if there is already a Snake or SnakeSegment here let pixel = get!(world, (position.x, position.y), Pixel); let mut snake = get!(world, player, Snake); - // Change direction if snake already exists if snake.length > 0 { snake.direction = direction; set!(world, (snake)); return snake.first_segment_id; } - // TODO: Check if the pixel is unowned or player owned let mut id = world.uuid(); @@ -322,7 +260,7 @@ mod snake_actions { set!(world, (snake, segment)); // Call core_actions to update the color - core_actions + let _ = core_actions .update_pixel( player, system, @@ -336,6 +274,8 @@ mod snake_actions { owner: Option::None, action: Option::None, // Not using this feature for snake }, + Option::None, + false ); let MOVE_SECONDS = 0; @@ -346,9 +286,6 @@ mod snake_actions { // Calldata[0]: Owner address calldata.append(player.into()); - // TODO: Should use something like: starknet_keccak(array!['move'].span()) - let MOVE_SELECTOR = 0x239e4c8fbd11b680d7214cfc26d1780d5c099453f0832beb15fd040aebd4ebb; - // Schedule the next move core_actions .schedule_queue( @@ -382,10 +319,10 @@ mod snake_actions { if snake.is_dying { snake.last_segment_id = remove_last_segment(world, core_actions, snake); snake.length -= 1; - if snake.length == 0 { let position = Position { x: first_segment.x, y: first_segment.y, }; core_actions.alert_player(position, snake.owner, 'Snake died here'); + emit!( world, Died { owner: snake.owner, x: first_segment.x, y: first_segment.y } ); @@ -406,7 +343,7 @@ mod snake_actions { let next_pixel = get!(world, (next_x, next_y), Pixel); let has_write_access = core_actions - .has_write_access( + .can_update_pixel( snake.owner, get_contract_address(), next_pixel, @@ -420,13 +357,17 @@ mod snake_actions { owner: Option::None, action: Option::None, // Not using this feature for snake }, - ); + Option::None, + false + ) + .is_ok(); // Determine what happens to the snake // MOVE, GROW, SHRINK, DIE if next_pixel.owner == contract_address_const::<0>() { // Snake just moves // Add a new segment on the next pixel and update the snake + snake .first_segment_id = create_new_segment( @@ -516,7 +457,7 @@ mod snake_actions { let pixel = get!(world, (last_segment.x, last_segment.y), Pixel); // Write the changes to the pixel - core_actions + let _ = core_actions .update_pixel( snake.owner, get_contract_address(), @@ -530,6 +471,8 @@ mod snake_actions { owner: Option::None, action: Option::None, // Not using this feature for snake }, + Option::None, // TODO area_hint + false ); let result = last_segment.previous_id; @@ -583,7 +526,7 @@ mod snake_actions { ); // Write the changes to the pixel - core_actions + let _pu = core_actions .update_pixel( snake.owner, get_contract_address(), @@ -597,6 +540,8 @@ mod snake_actions { owner: Option::None, action: Option::None, // Not using this feature for snake }, + Option::None, + false ); id } diff --git a/contracts/src/apps/snake/tests.cairo b/contracts/src/apps/snake/tests.cairo index ad3e101..5b7881d 100644 --- a/contracts/src/apps/snake/tests.cairo +++ b/contracts/src/apps/snake/tests.cairo @@ -13,72 +13,22 @@ mod tests { use pixelaw::core::actions::{ actions as core_actions, IActionsDispatcher, IActionsDispatcherTrait }; - use pixelaw::core::models::permissions::{permissions}; use pixelaw::core::models::pixel::{Pixel, PixelUpdate}; use pixelaw::core::models::pixel::{pixel}; - use pixelaw::core::models::registry::{app, app_name, core_actions_address, instruction}; + use pixelaw::core::models::registry::{app, app_name, core_actions_address}; + use pixelaw::core::tests::helpers::{set_caller, setup_core_initialized, setup_apps_initialized}; use pixelaw::core::utils::{get_core_actions, Direction, Position, DefaultParameters}; use starknet::{contract_address_const, testing::set_account_contract_address}; - // Helper function: deploys world and actions - fn deploy_world() -> ( - IWorldDispatcher, IActionsDispatcher, ISnakeActionsDispatcher, IPaintActionsDispatcher - ) { - let _player1 = starknet::contract_address_const::<0x1337>(); - - // Deploy World and models - let mut models = array![ - pixel::TEST_CLASS_HASH, - app::TEST_CLASS_HASH, - app_name::TEST_CLASS_HASH, - core_actions_address::TEST_CLASS_HASH, - permissions::TEST_CLASS_HASH, - instruction::TEST_CLASS_HASH, - snake::TEST_CLASS_HASH, - snake_segment::TEST_CLASS_HASH, - ]; - let world = spawn_test_world(["pixelaw"].span(), models.span()); - - // Deploy Core actions - let core_actions_address = world - .deploy_contract('salt1', core_actions::TEST_CLASS_HASH.try_into().unwrap()); - let core_actions = IActionsDispatcher { contract_address: core_actions_address }; - - // Deploy Snake actions - let snake_actions_address = world - .deploy_contract('salt2', snake_actions::TEST_CLASS_HASH.try_into().unwrap()); - let snake_actions = ISnakeActionsDispatcher { contract_address: snake_actions_address }; - - // Deploy Paint actions - let paint_actions = IPaintActionsDispatcher { - contract_address: world - .deploy_contract('salt3', paint_actions::TEST_CLASS_HASH.try_into().unwrap()) - }; - - // Setup dojo auth - world.grant_writer(selector_from_tag!("pixelaw-Pixel"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-App"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-AppName"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-CoreActionsAddress"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-Permissions"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-Instruction"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-Snake"), snake_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-SnakeSegment"), snake_actions_address); - - (world, core_actions, snake_actions, paint_actions) - } - #[test] #[available_gas(3000000000)] fn test_playthrough() { - // Deploy everything - let (world, core_actions, snake_actions, paint_actions) = deploy_world(); - let SNAKE_COLOR = 0xFF00FF; + let (world, _core_actions, _player_1, _player_2) = setup_core_initialized(); + let (paint_actions, snake_actions) = setup_apps_initialized(world); - core_actions.init(); - snake_actions.init(); + let SNAKE_COLOR = 0xFF00FF; // Setup players let player1 = contract_address_const::<0x1337>(); @@ -93,8 +43,9 @@ mod tests { snake_actions .interact( DefaultParameters { - for_player: contract_address_const::<0>(), - for_system: contract_address_const::<0>(), + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, position: Position { x: 1, y: 1 }, color: SNAKE_COLOR }, @@ -110,24 +61,25 @@ mod tests { // Check if the pixel is blank again at 1,1 let pixel1_1 = get!(world, (1, 1), Pixel); - assert(pixel1_1.color == 0, 'wrong pixel color 3'); + assert(pixel1_1.color == 0, 'wrong pixel color 1,1'); // Check that the pixel is snake at 2,1 let pixel2_1 = get!(world, (2, 1), Pixel); - assert(pixel2_1.color == SNAKE_COLOR, 'wrong pixel color 4'); + assert(pixel2_1.color == SNAKE_COLOR, 'wrong pixel color 2,1'); // Move right (head at 3,1 now) snake_actions.move(player1); // Check if the pixel is blank again at 2,1 - assert(get!(world, (2, 1), Pixel).color == 0, 'wrong pixel color 5'); + assert(get!(world, (2, 1), Pixel).color == 0, 'wrong pixel color 2,1'); // Paint 4,1 so player1 owns it paint_actions .interact( DefaultParameters { - for_player: contract_address_const::<0>(), - for_system: contract_address_const::<0>(), + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, position: Position { x: 4, y: 1 }, color: 0xF0F0F0 } @@ -137,7 +89,7 @@ mod tests { snake_actions.move(player1); // Check that 3,1 is still snake color - assert(get!(world, (3, 1), Pixel).color == SNAKE_COLOR, 'wrong pixel color 6'); + assert(get!(world, (3, 1), Pixel).color == SNAKE_COLOR, 'wrong pixel color 3,1'); // Move right (head at 5,1 now) snake_actions.move(player1); @@ -149,18 +101,19 @@ mod tests { // 1: hit the other pixel // 2: shrink // 3: shrink / delete - set_account_contract_address(player2); + set_caller(player2); paint_actions .interact( DefaultParameters { - for_player: contract_address_const::<0>(), - for_system: contract_address_const::<0>(), + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, position: Position { x: 6, y: 1 }, color: 0xF0F0F0 } ); - set_account_contract_address(player1); + set_caller(player1); // Hit the pixel snake_actions.move(player1); @@ -176,15 +129,13 @@ mod tests { // Check that 5,1 is not snake color assert(get!(world, (5, 1), Pixel).color != SNAKE_COLOR, 'wrong pixel color for 5,1'); - // This command should revert - // snake_actions.move(player1); - // Spawn the snake again at 3,1 so it grows from the paint at 4,1 snake_actions .interact( DefaultParameters { - for_player: contract_address_const::<0>(), - for_system: contract_address_const::<0>(), + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, position: Position { x: 3, y: 1 }, color: SNAKE_COLOR }, @@ -200,8 +151,9 @@ mod tests { snake_actions .interact( DefaultParameters { - for_player: contract_address_const::<0>(), - for_system: contract_address_const::<0>(), + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, position: Position { x: 3, y: 1 }, color: SNAKE_COLOR }, diff --git a/contracts/src/core.cairo b/contracts/src/core.cairo index dc2ed84..113d5bc 100644 --- a/contracts/src/core.cairo +++ b/contracts/src/core.cairo @@ -1,7 +1,7 @@ pub mod actions; +pub mod events; pub mod models; #[cfg(test)] -mod tests; -pub mod traits; +pub mod tests; pub mod utils; diff --git a/contracts/src/core/actions.cairo b/contracts/src/core/actions.cairo index b8f84b0..6fc7236 100644 --- a/contracts/src/core/actions.cairo +++ b/contracts/src/core/actions.cairo @@ -1,12 +1,19 @@ +pub mod app; +pub mod area; +pub mod pixel; +pub mod queue; + use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; -use pixelaw::core::models::permissions::{Permission}; -use pixelaw::core::models::pixel::{Pixel, PixelUpdate}; +use pixelaw::core::models::area::{Area, RTreeNode}; +use pixelaw::core::models::pixel::{PixelUpdateResult, Pixel, PixelUpdate}; use pixelaw::core::models::registry::{App, AppName, CoreActionsAddress}; -use pixelaw::core::utils::Position; +use pixelaw::core::utils::{Position, MAX_DIMENSION, Bounds}; +use pixelaw::core::utils; use starknet::{ContractAddress, ClassHash, contract_address_const}; pub const CORE_ACTIONS_KEY: felt252 = 'core_actions'; + #[dojo::interface] pub trait IActions { /// Initializes the Pixelaw actions model. @@ -16,37 +23,37 @@ pub trait IActions { /// * `world` - A reference to the world dispatcher. fn init(ref world: IWorldDispatcher); - /// Updates the permissions for a specified system. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `app_key` - The key of the app (example: 'paint') to update permissions for. - /// * `permission` - The permission to set for the system. - fn update_permission(ref world: IWorldDispatcher, app_key: felt252, permission: Permission); - // fn update_app(ref world: IWorldDispatcher, name: felt252, icon: felt252); + // Check if and how a Pixel can be updated, based on given params + // It checks all ownership (pixel and Area) and hooks + fn can_update_pixel( + ref world: IWorldDispatcher, + for_player: ContractAddress, + for_system: ContractAddress, + pixel: Pixel, + pixel_update: PixelUpdate, + area_id_hint: Option, + allow_modify: bool + ) -> PixelUpdateResult; + - /// Checks if a player or system has write access to a pixel. + /// Updates a pixel with the provided updates. /// /// # Arguments /// /// * `world` - A reference to the world dispatcher. - /// * `for_player` - The player contract address. - /// * `for_system` - The system contract address. - /// * `pixel` - The pixel to check access for. - /// * `pixel_update` - The proposed update to the pixel. - /// - /// # Returns - /// - /// * `bool` - True if access is granted, false otherwise. - fn has_write_access( + /// * `for_player` - The player making the update. + /// * `for_system` - The system making the update. + /// * `pixel_update` - The updates to apply to the pixel. + fn update_pixel( ref world: IWorldDispatcher, for_player: ContractAddress, for_system: ContractAddress, - pixel: Pixel, pixel_update: PixelUpdate, - ) -> bool; + area_id: Option, + allow_modify: bool + ) -> PixelUpdateResult; + /// Processes a scheduled queue item. /// @@ -84,21 +91,6 @@ pub trait IActions { calldata: Span, ); - /// Updates a pixel with the provided updates. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `for_player` - The player making the update. - /// * `for_system` - The system making the update. - /// * `pixel_update` - The updates to apply to the pixel. - fn update_pixel( - ref world: IWorldDispatcher, - for_player: ContractAddress, - for_system: ContractAddress, - pixel_update: PixelUpdate, - ); - /// Registers a new app. /// /// # Arguments @@ -115,27 +107,6 @@ pub trait IActions { ref world: IWorldDispatcher, system: ContractAddress, name: felt252, icon: felt252, ) -> App; - /// Retrieves the system address. - /// - /// # Arguments - /// - /// * `for_system` - The system contract address. If zero, returns the caller's address. - /// - /// # Returns - /// - /// * `ContractAddress` - The system address. - fn get_system_address(for_system: ContractAddress) -> ContractAddress; - - /// Retrieves the player address. - /// - /// # Arguments - /// - /// * `for_player` - The player contract address. If zero, returns the caller's account address. - /// - /// # Returns - /// - /// * `ContractAddress` - The player address. - fn get_player_address(for_player: ContractAddress) -> ContractAddress; /// Sends an alert to a player. /// @@ -149,61 +120,40 @@ pub trait IActions { ref world: IWorldDispatcher, position: Position, player: ContractAddress, message: felt252, ); - /// Sets an instruction for a given selector in a system. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `selector` - The function selector. - /// * `instruction` - The instruction to set. - fn set_instruction(ref world: IWorldDispatcher, selector: felt252, instruction: felt252); + + fn add_area( + ref world: IWorldDispatcher, + bounds: Bounds, + owner: ContractAddress, + color: u32, + app: ContractAddress + ) -> Area; + fn remove_area(ref world: IWorldDispatcher, area_id: u64); + fn find_area_by_position(ref world: IWorldDispatcher, position: Position) -> Option; + fn find_areas_inside_bounds(ref world: IWorldDispatcher, bounds: Bounds) -> Span; } + #[dojo::contract(namespace: "pixelaw", nomapping: true)] pub mod actions { use core::poseidon::poseidon_hash_span; - use pixelaw::core::models::permissions::{Permission, Permissions}; - use pixelaw::core::models::pixel::{Pixel, PixelUpdate}; + use pixelaw::core::events::{QueueScheduled, QueueProcessed, AppNameUpdated, Alert}; + use pixelaw::core::models::area::{ + BoundsTraitImpl, RTreeTraitImpl, ROOT_ID, RTreeNode, RTree, Area, RTreeNodePackableImpl + }; + use pixelaw::core::models::pixel::{Pixel, PixelUpdate, PixelUpdateResult}; use pixelaw::core::models::queue::QueueItem; - use pixelaw::core::models::registry::{App, AppName, CoreActionsAddress, Instruction}; - use pixelaw::core::traits::{IInteroperabilityDispatcher, IInteroperabilityDispatcherTrait}; - use pixelaw::core::utils::{get_core_actions_address, Position}; + use pixelaw::core::models::registry::{App, AppName, CoreActionsAddress}; + + use pixelaw::core::utils::{get_core_actions_address, Position, MAX_DIMENSION, Bounds}; use starknet::{ ContractAddress, get_caller_address, get_contract_address, get_tx_info, contract_address_const, syscalls::{call_contract_syscall}, }; - use super::IActions; + use super::{IActions}; - #[derive(Drop, starknet::Event)] - struct QueueScheduled { - id: felt252, - timestamp: u64, - called_system: ContractAddress, - selector: felt252, - calldata: Span, - } - - #[derive(Drop, starknet::Event)] - struct QueueProcessed { - id: felt252, - } - - #[derive(Drop, starknet::Event)] - struct AppNameUpdated { - app: App, - caller: felt252, - } - - #[derive(Debug, Drop, Serde, starknet::Event, PartialEq)] - pub struct Alert { - pub position: Position, - pub caller: ContractAddress, - pub player: ContractAddress, - pub message: felt252, - pub timestamp: u64, - } #[event] #[derive(Drop, starknet::Event)] @@ -214,58 +164,46 @@ pub mod actions { Alert: Alert, } - // impl: implement functions specified in trait + #[abi(embed_v0)] impl ActionsImpl of IActions { - /// Initializes the Pixelaw actions model. - /// - /// One World has one CoreActions model that can be discovered by anyone. fn init(ref world: IWorldDispatcher) { set!( world, (CoreActionsAddress { key: super::CORE_ACTIONS_KEY, value: get_contract_address() }) ); - } - - /// Updates the permissions for a specified system. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `app_key` - The key of the app (example: 'paint') to update permissions for. - /// * `permission` - The permission to set for the system. - /// - /// # Remarks - /// - /// This function grants permissions to a system by the caller. - /// It is the app's responsibility to handle `update_permission` responsibly. - fn update_permission( - ref world: IWorldDispatcher, app_key: felt252, permission: Permission, - ) { - let caller_address = get_caller_address(); - // TODO maybe check that the caller is indeed an app? + // Initialize root RTree + set!(world, RTree { id: ROOT_ID, children: 1310762 }); + } - // Retrieve the App of the `for_system` - let allowed_app = get!(world, app_key, (AppName)); - let allowed_app = allowed_app.system; + fn can_update_pixel( + ref world: IWorldDispatcher, + for_player: ContractAddress, + for_system: ContractAddress, + pixel: Pixel, + pixel_update: PixelUpdate, + area_id_hint: Option, + allow_modify: bool + ) -> PixelUpdateResult { + super::pixel::can_update_pixel( + world, for_player, for_system, pixel, pixel_update, area_id_hint, allow_modify + ) + } - set!(world, Permissions { allowing_app: caller_address, allowed_app, permission }); + fn update_pixel( + ref world: IWorldDispatcher, + for_player: ContractAddress, + for_system: ContractAddress, + pixel_update: PixelUpdate, + area_id: Option, + allow_modify: bool + ) -> PixelUpdateResult { + super::pixel::update_pixel( + world, for_player, for_system, pixel_update, area_id, allow_modify + ) } - /// Schedules a queue item to be processed at a specified timestamp. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `timestamp` - The timestamp when the queue item should be processed. - /// * `called_system` - The system contract address to call. - /// * `selector` - The function selector to call in the system. - /// * `calldata` - The calldata to pass to the function. - /// - /// # Remarks - /// - /// This function emits an event that external schedulers can pick up. fn schedule_queue( ref world: IWorldDispatcher, timestamp: u64, @@ -273,39 +211,13 @@ pub mod actions { selector: felt252, calldata: Span, ) { - // TODO: Review security - - // hash the call and store the hash for verification - let id = poseidon_hash_span( - array![ - timestamp.into(), called_system.into(), selector, poseidon_hash_span(calldata) - ] - .span(), - ); - - // Emit the event, so an external scheduler can pick it up - emit!( - world, - (Event::QueueScheduled( - QueueScheduled { id, timestamp, called_system, selector, calldata: calldata } - )) + let event = super::queue::schedule_queue( + world, timestamp, called_system, selector, calldata ); + emit!(world, (Event::QueueScheduled(event))); } - /// Processes a scheduled queue item. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `id` - The unique identifier of the queue item. - /// * `timestamp` - The timestamp when the queue item was scheduled. - /// * `called_system` - The system contract address to call. - /// * `selector` - The function selector to call in the system. - /// * `calldata` - The calldata to pass to the function. - /// - /// # Remarks - /// - /// This function verifies the integrity of the queue item before processing it. + fn process_queue( ref world: IWorldDispatcher, id: felt252, @@ -314,289 +226,21 @@ pub mod actions { selector: felt252, calldata: Span, ) { - // A quick check on the timestamp so we know it's not too early for this one - assert!(timestamp <= starknet::get_block_timestamp(), "timestamp still in the future"); - - // Recreate the id to check the integrity - let calculated_id = poseidon_hash_span( - array![ - timestamp.into(), called_system.into(), selector, poseidon_hash_span(calldata) - ] - .span(), + let event = super::queue::process_queue( + world, id, timestamp, called_system, selector, calldata ); - // Only valid when the queue item was found by the hash - assert!(calculated_id == id, "Invalid Id"); - - // Make the call itself - let _result = call_contract_syscall(called_system, selector, calldata); - - // Tell the offchain schedulers that this one is done - emit!(world, (Event::QueueProcessed(QueueProcessed { id }))); - } - - /// Checks if a player or system has write access to a pixel. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `for_player` - The player contract address. - /// * `for_system` - The system contract address. - /// * `pixel` - The pixel to check access for. - /// * `pixel_update` - The proposed update to the pixel. - /// - /// # Returns - /// - /// * `bool` - True if access is granted, false otherwise. - /// - /// # Remarks - /// - /// This function verifies whether the caller has the necessary permissions to update the - /// pixel. - fn has_write_access( - ref world: IWorldDispatcher, - for_player: ContractAddress, - for_system: ContractAddress, - pixel: Pixel, - pixel_update: PixelUpdate, - ) -> bool { - // The originator of the transaction - let caller_account = get_tx_info().unbox().account_contract_address; - - // The address making this call. Could be a System of an App - let caller_address = get_caller_address(); - - // First check: Can we grant based on ownership? - // If caller is owner or not owned by anyone, allow - if pixel.owner == caller_account || pixel.owner == contract_address_const::<0>() { - return true; - } else if caller_account == caller_address { - // The caller is not a System, and not owner, so no reason to keep looking. - return false; - } - // Deal with Scheduler calling - - // The `caller_address` is a System, let's see if it has access - - // Retrieve the App of the calling System - let caller_app = get!(world, caller_address, (App)); - - // TODO: Decide whether an App by default has write on a pixel with same App - - // If it's the same app, always allow. - // It's the responsibility of the App developer to ensure separation of ownership - if pixel.app == caller_app.system { - return true; - } - - let permissions = get!(world, (pixel.app, caller_app.system).into(), (Permissions)); - - if pixel_update.app.is_some() && !permissions.permission.app { - return false; - }; - if pixel_update.color.is_some() && !permissions.permission.color { - return false; - }; - if pixel_update.owner.is_some() && !permissions.permission.owner { - return false; - }; - if pixel_update.text.is_some() && !permissions.permission.text { - return false; - }; - if pixel_update.timestamp.is_some() && !permissions.permission.timestamp { - return false; - }; - if pixel_update.action.is_some() && !permissions.permission.action { - return false; - }; - - // Since we checked all the permissions and no assert fired, we can return true - true - } - - /// Updates a pixel with the provided updates. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `for_player` - The player making the update. - /// * `for_system` - The system making the update. - /// * `pixel_update` - The updates to apply to the pixel. - /// - /// # Remarks - /// - /// This function applies the updates to the pixel if the caller has write access. - fn update_pixel( - ref world: IWorldDispatcher, - for_player: ContractAddress, - for_system: ContractAddress, - pixel_update: PixelUpdate, - ) { - let mut pixel = get!(world, (pixel_update.x, pixel_update.y), (Pixel)); - - assert!( - self.has_write_access(for_player, for_system, pixel, pixel_update), "No access!" - ); - - let old_pixel_app = pixel.app; - - if old_pixel_app != contract_address_const::<0>() { - let interoperable_app = IInteroperabilityDispatcher { - contract_address: old_pixel_app - }; - let app_caller = get!(world, for_system, (App)); - interoperable_app.on_pre_update(pixel_update, app_caller, for_player); - } - - // If the pixel has no owner set yet, do that now. - if pixel.created_at == 0 { - let now = starknet::get_block_timestamp(); - - pixel.created_at = now; - pixel.updated_at = now; - } - - if pixel_update.app.is_some() { - pixel.app = pixel_update.app.unwrap(); - } - - if pixel_update.color.is_some() { - pixel.color = pixel_update.color.unwrap(); - } - - if pixel_update.owner.is_some() { - pixel.owner = pixel_update.owner.unwrap(); - } - - if pixel_update.text.is_some() { - pixel.text = pixel_update.text.unwrap(); - } - - if pixel_update.timestamp.is_some() { - pixel.timestamp = pixel_update.timestamp.unwrap(); - } - - if pixel_update.action.is_some() { - pixel.action = pixel_update.action.unwrap() - } - - // Set Pixel - set!(world, (pixel)); - - if old_pixel_app != contract_address_const::<0>() { - let interoperable_app = IInteroperabilityDispatcher { - contract_address: old_pixel_app - }; - let app_caller = get!(world, for_system, (App)); - interoperable_app.on_post_update(pixel_update, app_caller, for_player); - } + emit!(world, (Event::QueueProcessed(event))); } - /// Retrieves the player address. - /// - /// # Arguments - /// - /// * `for_player` - The player contract address. If zero, returns the caller's account - /// address. - /// - /// # Returns - /// - /// * `ContractAddress` - The player address. - fn get_player_address(for_player: ContractAddress) -> ContractAddress { - if for_player == contract_address_const::<0>() { - let result = get_tx_info().unbox().account_contract_address; - - // Return the caller account from the transaction (the end user) - return result; - } else { - // TODO: Check if getter is a system or the core actions contract - - // Return the `for_player` - return for_player; - } - } - /// Retrieves the system address. - /// - /// # Arguments - /// - /// * `for_system` - The system contract address. If zero, returns the caller's address. - /// - /// # Returns - /// - /// * `ContractAddress` - The system address. - fn get_system_address(for_system: ContractAddress) -> ContractAddress { - if for_system != contract_address_const::<0>() { - // TODO: Check that the caller is the CoreActions contract - // Otherwise, it should be zero (if caller not core_actions) - - // Return the `for_system` - return for_system; - } else { - // Return the caller account from the transaction (the end user) - return get_caller_address(); - } - } - - /// Registers a new app. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `system` - Contract address of the app's systems or zero to use the caller. - /// * `name` - Name of the app. - /// * `icon` - Unicode hex of the icon of the app. - /// - /// # Returns - /// - /// * `App` - Struct containing the contract address and name fields. fn new_app( ref world: IWorldDispatcher, system: ContractAddress, name: felt252, icon: felt252, ) -> App { - let mut app_system = system; - // If the system is not given, use the caller for this. - // This is expected to be called from the `app.init()` function - if system == contract_address_const::<0>() { - app_system = get_caller_address(); - } - - // Load app - let mut app = get!(world, app_system, (App)); - - // Load app_name - let mut app_name = get!(world, name, (AppName)); - - // Ensure neither contract nor name have been registered - assert!( - app.name == 0 && app_name.system == contract_address_const::<0>(), "app already set" - ); - - // Associate system with name - app.name = name; - app.icon = icon; - - // Associate name with system - app_name.system = system; - - // Store both associations - set!(world, (app, app_name)); - - // Return the system association - app + super::app::new_app(world, system, name, icon) } - /// Sends an alert to a player. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `position` - The position associated with the alert. - /// * `player` - The player to alert. - /// * `message` - The message to send. - /// - /// # Remarks - /// - /// Only callable by registered apps. + fn alert_player( ref world: IWorldDispatcher, position: Position, @@ -620,22 +264,43 @@ pub mod actions { ); } - /// Sets an instruction for a given selector in a system. - /// - /// # Arguments - /// - /// * `world` - A reference to the world dispatcher. - /// * `selector` - The function selector. - /// * `instruction` - The instruction to set. - /// - /// # Remarks - /// - /// Only callable by registered apps. - fn set_instruction(ref world: IWorldDispatcher, selector: felt252, instruction: felt252) { - let system = get_caller_address(); - let app = get!(world, system, (App)); - assert!(app.name != '', "cannot be called by a non-app"); - set!(world, (Instruction { system, selector, instruction })) + + fn add_area( + ref world: IWorldDispatcher, + bounds: Bounds, + owner: ContractAddress, + color: u32, + app: ContractAddress + ) -> Area { + super::area::add_area(world, bounds, owner, color, app) + } + + fn remove_area(ref world: IWorldDispatcher, area_id: u64) { + super::area::remove_area(world, area_id); + } + + fn find_area_by_position(ref world: IWorldDispatcher, position: Position,) -> Option { + let result = super::area::find_node_for_position(world, position, ROOT_ID, true); + match result { + 0 => Option::None, + _ => Option::Some(get!(world, (result), (Area))) + } + } + + fn find_areas_inside_bounds(ref world: IWorldDispatcher, bounds: Bounds) -> Span { + let mut result: Array = array![]; + let mut area_ids: Array = array![]; + let smallest_node = super::area::find_smallest_node_spanning_bounds( + world, bounds, ROOT_ID, false + ); + super::area::find_nodes_inside_bounds(world, ref area_ids, bounds, smallest_node, true); + if area_ids.len() == 0 { + return result.span(); + } + for area_id in area_ids { + result.append(get!(world, area_id, (Area))); + }; + result.span() } } } diff --git a/contracts/src/core/actions/app.cairo b/contracts/src/core/actions/app.cairo new file mode 100644 index 0000000..0ff8e3c --- /dev/null +++ b/contracts/src/core/actions/app.cairo @@ -0,0 +1,49 @@ +use core::poseidon::poseidon_hash_span; +use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; +use pixelaw::core::models::area::{ + BoundsTraitImpl, RTreeTraitImpl, ROOT_ID, RTreeNode, RTree, Area, RTreeNodePackableImpl +}; +use pixelaw::core::models::pixel::{Pixel, PixelUpdate}; +use pixelaw::core::models::queue::QueueItem; + +use pixelaw::core::models::registry::{App, AppName, CoreActionsAddress}; +use pixelaw::core::utils::{get_core_actions_address, Position, MAX_DIMENSION, Bounds}; +use pixelaw::core::utils; +use starknet::{ + ContractAddress, get_caller_address, get_contract_address, get_tx_info, contract_address_const, + syscalls::{call_contract_syscall}, +}; + + +pub fn new_app( + world: IWorldDispatcher, system: ContractAddress, name: felt252, icon: felt252, +) -> App { + let mut app_system = system; + // If the system is not given, use the caller for this. + // This is expected to be called from the `app.init()` function + if system == contract_address_const::<0>() { + app_system = get_caller_address(); + } + + // Load app + let mut app = get!(world, app_system, (App)); + + // Load app_name + let mut app_name = get!(world, name, (AppName)); + + // Ensure neither contract nor name have been registered + assert!(app.name == 0 && app_name.system == contract_address_const::<0>(), "app already set"); + + // Associate system with name + app.name = name; + app.icon = icon; + + // Associate name with system + app_name.system = system; + + // Store both associations + set!(world, (app, app_name)); + + // Return the system association + app +} diff --git a/contracts/src/core/actions/area.cairo b/contracts/src/core/actions/area.cairo new file mode 100644 index 0000000..edc554c --- /dev/null +++ b/contracts/src/core/actions/area.cairo @@ -0,0 +1,539 @@ +use dojo::{world::{IWorldDispatcher, IWorldDispatcherTrait}}; +use pixelaw::core::{ + utils::{Bounds, min, max, Position, MAX_DIMENSION}, + models::{ + pixel::{Pixel}, + { + area::{ + RTreeNode, RTree, Area, RTreeTrait, RTreeTraitImpl, RTreeNodePackableImpl, + ChildrenPackableImpl, BoundsTraitImpl, ROOT_RTREENODE, ROOT_ID + } + } + } +}; +use starknet::{ + ContractAddress, get_caller_address, get_contract_address, get_tx_info, contract_address_const, + syscalls::{call_contract_syscall}, +}; +use super::super::models::area::BoundsTrait; + +pub fn remove_area(world: IWorldDispatcher, area_id: u64) { + let area = get!(world, area_id, (Area)); + + remove_area_node(world, area_id); + + delete!(world, (area)); +} + +pub fn add_area( + world: IWorldDispatcher, + bounds: Bounds, + owner: ContractAddress, + color: u32, + app: ContractAddress +) -> Area { + // Add node in the RTree index + let id = add_area_node(world, bounds); + + // Create Area model + let area = Area { id, owner, color, app }; + + // Store Area model + set!(world, (area)); + + // Return + area +} + +pub fn find_area_for_position( + world: IWorldDispatcher, position: Position, node_hint: Option +) -> Option { + let mut result = Option::None; + + let found_area_id = find_node_for_position(world, position, node_hint.unwrap_or(ROOT_ID), true); + if found_area_id != 0 { + result = Option::Some(get!(world, (found_area_id), (Area))); + } + result +} + +pub fn find_node_for_position( + world: IWorldDispatcher, position: Position, node_id: u64, has_area: bool +) -> u64 { + let node: RTreeNode = node_id.unpack(); + + let found = node.bounds.contains_position(position); + + if found && node.is_area == has_area { + // This is the area node we were looking for + return node_id; + } else if !found { + // We're not going to be finding anything here + return 0; + } + + // Let's continue looking at children, something maybe below + + // Load the treenode from storage so we can inspect children + let treenode: RTree = get!(world, (node_id), RTree); + + let children: Span = treenode.get_children(); + let mut found_child_id: u64 = 0; + + for child_id in children { + let id = find_node_for_position(world, position, *child_id, has_area); + if id != 0 { + found_child_id = id; + break; + } + }; + + found_child_id +} + +pub fn print_tree(world: IWorldDispatcher, node_id: u64, indent: ByteArray) { + let node: RTreeNode = node_id.unpack(); + let treenode: RTree = get!(world, (node_id), RTree); + + let children: Span = treenode.get_children(); + + if node.is_leaf { + println!("{} LEAF: {} {:?}, children {:?}", indent, node_id, node, children); + } else if node.is_area { + println!("{} AREA: {} {:?}, children {:?}", indent, node_id, node, children); + } else { + println!("{} NODE: {} {:?}, children {:?}", indent, node_id, node, children); + } + + let mut new_indent: ByteArray = " " + indent.clone(); + + for child_id in children { + print_tree(world, *child_id, new_indent.clone()); + }; +} + +// Mainly for UI: Return all areas (partially) inside given bounds +// The node_id is the starting point. +// If it's ROOT_ID, this means traversing pretty much the entire index! +pub fn find_nodes_inside_bounds( + world: IWorldDispatcher, + ref result: Array, + search_bounds: Bounds, + node_id: u64, + only_area: bool +) { + // Load + let treenode: RTree = get!(world, (node_id), RTree); + let children: Span = treenode.get_children(); + + // Evaluate children + for child_id in children { + let child: RTreeNode = (*child_id).unpack(); + + // Check the children + if search_bounds.intersects(child.bounds) && (only_area && child.is_area) || !only_area { + result.append(*child_id); + } + if !child.is_area { + find_nodes_inside_bounds(world, ref result, search_bounds, *child_id, only_area); + } + }; +} + +pub fn add_area_node(world: IWorldDispatcher, bounds: Bounds) -> u64 { + // Check that the bounds are correct (min < max etc) + bounds.check(); + + // Ensure the new area is not overlapping (entirely or partially) with an existing + check_area_overlap(world, bounds); + + // Step 1: Prepare the Leaf (parent, leaf) + let mut leaf: RTree = choose_leaf(world, ROOT_ID, bounds, ROOT_ID); + + // Step 2: Create New Area Node + let new_area = RTreeNode { bounds, is_leaf: false, is_area: true }; + let new_area_id = new_area.pack(); + + // Step 3: Update Parent Node, Add the area node to the parent children array + let updated_leaf_children: Array = leaf.add_child_id(new_area_id); + + // Step 4: Handle recursive ancestor resizing + let mut ancestors: Array = array![]; + get_ancestors(world, ref ancestors, leaf.id); + + update_ancestors( + world, + ancestors.span(), // ancestors + ancestors.len() - 1, // level + updated_leaf_children // new id (new leaf_id can be calculated from this) + ); + + // Step 6: Return New Area ID + new_area_id +} + +pub fn remove_area_node(world: IWorldDispatcher, area_id: u64) { + // Check that this id is really an area + let area_node: RTreeNode = area_id.unpack(); + assert(area_node.is_area, 'not area'); + + // Get ancestors + let mut ancestors: Array = array![]; + get_ancestors(world, ref ancestors, area_id); + let ancestors_level = ancestors.len() - 1; + + if *(ancestors.at(ancestors_level)) == area_id { + // Load the leaf that has this area + + let parent_node_id = *ancestors[ancestors_level - 1]; + let parent_treenode: RTree = get!(world, (parent_node_id), RTree); + let parent_updated_children = parent_treenode.remove_child_id(area_id); + + // TODO for now we only remove the child + // BUT we should be shrinking the ancestor nodes recursively! + set!(world, RTree { id: parent_node_id, children: parent_updated_children.span().pack() }); + } +} + + +fn get_ancestors(world: IWorldDispatcher, ref ancestors: Array, search_node_id: u64) { + if ancestors.len() == 0 { + ancestors.append(ROOT_ID); + } + + let current_id = ancestors[ancestors.len() - 1]; + let current_node: RTree = get!(world, (*current_id), RTree); + let children: Span = current_node.get_children(); + + for child_id in children { + if *child_id == search_node_id { + ancestors.append(*child_id); + break; + } + let child: RTreeNode = (*child_id).unpack(); + let search_node: RTreeNode = search_node_id.unpack(); + if child.bounds.contains_bounds(search_node.bounds) { + // found it + ancestors.append(*child_id); + + get_ancestors(world, ref ancestors, search_node_id); + break; + } + }; +} + +// Calculates bounds that span all given nodes +fn spanning_bounds(nodes: Span) -> Bounds { + let mut result = Bounds { x_min: MAX_DIMENSION, y_min: MAX_DIMENSION, x_max: 0, y_max: 0 }; + + for node in nodes { + let n: RTreeNode = node.deref().unpack(); + let b = n.bounds; + if b.x_min < result.x_min { + result.x_min = b.x_min; + } + if b.x_max > result.x_max { + result.x_max = b.x_max; + } + if b.y_min < result.y_min { + result.y_min = b.y_min; + } + if b.y_max > result.y_max { + result.y_max = b.y_max; + } + }; + + result +} + +fn distribute_children(children: Span) -> (Span, Span) { + // Don't split if only 1 child + assert!(children.len() > 1, "split error"); + + // Find the optimal way to split the childen into 2 smallest groups + + let mut max_difference = 0; + let mut seed_child_1 = 0; + let mut seed_child_2 = 1; + + let mut i = 0; + let mut j = 1; + + // Precache a collection of the unpacked children ids + let mut bounds: Array = array![]; + for child in children { + let tn: RTreeNode = (*child).unpack(); + bounds.append(tn.bounds); + }; + + while i < children.len() { + while j < children.len() { + let bounds_i = bounds.at(i).deref(); + let bounds_j = bounds.at(j).deref(); + + let combined_area = bounds_i.combine(bounds_j).area(); + + let difference = combined_area + - bounds.at(i).deref().area() + + bounds.at(j).deref().area(); + + if (difference > max_difference) { + max_difference = difference; + seed_child_1 = i; + seed_child_2 = j; + } + + j += 1; + }; + i += 1; + }; + + // These two are the "worst" combination, so can be seed for the split + let mut arr1 = array![*children[seed_child_1]]; + let mut arr2 = array![*children[seed_child_2]]; + + let mut i = 0; + + // Get the bounds for both seeds for easier comparison later + let bounds1 = *bounds[seed_child_1]; + let bounds2 = *bounds[seed_child_2]; + + while i < bounds.len() { + // Only process the remaining children + if i != seed_child_1 && i != seed_child_2 { + let compared: Bounds = *bounds[i]; + + let enlargement1 = bounds1.combine(compared).area(); + let enlargement2 = bounds2.combine(compared).area(); + + if enlargement1 < enlargement2 { + // This item goes with seed1 + arr1.append(*children[i]); + } else { + // This item goes with seed2 + arr2.append(*children[i]); + } + } + + i += 1; + }; + + (arr1.span(), arr2.span()) +} + +fn choose_leaf(world: IWorldDispatcher, node_id: u64, new_bounds: Bounds, parent_id: u64) -> RTree { + let node: RTreeNode = node_id.unpack(); + + // Load the parent from storage + let treenode: RTree = get!(world, (node_id), RTree); + + // The parent is a leaf and can be used + if node.is_leaf { + return treenode; + } + + // Find the most suitable child (that fits the new area without expanding the least) + let best_child_id = choose_best_child(node, treenode.get_children(), new_bounds); + + // Recursively keep looking until the leaf with the smallest new area is found + + choose_leaf(world, best_child_id, new_bounds, parent_id) +} + + +fn choose_best_child(parent: RTreeNode, children: Span, new: Bounds) -> u64 { + let mut best_child_id: u64 = 0; + let mut best_child_area: u32 = 0; + + let mut best_new_area: u32 = 0x40000000; // pow2_32_max (15bit*15bit) + + for child_id in children { + let child: RTreeNode = (*child_id).unpack(); + let new_area = child.bounds.combine(new).area(); + + if new_area < best_new_area { + best_new_area = new_area; + best_child_area = child.bounds.area(); + best_child_id = *child_id; + } else if new_area == best_new_area && child.bounds.area() < best_child_area { + best_child_id = *child_id; + } + }; + + (best_child_id) +} + +fn check_area_containing(world: IWorldDispatcher, bounds: Bounds, node_id: u64) { + let node: RTreeNode = node_id.unpack(); + + let treenode: RTree = get!(world, (node_id), RTree); + + let children: Span = treenode.get_children(); + + // Evaluate children + for child_id in children { + let child: RTreeNode = (*child_id).unpack(); + if node.is_leaf { + // We're looping Area's now + assert(!bounds.contains_bounds(child.bounds), 'overlap containing'); + } else { + // We're looping Nodes now, so recurse only if our bounds contains the childnode + // This means we're getting closer to finding a matching Area (inside) + if bounds.contains_bounds(child.bounds) { + check_area_containing(world, bounds, *child_id); + } + } + }; +} + +// TODO testing +pub fn find_smallest_node_spanning_bounds( + world: IWorldDispatcher, bounds: Bounds, node_id: u64, is_area: bool +) -> u64 { + let node: RTreeNode = node_id.unpack(); + let mut result: u64 = ROOT_ID; + + // If the given node doesnt contain it, just return immediately + if !node.bounds.contains_bounds(bounds) || is_area && node.is_leaf { + return ROOT_ID; + } + + let treenode: RTree = get!(world, (node_id), RTree); + + let children: Span = treenode.get_children(); + + // Evaluate children + for child_id in children { + let child: RTreeNode = (*child_id).unpack(); + + // Check the children + if child.bounds.contains_bounds(bounds) { + result = find_smallest_node_spanning_bounds(world, bounds, *child_id, is_area); + + break; + } + }; + result +} + + +fn check_area_overlap(world: IWorldDispatcher, bounds: Bounds) { + // We can optimize the start of the search by caching the node that contains the new bounds + // and using that instead of ROOT_ID + let node_search_id = ROOT_ID; //find_node_spanning_bounds(world, bounds, ROOT_ID, false); + + // Check if our new bounds contain an existing area + check_area_containing(world, bounds, node_search_id); + + // Check that each of the 4 corners are not inside of an existing area + assert( + find_node_for_position( + world, Position { x: bounds.x_min, y: bounds.y_min }, node_search_id, true + ) == 0, + 'overlap topleft' + ); + assert( + find_node_for_position( + world, Position { x: bounds.x_max, y: bounds.y_min }, node_search_id, true + ) == 0, + 'overlap topright' + ); + assert( + find_node_for_position( + world, Position { x: bounds.x_min, y: bounds.y_max }, node_search_id, true + ) == 0, + 'overlap bottomleft' + ); + assert( + find_node_for_position( + world, Position { x: bounds.x_max, y: bounds.y_max }, node_search_id, true + ) == 0, + 'overlap bottomright' + ); +} + +// Splits the current node, and those above it if needed +fn update_ancestors( + world: IWorldDispatcher, ancestors: Span, level: usize, updated_children: Array +) { + // Step 1: Identify Node to update + let mut current_node_id = *ancestors[level]; + + let current_treenode: RTree = get!(world, (current_node_id), RTree); + let mut current_node: RTreeNode = current_treenode.get_node(); + + // // Step 3: Remove the old node from storage, we're replacing it with 2 new ones + delete!(world, (current_treenode)); + + if updated_children.len() <= 4 { + // Get children of parent, if not root + if level != 0 { + let current_spanningbounds = spanning_bounds(updated_children.span()); + current_node.bounds = current_spanningbounds; + let updated_node_id = current_node.pack(); + set!(world, RTree { id: updated_node_id, children: updated_children.span().pack() }); + + let parent_node_id = *ancestors[level - 1]; + let parent_treenode: RTree = get!(world, (parent_node_id), RTree); + let parent_updated_children = parent_treenode + .replace_child_id(current_node_id, updated_node_id); + update_ancestors(world, ancestors, level - 1, parent_updated_children); + + current_node_id = updated_node_id; + } else { + // This is root, and the ID has to stay the same (bounds will never change) + set!(world, RTree { id: current_node_id, children: updated_children.span().pack() }); + } + + return; + } + + // Step 4: distribute the new children over two collections + let (current_children, sibling_children) = distribute_children(updated_children.span()); + + // Step 5: Calculate New Bounds + let current_spanningbounds = spanning_bounds(current_children); + let sibling_spanningbounds = spanning_bounds(sibling_children); + + // Step 6: Create New Nodes + current_node.bounds = current_spanningbounds; + let updated_node_id = current_node.pack(); + let sibling_node = RTreeNode { + bounds: sibling_spanningbounds, is_leaf: current_node.is_leaf, is_area: false + }; + let sibling_node_id = sibling_node.pack(); + + // Add the two new ones + set!(world, RTree { id: updated_node_id, children: current_children.pack() }); + set!(world, RTree { id: sibling_node_id, children: sibling_children.pack() }); + + if level == 0 { + // Move the node and sibling as new children under ROOT + + let updated_root_children = array![updated_node_id, sibling_node_id].span(); + + set!(world, RTree { id: ROOT_ID, children: updated_root_children.pack() }); + + return; + } + + // Remove the old node if it changed + if current_node_id != updated_node_id { + delete!(world, (current_treenode)); + } + + // Step 7: Update the parent children + let parent_node_id = *ancestors[level - 1]; + let parent_treenode: RTree = get!(world, (parent_node_id), RTree); + + // Replace the current node + let mut parent_updated_children = parent_treenode + .replace_child_id(current_node_id, updated_node_id); + + // Add the new sibling + parent_updated_children.append(sibling_node_id); + + // Update the parents + update_ancestors(world, ancestors, level - 1, parent_updated_children); +} + diff --git a/contracts/src/core/actions/pixel.cairo b/contracts/src/core/actions/pixel.cairo new file mode 100644 index 0000000..4b33381 --- /dev/null +++ b/contracts/src/core/actions/pixel.cairo @@ -0,0 +1,290 @@ +use core::poseidon::poseidon_hash_span; +use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; +use pixelaw::core::models::area::{ + BoundsTraitImpl, RTreeTraitImpl, ROOT_ID, RTreeNode, RTree, Area, RTreeNodePackableImpl +}; +use pixelaw::core::models::pixel::{ + Pixel, PixelUpdate, PixelUpdateTrait, PixelUpdateResult, PixelUpdateResultTrait +}; +use pixelaw::core::models::queue::QueueItem; + +use pixelaw::core::models::registry::{AppCalldataTrait, App, AppName, CoreActionsAddress}; +use pixelaw::core::utils::{ + ON_PRE_UPDATE_HOOK, ON_POST_UPDATE_HOOK, starknet_keccak, get_core_actions_address, Position, + MAX_DIMENSION, Bounds +}; +use pixelaw::core::utils; +use starknet::{ + ContractAddress, get_caller_address, get_contract_address, get_tx_info, contract_address_const, + syscalls::{call_contract_syscall}, +}; + + +pub fn can_update_pixel( + world: IWorldDispatcher, + for_player: ContractAddress, + for_system: ContractAddress, + pixel: Pixel, + pixel_update: PixelUpdate, + area_id_hint: Option, + allow_modify: bool +) -> PixelUpdateResult { + // 1. Is there an owner of pixel or area? + if pixel.owner == for_player { + return PixelUpdateResult::Ok(pixel_update); + } + + // Load the area + let area_result = super::area::find_area_for_position( + world, Position { x: pixel.x, y: pixel.y }, area_id_hint + ); + if let Option::Some(area) = area_result { + // Return true if the player is owner of the area + if area.owner == for_player { + return PixelUpdateResult::Ok(pixel_update); + } + // Return true if neither area nor pixel have an owner + if area.owner == contract_address_const::<0>() + && pixel.owner == contract_address_const::<0>() { + return PixelUpdateResult::Ok(pixel_update); + } + // Return true if there is no area and pixel has no owner + } else if pixel.owner == contract_address_const::<0>() { + return PixelUpdateResult::Ok(pixel_update); + } + + // Get the pixel_app from either the pixel or maybe the area + let pixel_app = determine_app(pixel, area_result); + + // Return if the pixel has no app (hook is not going to work) + if pixel_app == contract_address_const::<0>() { + return PixelUpdateResult::NotAllowed; + } + + // At this point its likely that the pixel and/or area have a different owner + // We can still try to call the hook on the pixel's App and see if that allows anything + + // Retrieve the App for the calling system + let mut caller_app = get!(world, for_system, (App)); + + // 2. Return the result of the hook call + call_on_pre_update(world, pixel.app, pixel_update, caller_app, for_player, allow_modify) +} + +pub fn update_pixel( + world: IWorldDispatcher, + for_player: ContractAddress, + for_system: ContractAddress, + pixel_update: PixelUpdate, + area_id_hint: Option, + allow_modify: bool +) -> PixelUpdateResult { + // Check if the pixel_update values are valid (x and y) + pixel_update.validate(); + + // validate that for_player is not different from the actual caller unless the + // calling contract is the core. + // TODO is there an exploit by doing this through a hook then? + validate_callers(world, for_player); + + // Load the pixel + let mut pixel = get!(world, (pixel_update.x, pixel_update.y), (Pixel)); + + let update_result = can_update_pixel( + world, for_player, for_system, pixel, pixel_update, area_id_hint, allow_modify + ); + + // println!("update_pixel {:?}", update_result); + let new_pixel_update = match update_result { + PixelUpdateResult::Error(_) | PixelUpdateResult::NotAllowed => { return update_result; }, + PixelUpdateResult::Ok(result) => result + }; + + apply_pixel_update(ref pixel, new_pixel_update); + + // If the pixel has no owner set yet, do that now. + if pixel.created_at == 0 { + let now = starknet::get_block_timestamp(); + + pixel.created_at = now; + pixel.updated_at = now; + } + // Store the Pixel + set!(world, (pixel)); + // Call on_post_update if the pixel has an app + if pixel.app != contract_address_const::<0>() { + let mut caller_app = get!(world, for_system, (App)); + + if let Result::Err(err) = + call_on_post_update(world, pixel.app, pixel_update, caller_app, for_player) { + return PixelUpdateResult::Error(err); + } + } + + PixelUpdateResult::Ok(new_pixel_update) +} + +fn apply_pixel_update(ref pixel: Pixel, pixel_update: PixelUpdate) { + if let Option::Some(app) = pixel_update.app { + pixel.app = app; + } + + if let Option::Some(color) = pixel_update.color { + pixel.color = color; + } + + if let Option::Some(owner) = pixel_update.owner { + pixel.owner = owner; + } + + if let Option::Some(text) = pixel_update.text { + pixel.text = text; + } + + if let Option::Some(timestamp) = pixel_update.timestamp { + pixel.timestamp = timestamp; + } + + if let Option::Some(action) = pixel_update.action { + pixel.action = action; + } +} + +fn call_on_pre_update( + world: IWorldDispatcher, + contract_address: ContractAddress, + pixel_update: PixelUpdate, + app_caller: App, + for_player: ContractAddress, + allow_modify: bool +) -> PixelUpdateResult { + let mut calldata: Array = array![]; + let mut result = PixelUpdateResult::Ok(pixel_update); + + pixel_update.add_to_calldata(ref calldata); + app_caller.add_to_calldata(ref calldata); + calldata.append(for_player.into()); + + // println!("call_on_pre_update {:?}", pixel_update); + let out = call_contract_syscall(contract_address, ON_PRE_UPDATE_HOOK, calldata.span()); + + if out.is_err() { + if let Option::Some(err) = out.err() { + if *err.at(0) != 'ENTRYPOINT_NOT_FOUND' && *err.at(0) != 'CONTRACT_NOT_DEPLOYED' { + result = PixelUpdateResult::Error(*err.at(0)); + } + } + } else { + if let Option::Some(returned_update) = parseHookOutput(out.unwrap()) { + if returned_update == pixel_update + || (returned_update != pixel_update && !allow_modify) { + return PixelUpdateResult::Ok(returned_update); + } else { + return PixelUpdateResult::NotAllowed; + } + } else { + return PixelUpdateResult::NotAllowed; + } + } + result +} + +fn call_on_post_update( + world: IWorldDispatcher, + contract_address: ContractAddress, + pixel_update: PixelUpdate, + app_caller: App, + for_player: ContractAddress +) -> Result<(), felt252> { + let mut calldata: Array = array![]; + let mut result = Result::Ok(()); + + pixel_update.add_to_calldata(ref calldata); + app_caller.add_to_calldata(ref calldata); + calldata.append(for_player.into()); + + let out = call_contract_syscall(contract_address, ON_POST_UPDATE_HOOK, calldata.span()); + + if out.is_err() { + if let Option::Some(err) = out.err() { + if *err.at(0) != 'ENTRYPOINT_NOT_FOUND' && *err.at(0) != 'CONTRACT_NOT_DEPLOYED' { + result = Result::Err(*err.at(0)); + } + } + } + result +} + +fn parseHookOutput(data: Span) -> Option { + let mut color: Option = Option::None; + let mut owner: Option = Option::None; + let mut app: Option = Option::None; + let mut text: Option = Option::None; + let mut timestamp: Option = Option::None; + let mut action: Option = Option::None; + + // println!("parse: {:?}", data); + if data.at(0).deref() == 1 { + return Option::None; + } + let x: u16 = data.at(1).deref().try_into().unwrap(); + let y: u16 = data.at(2).deref().try_into().unwrap(); + + let mut i = 3; + if data.at(i).deref() == 0 { + i += 1; + color = Option::Some(data.at(i).deref().try_into().unwrap()); + } + i += 1; + if data.at(i).deref() == 0 { + i += 1; + owner = Option::Some(data.at(i).deref().try_into().unwrap()); + } + i += 1; + if data.at(i).deref() == 0 { + i += 1; + app = Option::Some(data.at(i).deref().try_into().unwrap()); + } + i += 1; + if data.at(i).deref() == 0 { + i += 1; + text = Option::Some(data.at(i).deref().try_into().unwrap()); + } + i += 1; + if data.at(i).deref() == 0 { + i += 1; + timestamp = Option::Some(data.at(i).deref().try_into().unwrap()); + } + i += 1; + if data.at(i).deref() == 0 { + i += 1; + action = Option::Some(data.at(i).deref().try_into().unwrap()) + } + + // Now it just panics when trying to read outside of index + Option::Some(PixelUpdate { x, y, color, owner, app, text, timestamp, action }) +} + +// Gives the appropriate App, based on availability in Pixel or Area +fn determine_app(pixel: Pixel, area_result: Option) -> ContractAddress { + let mut result = contract_address_const::<0>(); + if pixel.app == contract_address_const::<0>() { + if let Option::Some(area) = area_result { + result = area.app; + } + } else { + result = pixel.app; + } + result +} + +fn validate_callers(world: IWorldDispatcher, for_player: ContractAddress) { + let core_address = get_core_actions_address(world); + + let caller_account = get_tx_info().unbox().account_contract_address; + let caller_contract = get_contract_address(); + + if for_player != caller_account { + assert(caller_contract == core_address, 'unauthorized caller_account'); + } +} diff --git a/contracts/src/core/actions/queue.cairo b/contracts/src/core/actions/queue.cairo new file mode 100644 index 0000000..ab3e971 --- /dev/null +++ b/contracts/src/core/actions/queue.cairo @@ -0,0 +1,67 @@ +use core::poseidon::poseidon_hash_span; +use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; +use pixelaw::core::events::{QueueScheduled, QueueProcessed, AppNameUpdated, Alert}; +use pixelaw::core::models::area::{ + BoundsTraitImpl, RTreeTraitImpl, ROOT_ID, RTreeNode, RTree, Area, RTreeNodePackableImpl +}; + +use pixelaw::core::models::pixel::{Pixel, PixelUpdate}; +use pixelaw::core::models::queue::QueueItem; + +use pixelaw::core::models::registry::{App, AppName, CoreActionsAddress}; + +use pixelaw::core::utils::{get_core_actions_address, Position, MAX_DIMENSION, Bounds}; +use pixelaw::core::utils; +use starknet::{ + ContractAddress, get_caller_address, get_contract_address, get_tx_info, contract_address_const, + syscalls::{call_contract_syscall}, +}; + +pub fn schedule_queue( + world: IWorldDispatcher, + timestamp: u64, + called_system: ContractAddress, + selector: felt252, + calldata: Span, +) -> QueueScheduled { + // TODO: Review security + + // hash the call and store the hash for verification + let id = poseidon_hash_span( + array![timestamp.into(), called_system.into(), selector, poseidon_hash_span(calldata)] + .span(), + ); + // Emit the event, so an external scheduler can pick it up + // FIXME can we even emit events here? For now return and let it emit in the dojo contract + + QueueScheduled { id, timestamp, called_system, selector, calldata: calldata } +} + + +pub fn process_queue( + world: IWorldDispatcher, + id: felt252, + timestamp: u64, + called_system: ContractAddress, + selector: felt252, + calldata: Span, +) -> QueueProcessed { + // A quick check on the timestamp so we know it's not too early for this one + assert!(timestamp <= starknet::get_block_timestamp(), "timestamp still in the future"); + + // Recreate the id to check the integrity + let calculated_id = poseidon_hash_span( + array![timestamp.into(), called_system.into(), selector, poseidon_hash_span(calldata)] + .span(), + ); + + // Only valid when the queue item was found by the hash + assert!(calculated_id == id, "Invalid Id"); + + // Make the call itself + let _result = call_contract_syscall(called_system, selector, calldata); + + QueueProcessed { id } + // Tell the offchain schedulers that this one is done + +} diff --git a/contracts/src/core/events.cairo b/contracts/src/core/events.cairo new file mode 100644 index 0000000..adcd637 --- /dev/null +++ b/contracts/src/core/events.cairo @@ -0,0 +1,34 @@ +use pixelaw::core::models::registry::{App}; +use pixelaw::core::utils::{Position}; +use starknet::{ContractAddress}; + + +#[derive(Drop, starknet::Event, Debug, PartialEq)] +pub struct QueueScheduled { + pub id: felt252, + pub timestamp: u64, + pub called_system: ContractAddress, + pub selector: felt252, + pub calldata: Span, +} + +#[derive(Drop, starknet::Event, Debug, PartialEq)] +pub struct QueueProcessed { + pub id: felt252, +} + +#[derive(Drop, starknet::Event)] +pub struct AppNameUpdated { + pub app: App, + pub caller: felt252, +} + +#[derive(Debug, Drop, Serde, starknet::Event, PartialEq)] +pub struct Alert { + pub position: Position, + pub caller: ContractAddress, + pub player: ContractAddress, + pub message: felt252, + pub timestamp: u64, +} + diff --git a/contracts/src/core/models.cairo b/contracts/src/core/models.cairo index b56c0bd..455dbff 100644 --- a/contracts/src/core/models.cairo +++ b/contracts/src/core/models.cairo @@ -1,4 +1,4 @@ -pub mod permissions; +pub mod area; pub mod pixel; pub mod queue; pub mod registry; diff --git a/contracts/src/core/models/area.cairo b/contracts/src/core/models/area.cairo new file mode 100644 index 0000000..d54e2ed --- /dev/null +++ b/contracts/src/core/models/area.cairo @@ -0,0 +1,270 @@ +use core::starknet::storage_access::StorePacking; +use pixelaw::core::utils::{ + MASK_16, MASK_32, MASK_64, MASK_96, POW_2_16, POW_2_30, POW_2_31, POW_2_32, POW_2_48, POW_2_64, + POW_2_96, MAX_DIMENSION +}; +use pixelaw::core::utils::{min, max, Bounds, Position}; +use starknet::{ContractAddress, ClassHash}; + +pub const TWO_POW_188: u256 = 0x100000000000000000000000000000000000000000000000; +pub const TWO_POW_124: u256 = 0x10000000000000000000000000000000; +pub const TWO_POW_62: u256 = 0x4000000000000000; +const TWO_POW_47: u64 = 0x800000000000; +const TWO_POW_32: u64 = 0x100000000; +const TWO_POW_17: u64 = 0x20000; +const TWO_POW_2: u64 = 0x4; +const TWO_POW_1: u64 = 0x2; +const MASK_15: u64 = 0x7FFF; +const MASK_62: u64 = 0x3fffffffffffffff; +const MASK_1: u64 = 0x1; + +pub const ROOT_RTREENODE_EMPTY: RTreeNode = + RTreeNode { + bounds: Bounds { x_min: 0, y_min: 0, x_max: MAX_DIMENSION, y_max: MAX_DIMENSION }, + is_leaf: true, + is_area: false + }; + +pub const ROOT_RTREENODE: RTreeNode = + RTreeNode { + bounds: Bounds { x_min: 0, y_min: 0, x_max: MAX_DIMENSION, y_max: MAX_DIMENSION }, + is_leaf: false, + is_area: false + }; + +pub const FIRST_RTREENODE: RTreeNode = + RTreeNode { + bounds: Bounds { x_min: 0, y_min: 0, x_max: 10, y_max: 10 }, is_leaf: true, is_area: false + }; + +pub const ROOT_EMPTY_ID: u64 = 4294967294; // for ROOT_RTREENODE_EMPTY +pub const ROOT_ID: u64 = 4294967292; // for ROOT_RTREENODE +pub const FIRST_ID: u64 = 1310762; // for FIRST_RTREENODE + + +#[dojo::model(namespace: "pixelaw", nomapping: true)] +#[derive(Copy, Drop, Serde, Debug, PartialEq, Introspect)] +pub struct RTree { + #[key] + pub id: u64, // Only 62 bits used so we can cram 4 in a felt252 + // 00000000000000000000000000000000000000000000000000000000000000 + // xxxxxxxxxxxxxxxyyyyyyyyyyyyyyywwwwwwwwwwwwwwwhhhhhhhhhhhhhhhla + // x_min: u16, << 47 + // y_min: u16, << 32 + // x_max: u16 << 17 + // y_max: u16 << 2 + // is_leaf: 1 << 1 + // is_area: 1 + pub children: felt252 +} + +#[derive(Copy, Drop, Serde, Debug, PartialEq)] +pub struct RTreeNode { + pub bounds: Bounds, + pub is_leaf: bool, + pub is_area: bool, +} + +#[dojo::model(namespace: "pixelaw", nomapping: true)] +#[derive(Copy, Drop, Serde, Debug, PartialEq, Introspect)] +pub struct Area { + #[key] + pub id: u64, + pub app: ContractAddress, + pub owner: ContractAddress, + pub color: u32 +} + +pub trait RTreeTrait { + fn get_node(self: RTree) -> RTreeNode; + fn get_children(self: RTree) -> Span; + fn add_child_id(self: RTree, child_id: u64) -> Array; + fn remove_child_id(self: RTree, child_id_existing: u64) -> Array; + fn replace_child_id(self: RTree, child_id_existing: u64, child_id_new: u64) -> Array; +} + +pub impl RTreeTraitImpl of RTreeTrait { + fn get_node(self: RTree) -> RTreeNode { + self.id.unpack() + } + + fn get_children(self: RTree) -> Span { + self.children.unpack() + } + + fn remove_child_id(self: RTree, child_id_existing: u64) -> Array { + let children: Span = self.children.unpack(); + + let mut output: Array = array![]; + + for child_id in children { + if *child_id != child_id_existing { + output.append(*child_id); + } + }; + output + } + + fn add_child_id(self: RTree, child_id: u64) -> Array { + let children: Span = self.children.unpack(); + + let mut arr: Array = children.into(); + arr.append(child_id); + + arr + } + + // Naive implementation of replacement + fn replace_child_id(self: RTree, child_id_existing: u64, child_id_new: u64) -> Array { + let children: Span = self.children.unpack(); + + let mut output: Array = array![]; + + for child_id in children { + if *child_id != child_id_existing { + output.append(*child_id); + } + }; + output.append(child_id_new); + output + } +} + +pub trait BoundsTrait { + fn check(self: Bounds); + fn area(self: Bounds) -> u32; + fn contains_position(self: Bounds, position: Position) -> bool; + fn contains_bounds(self: Bounds, other: Bounds) -> bool; + fn combine(self: Bounds, other: Bounds) -> Bounds; + fn intersects(self: Bounds, other: Bounds) -> bool; +} + +pub impl BoundsTraitImpl of BoundsTrait { + fn check(self: Bounds) { + assert( + self.x_max >= self.x_min + && self.y_max >= self.y_min + && self.x_min <= MAX_DIMENSION + && self.x_max <= MAX_DIMENSION + && self.y_min <= MAX_DIMENSION + && self.y_max <= MAX_DIMENSION, + 'invalid bounds' + ); + } + + fn area(self: Bounds) -> u32 { + (self.x_max - self.x_min).into() * (self.y_max - self.y_min).into() + } + fn contains_bounds(self: Bounds, other: Bounds) -> bool { + other.x_min >= self.x_min + && other.x_max <= self.x_max + && other.y_min >= self.y_min + && other.y_max <= self.y_max + } + fn contains_position(self: Bounds, position: Position) -> bool { + position.x >= self.x_min + && position.x <= self.x_max + && position.y >= self.y_min + && position.y <= self.y_max + } + fn intersects(self: Bounds, other: Bounds) -> bool { + !(self.x_max < other.x_min + || self.x_min > other.x_max + || self.y_max < other.y_min + || self.y_min > other.y_max) + } + + fn combine(self: Bounds, other: Bounds) -> Bounds { + Bounds { + x_min: min(self.x_min, other.x_min), + y_min: min(self.y_min, other.y_min), + x_max: max(self.x_max, other.x_max), + y_max: max(self.y_max, other.y_max) + } + } +} + +pub trait Packable { + fn pack(self: T) -> PackedT; + fn unpack(self: PackedT) -> T; +} + + +pub impl ChildrenPackableImpl of Packable, felt252> { + // It only packs the first 4 entries in the Span and discards the rest! + fn pack(self: Span) -> felt252 { + let mut out: u256 = 0; + + if self.len() > 0 { + out += (*self[0]).try_into().unwrap(); + if self.len() > 1 { + out += (*self[1]).try_into().unwrap() * TWO_POW_62; + if self.len() > 2 { + out += (*self[2]).try_into().unwrap() * TWO_POW_124; + if self.len() > 3 { + out += (*self[3]).try_into().unwrap() * TWO_POW_188; + } + } + } + } + + out.try_into().unwrap() + } + + fn unpack(self: felt252) -> Span { + let val: u256 = self.into(); + let mut out: Array = array![]; + + let val1 = (val & MASK_62.into()).try_into().unwrap(); + + if val1 > 0 { + out.append(val1); + let val2 = ((val / TWO_POW_62.into()) & MASK_62.into()).try_into().unwrap(); + if val2 > 0 { + out.append(val2); + let val3 = ((val / TWO_POW_124.into()) & MASK_62.into()).try_into().unwrap(); + if val3 > 0 { + out.append(val3); + let val4 = ((val / TWO_POW_188.into()) & MASK_62.into()).try_into().unwrap(); + if val4 > 0 { + out.append(val4); + } + } + } + }; + + out.span() + } +} + +pub impl RTreeNodePackableImpl of Packable { + fn pack(self: RTreeNode) -> u64 { + ((self.bounds.x_min.into() * TWO_POW_47)) + + (self.bounds.y_min.into() * TWO_POW_32) + + (self.bounds.x_max.into() * TWO_POW_17) + + (self.bounds.y_max.into() * TWO_POW_2) + + (match self.is_leaf { + true => 2, + false => 0 + }) + + (match self.is_area { + true => 1, + false => 0 + }) + } + + fn unpack(self: u64) -> RTreeNode { + let bounds = Bounds { + x_min: ((self / TWO_POW_47) & MASK_15).try_into().unwrap(), + y_min: ((self / TWO_POW_32) & MASK_15).try_into().unwrap(), + x_max: ((self / TWO_POW_17) & MASK_15).try_into().unwrap(), + y_max: ((self / TWO_POW_2) & MASK_15).try_into().unwrap() + }; + + let is_leaf: bool = ((self / 2) & MASK_1) == 1; + let is_area: bool = ((self) & MASK_1) == 1; + + RTreeNode { bounds, is_leaf, is_area } + } +} + diff --git a/contracts/src/core/models/permissions.cairo b/contracts/src/core/models/permissions.cairo deleted file mode 100644 index c02b323..0000000 --- a/contracts/src/core/models/permissions.cairo +++ /dev/null @@ -1,23 +0,0 @@ -use starknet::{ContractAddress, ClassHash}; - -// TODO is this using packing? If not, try to use bitmasking approach -#[derive(Copy, Drop, Serde, Introspect, PartialEq)] -pub struct Permission { - pub app: bool, - pub color: bool, - pub owner: bool, - pub text: bool, - pub timestamp: bool, - pub action: bool -} - -#[derive(Copy, Drop, Serde)] -#[dojo::model(namespace: "pixelaw", nomapping: true)] -pub struct Permissions { - #[key] - pub allowing_app: ContractAddress, - #[key] - pub allowed_app: ContractAddress, - // The permissions - pub permission: Permission -} diff --git a/contracts/src/core/models/pixel.cairo b/contracts/src/core/models/pixel.cairo index 16d03f7..440fab3 100644 --- a/contracts/src/core/models/pixel.cairo +++ b/contracts/src/core/models/pixel.cairo @@ -1,25 +1,17 @@ +use pixelaw::core::utils::{ + MASK_16, MASK_32, MASK_64, MASK_96, POW_2_16, POW_2_30, POW_2_31, POW_2_32, POW_2_48, POW_2_64, + POW_2_96, MAX_DIMENSION +}; use starknet::{ContractAddress, ClassHash}; -#[derive(Copy, Drop, Serde)] -pub struct PixelUpdate { - pub x: u32, - pub y: u32, - pub color: Option, - pub owner: Option, - pub app: Option, - pub text: Option, - pub timestamp: Option, - pub action: Option -} - -#[derive(Copy, Drop, Serde, PartialEq)] +#[derive(Debug, Copy, Drop, Serde, PartialEq)] #[dojo::model(namespace: "pixelaw", nomapping: true)] pub struct Pixel { // System properties #[key] - pub x: u32, + pub x: u16, // only 15 bits used, to a max of 32767 #[key] - pub y: u32, + pub y: u16, // only 15 bits used, to a max of 32767 // User-changeable properties pub app: ContractAddress, pub color: u32, @@ -30,3 +22,112 @@ pub struct Pixel { pub text: felt252, pub action: felt252 } + + +#[derive(Drop, Copy, Serde)] +pub enum PixelUpdateResult { + Ok: PixelUpdate, + NotAllowed, + Error: felt252 +} + +pub trait PixelUpdateResultTrait { + fn is_ok(self: PixelUpdateResult) -> bool; + fn is_err(self: PixelUpdateResult) -> bool; + fn unwrap(self: PixelUpdateResult) -> PixelUpdate; +} + +pub impl PixelUpdateResultTraitImpl of PixelUpdateResultTrait { + fn is_ok(self: PixelUpdateResult) -> bool { + match self { + PixelUpdateResult::Ok(_) => true, + _ => false, + } + } + + /// Returns true if the result is `Error`. + fn is_err(self: PixelUpdateResult) -> bool { + match self { + PixelUpdateResult::Error(_) => true, + _ => false, + } + } + fn unwrap(self: PixelUpdateResult) -> PixelUpdate { + match self { + PixelUpdateResult::Ok(value) => value, + PixelUpdateResult::NotAllowed => panic!("Called `unwrap()` on a `NotAllowed` value"), + PixelUpdateResult::Error(_) => panic!("Called `unwrap()` on an `Error` value"), + } + } +} + +#[derive(PartialEq, Debug, Default, Copy, Drop, Serde)] +pub struct PixelUpdate { + pub x: u16, // only 15 bits used, to a max of 32767 + pub y: u16, // only 15 bits used, to a max of 32767 + pub color: Option, + pub owner: Option, + pub app: Option, + pub text: Option, + pub timestamp: Option, + pub action: Option +} + + +pub trait PixelUpdateTrait { + fn validate(self: PixelUpdate); + fn add_to_calldata(self: PixelUpdate, ref calldata: Array); +} + +pub impl PixelUpdateTraitImpl of PixelUpdateTrait { + fn validate(self: PixelUpdate) { + assert(self.x <= MAX_DIMENSION && self.y <= MAX_DIMENSION, 'position overflow'); + } + + fn add_to_calldata(self: PixelUpdate, ref calldata: Array) { + calldata.append(self.x.into()); + calldata.append(self.y.into()); + match self.color { + Option::Some(value) => { + calldata.append(0.into()); + calldata.append(value.into()); + }, + Option::None => { calldata.append(1.into()); }, + } + match self.owner { + Option::Some(value) => { + calldata.append(0.into()); + calldata.append(value.into()); + }, + Option::None => { calldata.append(1.into()); }, + } + match self.app { + Option::Some(value) => { + calldata.append(0.into()); + calldata.append(value.into()); + }, + Option::None => { calldata.append(1.into()); }, + } + match self.text { + Option::Some(value) => { + calldata.append(0.into()); + calldata.append(value.into()); + }, + Option::None => { calldata.append(1.into()); }, + } + match self.timestamp { + Option::Some(value) => { + calldata.append(0.into()); + calldata.append(value.into()); + }, + Option::None => { calldata.append(1.into()); }, + } + match self.action { + Option::Some(value) => { + calldata.append(0.into()); + calldata.append(value.into()); + }, + Option::None => { calldata.append(1.into()); }, + } + } +} diff --git a/contracts/src/core/models/registry.cairo b/contracts/src/core/models/registry.cairo index 6ab6923..3dc2653 100644 --- a/contracts/src/core/models/registry.cairo +++ b/contracts/src/core/models/registry.cairo @@ -5,7 +5,7 @@ use pixelaw::core::actions::{ }; use starknet::{ContractAddress, get_caller_address, ClassHash, get_contract_address, get_tx_info}; -#[derive(Copy, Drop, Serde)] +#[derive(Debug, Copy, Drop, Serde)] #[dojo::model(namespace: "pixelaw", nomapping: true)] pub struct App { #[key] @@ -16,6 +16,19 @@ pub struct App { pub action: felt252 } +pub trait AppCalldataTrait { + fn add_to_calldata(self: App, ref calldata: Array); +} + +pub impl AppCalldataTraitImpl of AppCalldataTrait { + fn add_to_calldata(self: App, ref calldata: Array) { + calldata.append(self.system.into()); + calldata.append(self.name.into()); + calldata.append(self.icon.into()); + calldata.append(self.action.into()); + } +} + #[derive(Copy, Drop, Serde)] #[dojo::model(namespace: "pixelaw", nomapping: true)] pub struct AppUser { @@ -44,12 +57,3 @@ pub struct CoreActionsAddress { pub value: ContractAddress } -#[derive(Copy, Drop, Serde)] -#[dojo::model(namespace: "pixelaw", nomapping: true)] -pub struct Instruction { - #[key] - pub system: ContractAddress, - #[key] - pub selector: felt252, - pub instruction: felt252 -} diff --git a/contracts/src/core/tests.cairo b/contracts/src/core/tests.cairo index 2de788a..f2549d3 100644 --- a/contracts/src/core/tests.cairo +++ b/contracts/src/core/tests.cairo @@ -1,4 +1,6 @@ +pub mod area; pub mod base; pub mod helpers; pub mod interop; +pub mod pixel_area; pub mod queue; diff --git a/contracts/src/core/tests/area.cairo b/contracts/src/core/tests/area.cairo new file mode 100644 index 0000000..e77c7e2 --- /dev/null +++ b/contracts/src/core/tests/area.cairo @@ -0,0 +1,237 @@ +use core::fmt::Display; + +use core::{traits::TryInto, poseidon::poseidon_hash_span}; + +use dojo::{ + utils::test::{spawn_test_world, deploy_contract}, + world::{IWorldDispatcher, IWorldDispatcherTrait} +}; +use pixelaw::core::utils; + +use pixelaw::{ + core::{ + models::{ + registry::{App, AppName, app, app_name, core_actions_address, CoreActionsAddress}, + pixel::{Pixel, PixelUpdate, pixel}, + area::{ + Area, ROOT_ID, FIRST_RTREENODE, ROOT_RTREENODE_EMPTY, ROOT_RTREENODE, RTreeNode, + RTreeNodePackableImpl, ChildrenPackableImpl + } + }, + actions::{actions, IActionsDispatcher, IActionsDispatcherTrait, CORE_ACTIONS_KEY}, + utils::{Bounds, get_core_actions, Direction, Position, DefaultParameters, MAX_DIMENSION}, + actions::area::{print_tree, find_node_for_position}, + tests::helpers::{ + setup_core, setup_core_initialized, setup_apps, setup_apps_initialized, ZERO_ADDRESS, + set_caller, drop_all_events, TEST_POSITION, WHITE_COLOR, RED_COLOR, + }, + }, + apps::{ + paint::app::{ + paint_actions, IPaintActionsDispatcher, IPaintActionsDispatcherTrait, + APP_KEY as PAINT_APP_KEY + }, + snake::app::{ + snake, Snake, snake_segment, SnakeSegment, snake_actions, ISnakeActionsDispatcher, + ISnakeActionsDispatcherTrait, APP_KEY as SNAKE_APP_KEY + } + } +}; +use starknet::{ + get_block_timestamp, contract_address_const, ClassHash, ContractAddress, + testing::{set_block_timestamp, set_account_contract_address, set_caller_address}, +}; + + +// Declare constants for bounds and positions +const BOUNDS_1: Bounds = Bounds { x_min: 10, y_min: 10, x_max: 19, y_max: 19 }; +const BOUNDS_2: Bounds = Bounds { x_min: 20, y_min: 20, x_max: 29, y_max: 29 }; +const BOUNDS_3: Bounds = Bounds { x_min: 30, y_min: 30, x_max: 39, y_max: 39 }; +const BOUNDS_4: Bounds = Bounds { x_min: 40, y_min: 40, x_max: 49, y_max: 49 }; +const BOUNDS_5: Bounds = Bounds { x_min: 50, y_min: 50, x_max: 59, y_max: 59 }; +const BOUNDS_6: Bounds = Bounds { x_min: 60, y_min: 60, x_max: 69, y_max: 69 }; +const BOUNDS_7: Bounds = Bounds { x_min: 70, y_min: 70, x_max: 79, y_max: 79 }; +const BOUNDS_8: Bounds = Bounds { x_min: 80, y_min: 80, x_max: 84, y_max: 84 }; +const BOUNDS_9: Bounds = Bounds { x_min: 85, y_min: 85, x_max: 89, y_max: 89 }; +const BOUNDS_10: Bounds = Bounds { x_min: 90, y_min: 90, x_max: 99, y_max: 99 }; +const BOUNDS_11: Bounds = Bounds { x_min: 100, y_min: 100, x_max: 109, y_max: 109 }; +const BOUNDS_12: Bounds = Bounds { x_min: 110, y_min: 110, x_max: 119, y_max: 119 }; +const BOUNDS_13: Bounds = Bounds { x_min: 120, y_min: 120, x_max: 129, y_max: 129 }; +const BOUNDS_14: Bounds = Bounds { x_min: 130, y_min: 130, x_max: 139, y_max: 139 }; +const BOUNDS_15: Bounds = Bounds { x_min: 1050, y_min: 1050, x_max: 1059, y_max: 1059 }; + +const POSITION_1: Position = Position { x: 1, y: 1 }; +const POSITION_2: Position = Position { x: 11, y: 11 }; +const POSITION_3: Position = Position { x: 131, y: 131 }; +const POSITION_15: Position = Position { x: 1051, y: 1052 }; + + +#[test] +fn test_root_area() { + let root_id_empty: u64 = ROOT_RTREENODE_EMPTY.pack(); + let root_id: u64 = ROOT_RTREENODE.pack(); + let _first_id: u64 = FIRST_RTREENODE.pack(); + + let rootnode_empty: RTreeNode = root_id_empty.unpack(); + let rootnode: RTreeNode = root_id.unpack(); + + assert(ROOT_RTREENODE_EMPTY == rootnode_empty, 'rootnode_empty not same'); + assert(ROOT_RTREENODE == rootnode, 'rootnode not same'); +} + +#[test] +fn test_area_packing() { + let rect_in = RTreeNode { + bounds: utils::Bounds { x_min: 123, y_min: 321, x_max: 456, y_max: 654 }, + is_leaf: false, + is_area: true + }; + + let id = rect_in.pack(); + + let rect_out = id.unpack(); + + // println!("{:?}", rect_out); + assert(rect_in == rect_out, 'rect not same'); +} + +#[test] +#[should_panic(expected: ('overlap topleft', 'ENTRYPOINT_FAILED'))] +fn test_adding_overlapping() { + let (_world, core_actions, player_1, _player_2) = setup_core_initialized(); + + let _a1: Area = core_actions.add_area(BOUNDS_1, player_1, WHITE_COLOR, ZERO_ADDRESS()); + let _a2: Area = core_actions + .add_area( + Bounds { + x_min: 15, y_min: 15, x_max: 25, y_max: 25 + }, // These bounds are overlapping the prior + player_1, + WHITE_COLOR, + ZERO_ADDRESS() + ); +} + + +#[test] +#[should_panic(expected: ('overlap containing', 'ENTRYPOINT_FAILED'))] +fn test_adding_containing() { + let (_world, core_actions, player_1, _player_2) = setup_core_initialized(); + + let _a1: Area = core_actions.add_area(BOUNDS_1, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + // println!("------------------ PRINTING TREE -----------------"); + // print_tree(world, ROOT_ID, ""); + + let _a2: Area = core_actions + .add_area( + Bounds { + x_min: 5, y_min: 5, x_max: 25, y_max: 25 + }, // These bounds are containing the prior (so all corners are not inside another area) + player_1, + WHITE_COLOR, + ZERO_ADDRESS() + ); +} + +#[test] +fn test_remove() { + let (world, core_actions, player_1, _player_2) = setup_core_initialized(); + + let a1: Area = core_actions.add_area(BOUNDS_1, player_1, WHITE_COLOR, ZERO_ADDRESS()); + core_actions.remove_area(a1.id); + + assert(find_node_for_position(world, POSITION_2, ROOT_ID, true) == 0, 'should not find 1'); +} + + +#[test] +#[should_panic(expected: ('not area', 'ENTRYPOINT_FAILED'))] +fn test_remove_nonarea() { + let (_world, core_actions, player_1, _player_2) = setup_core_initialized(); + + let _a1: Area = core_actions.add_area(BOUNDS_1, player_1, WHITE_COLOR, ZERO_ADDRESS()); + core_actions.remove_area(120); +} + +#[test] +fn test_adding() { + let (world, core_actions, player_1, _player_2) = setup_core_initialized(); + + let _a1: Area = core_actions.add_area(BOUNDS_1, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + let not_found = find_node_for_position(world, POSITION_1, ROOT_ID, true); // has_area=true + + assert(not_found == 0, 'should not find'); + + let found = find_node_for_position(world, POSITION_2, ROOT_ID, true); // has_area=true + + assert(found != 0, 'should find'); + + // Add more than 4 so node splitting is necessary + let _a2 = core_actions.add_area(BOUNDS_2, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + let _a3 = core_actions.add_area(BOUNDS_3, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + let _a4 = core_actions.add_area(BOUNDS_4, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + // // Trigger a split + let _a5 = core_actions.add_area(BOUNDS_5, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + // Keep adding + let _a6 = core_actions.add_area(BOUNDS_6, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + let _a7 = core_actions.add_area(BOUNDS_7, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + let _a8 = core_actions.add_area(BOUNDS_8, player_1, WHITE_COLOR, ZERO_ADDRESS()); + let _a9 = core_actions.add_area(BOUNDS_9, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + let _a10 = core_actions.add_area(BOUNDS_10, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + let _a11 = core_actions.add_area(BOUNDS_11, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + let _a12 = core_actions.add_area(BOUNDS_12, player_1, WHITE_COLOR, ZERO_ADDRESS()); + let _a13 = core_actions.add_area(BOUNDS_13, player_1, WHITE_COLOR, ZERO_ADDRESS()); + let _a14 = core_actions.add_area(BOUNDS_14, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + // FIXME this addition messes up the tree (doesnt move children correctly) + let _a15 = core_actions.add_area(BOUNDS_15, player_1, WHITE_COLOR, ZERO_ADDRESS()); + + // println!("------------------ AFTER LAST SPLIT -----------------"); + // print_tree(world, ROOT_ID, ""); + // println!("------------------ ------------- -----------------"); + + assert(find_node_for_position(world, POSITION_2, ROOT_ID, true) != 0, 'should find 2'); + assert(find_node_for_position(world, POSITION_3, ROOT_ID, true) != 0, 'should find 3'); + assert(find_node_for_position(world, POSITION_15, ROOT_ID, true) != 0, 'should find 3'); + + let areas = core_actions + .find_areas_inside_bounds(Bounds { x_min: 30, y_min: 30, x_max: 45, y_max: 45 }); + + assert(*areas.at(0).id == 4222253504790685, 'not area 1'); + assert(*areas.at(1).id == 5629671339327685, 'not area 2'); +} + +#[test] +fn test_child_packing() { + let input = array![123].span(); + let out = input.pack(); + + assert(out.unpack() == input, '1 span not same'); + + let input = array![123, 321].span(); + let out = input.pack(); + + assert(out.unpack() == input, '2 span not same'); + + let input = array![123, 321, 456].span(); + let out = input.pack(); + + let out_unpacked: Span = out.unpack(); + assert(out_unpacked == input, '3 span not same'); + + let input = array![123, 321, 456, 654].span(); + let out = input.pack(); + + assert(out.unpack() == input, '4 span not same'); +} diff --git a/contracts/src/core/tests/base.cairo b/contracts/src/core/tests/base.cairo index e4f38c1..90e76a2 100644 --- a/contracts/src/core/tests/base.cairo +++ b/contracts/src/core/tests/base.cairo @@ -10,14 +10,13 @@ use dojo::{ use pixelaw::core::{ models::{ registry::{App, AppName, app, app_name, core_actions_address, CoreActionsAddress}, - pixel::{Pixel, PixelUpdate, pixel}, permissions::{permissions, Permission, Permissions} + pixel::{Pixel, PixelUpdate, PixelUpdateResult, PixelUpdateResultTrait, pixel}, }, actions::{actions, IActionsDispatcher, IActionsDispatcherTrait, CORE_ACTIONS_KEY}, - utils::{get_core_actions, Direction, Position, DefaultParameters}, + utils::{get_callers, get_core_actions, Direction, Position, DefaultParameters}, tests::helpers::{ setup_core, setup_core_initialized, setup_apps, setup_apps_initialized, ZERO_ADDRESS, - set_caller, drop_all_events, TEST_POSITION, WHITE_COLOR, RED_COLOR, PERMISSION_ALL, - PERMISSION_NONE + set_caller, drop_all_events, TEST_POSITION, WHITE_COLOR, RED_COLOR, } }; @@ -35,7 +34,9 @@ use pixelaw::{ }; use starknet::{ get_block_timestamp, contract_address_const, ClassHash, ContractAddress, - testing::{set_block_timestamp, set_account_contract_address, set_caller_address}, + testing::{ + set_block_timestamp, set_account_contract_address, set_caller_address, set_contract_address + }, }; @@ -74,46 +75,18 @@ fn test_paint_interaction() { paint_actions .interact( DefaultParameters { - for_player: ZERO_ADDRESS(), // Leave this 0 if not processing the Queue - for_system: ZERO_ADDRESS(), // Leave this 0 if not processing the Queue + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, position: TEST_POSITION, color: RED_COLOR } ); } -#[test] -fn test_update_permission() { - let (world, core_actions, player_1, _player_2) = setup_core_initialized(); - - let permissioning_system = contract_address_const::<0xBEEF01>(); - let permissioned_system = contract_address_const::<0xDEAD01>(); - - set_caller(player_1); - - // Setup PermissioningApp - let permissioning: App = core_actions.new_app(permissioning_system, 'permissioning', ''); - - // Setup PermissionedApp - let permissioned: App = core_actions.new_app(permissioned_system, 'permissioned', ''); - - // Check that existing permissions are NONE - let current_permissions = get!(world, (permissioning.system, permissioned.system), Permissions); - assert(current_permissions.permission == PERMISSION_NONE, 'permissions not none'); - - // Update the permissions, as caller - set_caller(permissioning.system); - core_actions.update_permission(permissioned.name, PERMISSION_ALL); - - // Check that existing permissions are ALL - let new_permissions = get!(world, (permissioning.system, permissioned.system), Permissions); - - assert(new_permissions.permission == PERMISSION_ALL, 'permissions not all'); -} - #[test] -fn test_has_write_access() { +fn test_can_update_pixel() { let (world, core_actions, player_1, player_2) = setup_core_initialized(); let (paint_actions, _snake_actions) = setup_apps_initialized(world); @@ -127,7 +100,11 @@ fn test_has_write_access() { paint_actions .put_color( DefaultParameters { - for_player: ZERO_ADDRESS(), for_system: ZERO_ADDRESS(), position, color + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, + position, + color } ); @@ -147,14 +124,16 @@ fn test_has_write_access() { let pixel = get!(world, (position.x, position.y), Pixel); let has_access = core_actions - .has_write_access(ZERO_ADDRESS(), ZERO_ADDRESS(), pixel, pixel_update); + .can_update_pixel(player_2, ZERO_ADDRESS(), pixel, pixel_update, Option::None, false) + .is_ok(); assert(has_access == false, 'should not have access'); set_caller(player_1); let has_access = core_actions - .has_write_access(ZERO_ADDRESS(), ZERO_ADDRESS(), pixel, pixel_update); + .can_update_pixel(player_1, ZERO_ADDRESS(), pixel, pixel_update, Option::None, false) + .is_ok(); assert(has_access == true, 'should have access'); } @@ -207,7 +186,8 @@ fn test_update_pixel() { assert(pixel == empty_pixel, 'pixel not empty'); - core_actions.update_pixel(ZERO_ADDRESS(), ZERO_ADDRESS(), pixel_update); + let _ = core_actions + .update_pixel(ZERO_ADDRESS(), ZERO_ADDRESS(), pixel_update, Option::None, false); let pixel = get!(world, (x, y), Pixel); @@ -218,36 +198,62 @@ fn test_update_pixel() { assert(pixel == changed_pixel, 'pixel was not changed'); } - #[test] -fn test_get_player_address() { - let (_world, core_actions, player_1, player_2) = setup_core_initialized(); +#[should_panic(expected: 'only core can override')] +fn test_get_callers_non_core() { + let (world, _core_actions, _player_1, player_2) = setup_core_initialized(); + let system_override = starknet::contract_address_const::<0x69>(); + + // Don't fake the calling contract, so this call fails + + let has_override = DefaultParameters { + player_override: Option::Some(player_2), + system_override: Option::Some(system_override), + area_hint: Option::None, + position: Position { x: 1, y: 1 }, + color: 0 + }; + let (_player, _system) = get_callers(world, has_override); +} - // Test with 0 address, we expect the caller - set_account_contract_address(player_1); +#[test] +fn test_get_callers() { + let (world, core_actions, player_1, player_2) = setup_core_initialized(); - let addr = core_actions.get_player_address(ZERO_ADDRESS()); - assert(addr == player_1, 'should return player1'); + let system_override = starknet::contract_address_const::<0x69>(); - let addr = core_actions.get_player_address(player_2); - assert(addr == player_2, 'should return player2'); -} + let no_override = DefaultParameters { + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, + position: Position { x: 1, y: 1 }, + color: 0 + }; + let has_override = DefaultParameters { + player_override: Option::Some(player_2), + system_override: Option::Some(system_override), + area_hint: Option::None, + position: Position { x: 1, y: 1 }, + color: 0 + }; -#[test] -fn test_get_system_address() { - let (world, core_actions, _player_1, _player_2) = setup_core_initialized(); - let (paint_actions, snake_actions) = setup_apps_initialized(world); + // Test with 0 address, we expect the caller + set_account_contract_address(player_1); - set_caller(paint_actions.contract_address); + let (player, system) = get_callers(world, no_override); + assert(player == player_1, 'should return player1'); + assert(system == ZERO_ADDRESS(), 'should return zero'); - let addr = core_actions.get_system_address(ZERO_ADDRESS()); - assert(addr == paint_actions.contract_address, 'should return paint_contract'); + // impersonate core_actions so the override is allowed + set_contract_address(core_actions.contract_address); - let addr = core_actions.get_system_address(snake_actions.contract_address); - assert(addr == snake_actions.contract_address, 'should return snake_contract'); + let (player, system) = get_callers(world, has_override); + assert(player == player_2, 'should return player_2'); + assert(system == system_override, 'should return system_override'); } + // TODO Try alerting with a nonexisting appkey (should panic) #[test] @@ -273,15 +279,10 @@ fn test_alert_player() { assert_eq!( starknet::testing::pop_log(world.contract_address), Option::Some( - pixelaw::core::actions::actions::Alert { + pixelaw::core::events::Alert { position, caller, player, message, timestamp: get_block_timestamp() } ) ); } -fn test_set_instruction(world: IWorldDispatcher, player: ContractAddress, instruction: felt252) { - // Implementation for setting an instruction for the player - println!("Setting instruction for player {:?}: {}", player, instruction); -} - diff --git a/contracts/src/core/tests/helpers.cairo b/contracts/src/core/tests/helpers.cairo index 8dfb246..64c255a 100644 --- a/contracts/src/core/tests/helpers.cairo +++ b/contracts/src/core/tests/helpers.cairo @@ -5,17 +5,6 @@ use dojo::{ world::{IWorldDispatcher, IWorldDispatcherTrait} }; -use pixelaw::core::{ - models::{ - registry::{ - App, app, app_name, core_actions_address, CoreActionsAddress, Instruction, instruction - }, - pixel::{Pixel, PixelUpdate, pixel}, permissions::{permissions, Permission, Permissions} - }, - actions::{actions, IActionsDispatcher, IActionsDispatcherTrait, CORE_ACTIONS_KEY}, - utils::{get_core_actions, Direction, Position, DefaultParameters} -}; - use pixelaw::{ apps::{ paint::app::{paint_actions, IPaintActionsDispatcher, IPaintActionsDispatcherTrait}, @@ -23,8 +12,18 @@ use pixelaw::{ snake, Snake, snake_segment, SnakeSegment, snake_actions, ISnakeActionsDispatcher, ISnakeActionsDispatcherTrait } + }, + core::{ + models::{ + registry::{App, app, app_name, core_actions_address, CoreActionsAddress}, + pixel::{Pixel, PixelUpdate, pixel}, area::{r_tree, RTree, area, Area} + }, + actions::{actions, IActionsDispatcher, IActionsDispatcherTrait, CORE_ACTIONS_KEY}, + utils::{get_core_actions, Direction, Position, DefaultParameters}, } }; + + use starknet::{ get_block_timestamp, contract_address_const, ClassHash, ContractAddress, testing::{set_block_timestamp, set_account_contract_address}, @@ -36,15 +35,6 @@ pub const WHITE_COLOR: u32 = 0xFFFFFFFF; pub const RED_COLOR: u32 = 0xFF0000FF; -pub const PERMISSION_ALL: Permission = - Permission { app: true, color: true, owner: true, text: true, timestamp: true, action: true }; - -pub const PERMISSION_NONE: Permission = - Permission { - app: false, color: false, owner: false, text: false, timestamp: false, action: false - }; - - pub fn set_caller(caller: ContractAddress) { starknet::testing::set_account_contract_address(caller); starknet::testing::set_contract_address(caller); @@ -70,8 +60,8 @@ pub fn setup_core() -> (IWorldDispatcher, IActionsDispatcher, ContractAddress, C app::TEST_CLASS_HASH, app_name::TEST_CLASS_HASH, core_actions_address::TEST_CLASS_HASH, - permissions::TEST_CLASS_HASH, - instruction::TEST_CLASS_HASH, + r_tree::TEST_CLASS_HASH, + area::TEST_CLASS_HASH ]; let world = spawn_test_world(["pixelaw"].span(), models.span()); @@ -84,8 +74,8 @@ pub fn setup_core() -> (IWorldDispatcher, IActionsDispatcher, ContractAddress, C world.grant_writer(selector_from_tag!("pixelaw-AppName"), core_actions_address); world.grant_writer(selector_from_tag!("pixelaw-CoreActionsAddress"), core_actions_address); world.grant_writer(selector_from_tag!("pixelaw-Pixel"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-Permissions"), core_actions_address); - world.grant_writer(selector_from_tag!("pixelaw-Instruction"), core_actions_address); + world.grant_writer(selector_from_tag!("pixelaw-RTree"), core_actions_address); + world.grant_writer(selector_from_tag!("pixelaw-Area"), core_actions_address); // Setup players let player_1 = contract_address_const::<0x1337>(); @@ -124,6 +114,9 @@ pub fn setup_apps(world: IWorldDispatcher) -> (IPaintActionsDispatcher, ISnakeAc world.grant_writer(selector_from_tag!("pixelaw-Snake"), core_address.value); world.grant_writer(selector_from_tag!("pixelaw-SnakeSegment"), core_address.value); + world.grant_writer(selector_from_tag!("pixelaw-Snake"), snake_actions_address); + world.grant_writer(selector_from_tag!("pixelaw-SnakeSegment"), snake_actions_address); + (paint_actions, snake_actions) } diff --git a/contracts/src/core/tests/interop.cairo b/contracts/src/core/tests/interop.cairo index 8b13789..0880870 100644 --- a/contracts/src/core/tests/interop.cairo +++ b/contracts/src/core/tests/interop.cairo @@ -1 +1,82 @@ +use core::fmt::Display; +use core::{traits::TryInto, poseidon::poseidon_hash_span}; + +use dojo::{ + utils::test::{spawn_test_world, deploy_contract}, + world::{IWorldDispatcher, IWorldDispatcherTrait} +}; +use pixelaw::core::utils::{MAX_DIMENSION}; + +use pixelaw::core::{ + models::{ + registry::{App, AppName, app, app_name, core_actions_address, CoreActionsAddress}, + pixel::{Pixel, PixelUpdate, pixel}, + area::{ + Area, ROOT_ID, FIRST_RTREENODE, ROOT_RTREENODE_EMPTY, ROOT_RTREENODE, RTreeNode, + RTreeNodePackableImpl, ChildrenPackableImpl + } + }, + actions::{actions, IActionsDispatcher, IActionsDispatcherTrait, CORE_ACTIONS_KEY}, + utils::{Bounds, get_core_actions, Direction, Position, DefaultParameters}, + tests::helpers::{ + setup_core, setup_core_initialized, setup_apps, setup_apps_initialized, ZERO_ADDRESS, + set_caller, drop_all_events, TEST_POSITION, WHITE_COLOR, RED_COLOR, + } +}; + +use pixelaw::{ + apps::{ + paint::app::{ + paint_actions, IPaintActionsDispatcher, IPaintActionsDispatcherTrait, + APP_KEY as PAINT_APP_KEY + }, + snake::app::{ + snake, Snake, snake_segment, SnakeSegment, snake_actions, ISnakeActionsDispatcher, + ISnakeActionsDispatcherTrait, APP_KEY as SNAKE_APP_KEY + } + } +}; +use starknet::{ + get_block_timestamp, contract_address_const, ClassHash, ContractAddress, + testing::{set_block_timestamp, set_account_contract_address, set_caller_address}, +}; + +#[test] +fn test_app_permissions() { + let (world, _core_actions, player_1, _player_2) = setup_core_initialized(); + let (_paint_actions, _snake_actions) = setup_apps_initialized(world); + set_caller(player_1); +} + +#[test] +fn test_hooks() { + let (world, _core_actions, player_1, _player_2) = setup_core_initialized(); + let (paint_actions, _snake_actions) = setup_apps_initialized(world); + + set_caller(player_1); + + // Paint has hooks, Snake does not?? + // TODO more testing + paint_actions + .interact( + DefaultParameters { + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, + position: Position { x: 123, y: 321 }, + color: 0xFF00FFFF + }, + ); + + paint_actions + .interact( + DefaultParameters { + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, + position: Position { x: 123, y: 321 }, + color: 0xAF00FFFF + }, + ); +} diff --git a/contracts/src/core/tests/pixel_area.cairo b/contracts/src/core/tests/pixel_area.cairo new file mode 100644 index 0000000..21ae78d --- /dev/null +++ b/contracts/src/core/tests/pixel_area.cairo @@ -0,0 +1,102 @@ +use core::fmt::Display; + +use core::{traits::TryInto, poseidon::poseidon_hash_span}; + +use dojo::{ + utils::test::{spawn_test_world, deploy_contract}, + world::{IWorldDispatcher, IWorldDispatcherTrait} +}; +use pixelaw::core::utils::{MAX_DIMENSION}; + +use pixelaw::core::{ + models::{ + registry::{App, AppName, app, app_name, core_actions_address, CoreActionsAddress}, + pixel::{Pixel, PixelUpdate, PixelUpdateResult, PixelUpdateResultTrait, pixel}, + area::{ + Area, ROOT_ID, FIRST_RTREENODE, ROOT_RTREENODE_EMPTY, ROOT_RTREENODE, RTreeNode, + RTreeNodePackableImpl, ChildrenPackableImpl + } + }, + actions::{actions, IActionsDispatcher, IActionsDispatcherTrait, CORE_ACTIONS_KEY}, + utils::{Bounds, get_core_actions, Direction, Position, DefaultParameters}, + tests::helpers::{ + setup_core, setup_core_initialized, setup_apps, setup_apps_initialized, ZERO_ADDRESS, + set_caller, drop_all_events, TEST_POSITION, WHITE_COLOR, RED_COLOR, + } +}; + +use pixelaw::{ + apps::{ + paint::app::{ + paint_actions, IPaintActionsDispatcher, IPaintActionsDispatcherTrait, + APP_KEY as PAINT_APP_KEY + }, + snake::app::{ + snake, Snake, snake_segment, SnakeSegment, snake_actions, ISnakeActionsDispatcher, + ISnakeActionsDispatcherTrait, APP_KEY as SNAKE_APP_KEY + } + } +}; +use starknet::{ + get_block_timestamp, contract_address_const, ClassHash, ContractAddress, + testing::{set_block_timestamp, set_account_contract_address, set_caller_address}, +}; +const BOUNDS_1: Bounds = Bounds { x_min: 0, y_min: 0, x_max: 1000, y_max: 1000 }; +const POSITION_1: Position = Position { x: 1, y: 1 }; + +#[test] +#[should_panic(expected: ('position overflow', 'ENTRYPOINT_FAILED'))] +fn test_pixel_with_invalid_position() { + let (_world, core_actions, player_1, _player_2) = setup_core_initialized(); + + // Setup PixelUpdate with x/y that are u16, but not u15 + let pixel_update = PixelUpdate { + x: MAX_DIMENSION + 2, + y: MAX_DIMENSION + 3, + color: Option::Some(0xFF00FFFF), + owner: Option::Some(player_1), + app: Option::None, + text: Option::None, + timestamp: Option::None, + action: Option::None + }; + let _ = core_actions + .update_pixel(ZERO_ADDRESS(), ZERO_ADDRESS(), pixel_update, Option::None, false); +} + +#[test] +fn test_add_new_pixel_in_owned_area() { + let (world, core_actions, player_1, player_2) = setup_core_initialized(); + + set_caller(player_1); + + let _a1: Area = core_actions + .add_area( + Bounds { x_min: 0, y_min: 0, x_max: 1000, y_max: 1000 }, + player_1, + WHITE_COLOR, + ZERO_ADDRESS() + ); + + set_caller(player_2); + + let pixel = get!(world, (POSITION_1.x, POSITION_1.y), Pixel); + + // Setup PixelUpdate + let pixel_update = PixelUpdate { + x: pixel.x, + y: pixel.y, + color: Option::Some(0xFF00FFFF), + owner: Option::Some(player_2), + app: Option::None, + text: Option::None, + timestamp: Option::None, + action: Option::None + }; + + let has_access = core_actions + .can_update_pixel(player_2, ZERO_ADDRESS(), pixel, pixel_update, Option::None, false) + .is_ok(); + + assert(has_access == false, 'should not have access'); +} diff --git a/contracts/src/core/tests/queue.cairo b/contracts/src/core/tests/queue.cairo index 7a0a5a6..c501d51 100644 --- a/contracts/src/core/tests/queue.cairo +++ b/contracts/src/core/tests/queue.cairo @@ -5,21 +5,24 @@ use dojo::{ world::{IWorldDispatcher, IWorldDispatcherTrait} }; +use pixelaw::apps::snake::app::{ + snake_actions, snake, snake_segment, ISnakeActionsDispatcher, ISnakeActionsDispatcherTrait +}; + use pixelaw::core::{ - models::{ - registry::{app, app_name, core_actions_address}, pixel::{Pixel, PixelUpdate, pixel}, - permissions::{permissions} - }, + events::{QueueScheduled, QueueProcessed}, + models::{registry::{app, app_name, core_actions_address}, pixel::{Pixel, PixelUpdate, pixel},}, actions::{actions, IActionsDispatcher, IActionsDispatcherTrait}, - utils::{get_core_actions, Direction, Position, DefaultParameters}, - tests::helpers::setup_core_initialized + utils::{get_core_actions, Direction, Position, DefaultParameters, SNAKE_MOVE_ENTRYPOINT}, + tests::helpers::{ + setup_core, setup_core_initialized, setup_apps, setup_apps_initialized, ZERO_ADDRESS, + set_caller, drop_all_events, TEST_POSITION, WHITE_COLOR, RED_COLOR, + } }; use starknet::{ get_block_timestamp, contract_address_const, ClassHash, ContractAddress, testing::{set_block_timestamp, set_account_contract_address}, }; - - const SPAWN_PIXEL_ENTRYPOINT: felt252 = 0x01c199924ae2ed5de296007a1ac8aa672140ef2a973769e4ad1089829f77875a; @@ -58,3 +61,88 @@ fn test_process_queue() { assert(pixel.x == position.x, 'incorrect timestamp.x'); assert(pixel.y == position.y, 'incorrect timestamp.y'); } + + +#[test] +fn test_queue_full() { + let (world, core_actions, player_1, _player_2) = setup_core_initialized(); + let (_, snake_actions) = setup_apps_initialized(world); + + let SNAKE_COLOR = 0xFF00FF; + + set_caller(player_1); + let position = Position { x: 234, y: 432 }; + + // let event_contract = snake_actions.contract_address; + // let event_contract = core_actions.contract_address; + let event_contract = world.contract_address; + + // Pop all the previous events from the log so only the following one will be there + drop_all_events(event_contract); + + let timestamp = 1729297000; + set_block_timestamp(timestamp); + + snake_actions + .interact( + DefaultParameters { + player_override: Option::None, + system_override: Option::None, + area_hint: Option::None, + position, + color: SNAKE_COLOR + }, + Direction::Right + ); + + // Pop the 3 previous events we're not handling right now + let _ = starknet::testing::pop_log_raw(event_contract); // Store Snake model + let _ = starknet::testing::pop_log_raw(event_contract); // Store Segment model + let _ = starknet::testing::pop_log_raw(event_contract); // Store Pixel model + + // Prep the expected event struct + let called_system = snake_actions.contract_address; + let selector = SNAKE_MOVE_ENTRYPOINT; + let calldata: Span = array![player_1.into()].span(); + let id = poseidon_hash_span( + array![timestamp.into(), called_system.into(), selector, poseidon_hash_span(calldata)] + .span() + ); + let expected_scheduled_event = QueueScheduled { + id, timestamp, called_system, selector, calldata + }; + + assert( + starknet::testing::pop_log(event_contract) == Option::Some(expected_scheduled_event), + 'unexpected QueueScheduled' + ); + + // Pop all the previous events from the log so only the following one will be there + drop_all_events(event_contract); + core_actions.process_queue(id, timestamp, called_system, selector, calldata); + + let _log_0 = starknet::testing::pop_log_raw(event_contract); // store existing segment + let _log_1 = starknet::testing::pop_log_raw(event_contract); // store new segment + let _log_2 = starknet::testing::pop_log_raw(event_contract); // Store Pixel model new segment + let _log_3 = starknet::testing::pop_log_raw(event_contract); // Store Pixel model new segment + let _log_4 = starknet::testing::pop_log_raw(event_contract); // ? + let _log_5 = starknet::testing::pop_log_raw(event_contract); // store pixel + let _log_6 = starknet::testing::pop_log_raw(event_contract); // delete segment? + // let _log_7 = starknet::testing::pop_log_raw(event_contract); // processed + + let expected_processed_event = QueueProcessed { id }; + assert( + starknet::testing::pop_log(event_contract) == Option::Some(expected_processed_event), + 'unexpected QueueProcessed' + ); + // println!("log0 {:?}", starknet::testing::pop_log_raw(event_contract)); +// println!("log1 {:?}", starknet::testing::pop_log_raw(event_contract)); +// println!("log2 {:?}", starknet::testing::pop_log_raw(event_contract)); +// println!("log3 {:?}", starknet::testing::pop_log_raw(event_contract)); +// println!("log4 {:?}", starknet::testing::pop_log_raw(event_contract)); +// println!("log5 {:?}", starknet::testing::pop_log_raw(event_contract)); +// println!("log6 {:?}", starknet::testing::pop_log_raw(event_contract)); +// println!("log7 {:?}", starknet::testing::pop_log_raw(event_contract)); + +} + diff --git a/contracts/src/core/traits.cairo b/contracts/src/core/traits.cairo deleted file mode 100644 index 2437ab5..0000000 --- a/contracts/src/core/traits.cairo +++ /dev/null @@ -1,20 +0,0 @@ -use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; -use pixelaw::core::models::pixel::PixelUpdate; -use pixelaw::core::models::registry::App; -use starknet::ContractAddress; - -#[dojo::interface] -pub trait IInteroperability { - fn on_pre_update( - ref world: IWorldDispatcher, - pixel_update: PixelUpdate, - app_caller: App, - player_caller: ContractAddress - ); - fn on_post_update( - ref world: IWorldDispatcher, - pixel_update: PixelUpdate, - app_caller: App, - player_caller: ContractAddress - ); -} diff --git a/contracts/src/core/utils.cairo b/contracts/src/core/utils.cairo index 46c58c2..0387634 100644 --- a/contracts/src/core/utils.cairo +++ b/contracts/src/core/utils.cairo @@ -1,11 +1,56 @@ use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; use pixelaw::core::actions::{IActionsDispatcher, IActionsDispatcherTrait, CORE_ACTIONS_KEY}; -use pixelaw::core::models::pixel::{Pixel}; use pixelaw::core::models::registry::{App, AppName, CoreActionsAddress}; -use starknet::{ContractAddress, get_caller_address, ClassHash, get_contract_address}; +use pixelaw::core::models::{ + pixel::{Pixel}, + { + area::{ + RTreeNode, RTree, Area, RTreeTraitImpl, RTreeNodePackableImpl, ChildrenPackableImpl, + BoundsTraitImpl, ROOT_RTREENODE, ROOT_ID + } + } +}; +use starknet::{ + ContractAddress, contract_address_const, get_tx_info, get_caller_address, ClassHash, + get_contract_address +}; +use super::models::area::Packable; +use super::models::area::RTreeTrait; + +pub const POW_2_96: u128 = 0x1000000000000000000000000_u128; +pub const POW_2_64: u128 = 0x10000000000000000_u128; +pub const POW_2_48: u128 = 0x1000000000000_u128; +pub const POW_2_32: u128 = 0x100000000_u128; +pub const POW_2_31: u128 = 0x80000000_u128; +pub const POW_2_30: u128 = 0x40000000_u128; +pub const POW_2_16: u128 = 0x10000_u128; +pub const POW_2_15: u128 = 0x8000_u128; + +pub const MASK_96: u128 = 0xFFFFFFFFFFFFFFFFFFFFFFFF; +pub const MASK_64: u128 = 0xFFFFFFFFFFFFFFFF; +pub const MASK_32: u128 = 0xFFFFFFFF; +pub const MASK_16: u128 = 0xFFFF; + +pub const MAX_DIMENSION: u16 = 32767; // 2**15 -1 (so all bits utilized) +const U32_MAX: u32 = 0xFFFFFFFF; + +pub const ON_PRE_UPDATE_HOOK: felt252 = + 0x3aaf17d2bb02c9d23c8c0c465fb64d421430b1a9e838ada90d7ca34b766efbb; + +pub const ON_POST_UPDATE_HOOK: felt252 = + 0x3484ad2e032768c324059cc216083c643765f60c00f2b9b0561bc98ceb1c92; + +pub const SNAKE_MOVE_ENTRYPOINT: felt252 = + 0x239e4c8fbd11b680d7214cfc26d1780d5c099453f0832beb15fd040aebd4ebb; -#[derive(Serde, Copy, Drop, Introspect)] +pub const INTERACT_SELECTOR: felt252 = + 0x476d5e1b17fd9d508bd621909241c5eb4c67380f3651f54873c5c1f2b891f4; + +pub const MOVE_SELECTOR: felt252 = + 0x239e4c8fbd11b680d7214cfc26d1780d5c099453f0832beb15fd040aebd4ebb; + +#[derive(Debug, PartialEq, Serde, Copy, Drop, Introspect)] pub enum Direction { None: (), Left: (), @@ -16,15 +61,25 @@ pub enum Direction { #[derive(Debug, Copy, Drop, Serde, Introspect, PartialEq)] pub struct Position { - pub x: u32, - pub y: u32 + pub x: u16, + pub y: u16 +} + + +#[derive(Debug, Copy, Drop, Serde, Introspect, PartialEq)] +pub struct Bounds { + pub x_min: u16, + pub y_min: u16, + pub x_max: u16, + pub y_max: u16 } #[derive(Copy, Drop, Serde)] pub struct DefaultParameters { - pub for_player: ContractAddress, - pub for_system: ContractAddress, + pub player_override: Option, + pub system_override: Option, + pub area_hint: Option, pub position: Position, pub color: u32 } @@ -41,7 +96,6 @@ impl DirectionIntoFelt252 of Into { } } } -const U32_MAX: u32 = 0xFFFFFFFF; /// Computes the starknet keccak to have a hash that fits in one felt. @@ -66,6 +120,32 @@ pub fn starknet_keccak(data: Span) -> felt252 { } +// Returns the current (account and system) callers +// Taking into account overrides from DefaultParams +pub fn get_callers( + world: IWorldDispatcher, params: DefaultParameters +) -> (ContractAddress, ContractAddress) { + let mut player = contract_address_const::<0>(); + let mut system = contract_address_const::<0>(); + + let core_address = get_core_actions_address(world); + let caller_contract = get_contract_address(); + + if let Option::Some(override) = params.player_override { + assert(caller_contract == core_address, 'only core can override'); + player = override; + } else { + player = get_tx_info().unbox().account_contract_address; + } + if let Option::Some(override) = params.system_override { + assert(caller_contract == core_address, 'only core can override'); + system = override; + } else { + system = caller_contract; + } + (player, system) +} + pub fn get_position(direction: Direction, position: Position) -> Position { match direction { Direction::None => { position }, @@ -77,7 +157,7 @@ pub fn get_position(direction: Direction, position: Position) -> Position { } }, Direction::Right => { - if position.x == U32_MAX { + if position.x == 0xFFFF { position } else { Position { x: position.x + 1, y: position.y } @@ -91,7 +171,7 @@ pub fn get_position(direction: Direction, position: Position) -> Position { } }, Direction::Down => { - if position.y == U32_MAX { + if position.y == 0xFFFF { position } else { Position { x: position.x, y: position.y + 1 } @@ -118,50 +198,47 @@ pub fn subu8(nr: u8, sub: u8) -> u8 { } } - // RGBA // 0xFF FF FF FF // empty: 0x 00 00 00 00 // normal color (opaque): 0x FF FF FF FF -pub fn encode_color(r: u8, g: u8, b: u8, a: u8) -> u32 { + +pub fn encode_rgba(r: u8, g: u8, b: u8, a: u8) -> u32 { (r.into() * 0x1000000) + (g.into() * 0x10000) + (b.into() * 0x100) + a.into() } -pub fn decode_color(color: u32) -> (u8, u8, u8, u8) { - let r: u32 = (color / 0x1000000); - let g: u32 = (color / 0x10000) & 0xff; - let b: u32 = (color / 0x100) & 0xff; - let a: u32 = color & 0xff; - - let r: Option = r.try_into(); - let g: Option = g.try_into(); - let b: Option = b.try_into(); - let a: Option = a.try_into(); - - let r: u8 = match r { - Option::Some(r) => r, - Option::None => 0 - }; - - let g: u8 = match g { - Option::Some(g) => g, - Option::None => 0, - }; - - let b: u8 = match b { - Option::Some(b) => b, - Option::None => 0, - }; - - let a: u8 = match a { - Option::Some(a) => a, - Option::None => 0xFF, - }; - - (r, g, b, a) +pub fn decode_rgba(self: u32) -> (u8, u8, u8, u8) { + let r: u32 = (self / 0x1000000); + let g: u32 = (self / 0x10000) & 0xff; + let b: u32 = (self / 0x100) & 0xff; + let a: u32 = self & 0xff; + + ( + r.try_into().unwrap_or(0), + g.try_into().unwrap_or(0), + b.try_into().unwrap_or(0), + a.try_into().unwrap_or(0xFF) + ) } + pub fn is_pixel_color(world: IWorldDispatcher, position: Position, color: u32) -> bool { let pixel: Pixel = get!(world, (position.x, position.y), (Pixel)); pixel.color == color } + +pub fn min, +Copy, +Drop>(a: T, b: T) -> T { + if a < b { + a + } else { + b + } +} + +pub fn max, +Copy, +Drop>(a: T, b: T) -> T { + if a > b { + a + } else { + b + } +}