From 4a00bfe53553ea1e632739f78b5b09f5300261d6 Mon Sep 17 00:00:00 2001 From: glihm Date: Tue, 13 Aug 2024 11:56:47 -0400 Subject: [PATCH 1/3] fix: update to 1.0.0-alpha.5 --- Scarb.lock | 8 +- Scarb.toml | 31 +- dojo_dev.toml | 23 ++ manifests/dev/base/abis/dojo-world.json | 234 +++++++------- .../dojo_starter-actions-7a1c7102.toml | 5 +- manifests/dev/base/dojo-world.toml | 4 +- .../models/dojo_starter-Moves-2a29373f.toml | 4 +- manifests/dev/deployment/abis/dojo-world.json | 272 +++++++++------- manifests/dev/deployment/manifest.json | 291 ++++++++++-------- manifests/dev/deployment/manifest.toml | 19 +- 10 files changed, 486 insertions(+), 405 deletions(-) create mode 100644 dojo_dev.toml diff --git a/Scarb.lock b/Scarb.lock index bc6c6c4..adf9119 100644 --- a/Scarb.lock +++ b/Scarb.lock @@ -3,16 +3,16 @@ version = 1 [[package]] name = "dojo" -version = "0.7.3" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.4#d08c46191fc1b4c4f90816cef4787cb8db02988f" +version = "1.0.0-alpha.4" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.5#6878242e120d3135d3bc1bb94135d7135693069b" dependencies = [ "dojo_plugin", ] [[package]] name = "dojo_plugin" -version = "0.7.3" -source = "git+https://github.com/dojoengine/dojo?rev=71b1f1a4#71b1f1a467534cbeeb901356f41e612ed4187bd1" +version = "1.0.0-alpha.4" +source = "git+https://github.com/dojoengine/dojo?rev=f15def33#f15def330c0d099e79351d11c197f63e8cc1ff36" [[package]] name = "dojo_starter" diff --git a/Scarb.toml b/Scarb.toml index 7d26952..e0801ad 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -1,5 +1,5 @@ [package] -cairo-version = "=2.7.0-rc.3" +cairo-version = "=2.7.0" name = "dojo_starter" version = "0.1.0" @@ -12,33 +12,6 @@ spawn = "./scripts/spawn.sh" move = "./scripts/move.sh" [dependencies] -dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.4" } +dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.5" } [[target.dojo]] - -[tool.dojo] -initializer_class_hash = "0xbeef" - -[tool.dojo.env] -rpc_url = "http://localhost:5050/" -# Default account for katana with seed = 0 -account_address = "0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca" -private_key = "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a" -# world_address = "0x3fc79ccfd72c1450d2ccb73c5c521a7ec68b6c6af0caf96a0f1c39ce58876c8" # Uncomment and update this line with your world address. - -[tool.dojo.world] -name = "Dojo starter" -description = "The official Dojo Starter guide, the quickest and most streamlined way to get your Dojo Autonomous World up and running. This guide will assist you with the initial setup, from cloning the repository to deploying your world." -cover_uri = "file://assets/cover.png" -icon_uri = "file://assets/icon.png" -website = "https://github.com/dojoengine/dojo-starter" -seed = "dojo_starter" - -[tool.dojo.world.namespace] -default = "dojo_starter" - -[tool.dojo.world.socials] -x = "https://x.com/ohayo_dojo" -discord = "https://discord.gg/FB2wR6uF" -github = "https://github.com/dojoengine/dojo-starter" -telegram = "https://t.me/dojoengine" diff --git a/dojo_dev.toml b/dojo_dev.toml new file mode 100644 index 0000000..cf6c928 --- /dev/null +++ b/dojo_dev.toml @@ -0,0 +1,23 @@ +[world] +name = "Dojo starter" +description = "The official Dojo Starter guide, the quickest and most streamlined way to get your Dojo Autonomous World up and running. This guide will assist you with the initial setup, from cloning the repository to deploying your world." +cover_uri = "file://assets/cover.png" +icon_uri = "file://assets/icon.png" +website = "https://github.com/dojoengine/dojo-starter" +seed = "dojo_starter" + +[world.socials] +x = "https://x.com/ohayo_dojo" +discord = "https://discord.gg/FB2wR6uF" +github = "https://github.com/dojoengine/dojo-starter" +telegram = "https://t.me/dojoengine" + +[namespace] +default = "dojo_starter" + +[env] +rpc_url = "http://localhost:5050/" +# Default account for katana with seed = 0 +account_address = "0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca" +private_key = "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a" +# world_address = "0x3fc79ccfd72c1450d2ccb73c5c521a7ec68b6c6af0caf96a0f1c39ce58876c8" # Uncomment and update this line with your world address. diff --git a/manifests/dev/base/abis/dojo-world.json b/manifests/dev/base/abis/dojo-world.json index 62ff4b6..897b4d9 100644 --- a/manifests/dev/base/abis/dojo-world.json +++ b/manifests/dev/base/abis/dojo-world.json @@ -138,6 +138,32 @@ } ] }, + { + "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", @@ -161,7 +187,7 @@ "name": "metadata", "inputs": [ { - "name": "resource_id", + "name": "resource_selector", "type": "core::felt252" } ], @@ -186,35 +212,15 @@ }, { "type": "function", - "name": "model", - "inputs": [ - { - "name": "selector", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "contract", + "name": "register_namespace", "inputs": [ { - "name": "selector", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + "name": "namespace", + "type": "core::byte_array::ByteArray" } ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" }, { "type": "function", @@ -230,11 +236,11 @@ }, { "type": "function", - "name": "register_namespace", + "name": "upgrade_model", "inputs": [ { - "name": "namespace", - "type": "core::byte_array::ByteArray" + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" } ], "outputs": [], @@ -251,10 +257,6 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "init_calldata", - "type": "core::array::Span::" } ], "outputs": [ @@ -284,6 +286,22 @@ ], "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", @@ -390,6 +408,22 @@ ], "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", @@ -493,86 +527,6 @@ ], "outputs": [], "state_mutability": "external" - }, - { - "type": "function", - "name": "can_write_resource", - "inputs": [ - { - "name": "resource_id", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "can_write_model", - "inputs": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "can_write_contract", - "inputs": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "can_write_namespace", - "inputs": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" } ] }, @@ -848,6 +802,23 @@ } ] }, + { + "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", @@ -898,6 +869,33 @@ "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", @@ -1153,6 +1151,11 @@ "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", @@ -1173,6 +1176,11 @@ "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", diff --git a/manifests/dev/base/contracts/dojo_starter-actions-7a1c7102.toml b/manifests/dev/base/contracts/dojo_starter-actions-7a1c7102.toml index 3233498..3886828 100644 --- a/manifests/dev/base/contracts/dojo_starter-actions-7a1c7102.toml +++ b/manifests/dev/base/contracts/dojo_starter-actions-7a1c7102.toml @@ -1,11 +1,10 @@ kind = "DojoContract" -class_hash = "0x417cbd6fb05fb73eef19c2eefffeb9897007add48b949f0c7ce234566cb8604" -original_class_hash = "0x417cbd6fb05fb73eef19c2eefffeb9897007add48b949f0c7ce234566cb8604" +class_hash = "0x6cab0993661f567fb76937e42860f7767d66b7b5d32f6b1240387bb7161dbfc" +original_class_hash = "0x6cab0993661f567fb76937e42860f7767d66b7b5d32f6b1240387bb7161dbfc" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_starter-actions-7a1c7102.json" reads = [] writes = [] -computed = [] init_calldata = [] tag = "dojo_starter-actions" manifest_name = "dojo_starter-actions-7a1c7102" diff --git a/manifests/dev/base/dojo-world.toml b/manifests/dev/base/dojo-world.toml index 59d4719..5a8ae57 100644 --- a/manifests/dev/base/dojo-world.toml +++ b/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x2178527e9556d1aa21d3c2961d28f9114fcfed81b4c3674ed591c50ce46cc9d" -original_class_hash = "0x2178527e9556d1aa21d3c2961d28f9114fcfed81b4c3674ed591c50ce46cc9d" +class_hash = "0x76ced5a15cb43c7be7176cff4779cd57c56638a46ddf2c9da709d22298c5e5a" +original_class_hash = "0x76ced5a15cb43c7be7176cff4779cd57c56638a46ddf2c9da709d22298c5e5a" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/manifests/dev/base/models/dojo_starter-Moves-2a29373f.toml b/manifests/dev/base/models/dojo_starter-Moves-2a29373f.toml index be89206..320c1e7 100644 --- a/manifests/dev/base/models/dojo_starter-Moves-2a29373f.toml +++ b/manifests/dev/base/models/dojo_starter-Moves-2a29373f.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x44a126682e03558cadba7e42eddc836f2c72db906953a7f10706b8eaf5501e7" -original_class_hash = "0x44a126682e03558cadba7e42eddc836f2c72db906953a7f10706b8eaf5501e7" +class_hash = "0x55b543e138538f5f6e0af9d5b190e83ec47efbddbc26236ca915ca40a6ffb4d" +original_class_hash = "0x55b543e138538f5f6e0af9d5b190e83ec47efbddbc26236ca915ca40a6ffb4d" abi = "manifests/dev/base/abis/models/dojo_starter-Moves-2a29373f.json" tag = "dojo_starter-Moves" manifest_name = "dojo_starter-Moves-2a29373f" diff --git a/manifests/dev/deployment/abis/dojo-world.json b/manifests/dev/deployment/abis/dojo-world.json index 5620aa6..897b4d9 100644 --- a/manifests/dev/deployment/abis/dojo-world.json +++ b/manifests/dev/deployment/abis/dojo-world.json @@ -138,6 +138,32 @@ } ] }, + { + "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", @@ -161,7 +187,7 @@ "name": "metadata", "inputs": [ { - "name": "resource_id", + "name": "resource_selector", "type": "core::felt252" } ], @@ -186,35 +212,15 @@ }, { "type": "function", - "name": "model", - "inputs": [ - { - "name": "selector", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "contract", + "name": "register_namespace", "inputs": [ { - "name": "selector", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + "name": "namespace", + "type": "core::byte_array::ByteArray" } ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" }, { "type": "function", @@ -230,11 +236,11 @@ }, { "type": "function", - "name": "register_namespace", + "name": "upgrade_model", "inputs": [ { - "name": "namespace", - "type": "core::byte_array::ByteArray" + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" } ], "outputs": [], @@ -251,10 +257,6 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "init_calldata", - "type": "core::array::Span::" } ], "outputs": [ @@ -284,6 +286,22 @@ ], "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", @@ -392,66 +410,30 @@ }, { "type": "function", - "name": "is_owner", + "name": "resource", "inputs": [ { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", + "name": "selector", "type": "core::felt252" } ], "outputs": [ { - "type": "core::bool" + "type": "dojo::world::world_contract::Resource" } ], "state_mutability": "view" }, { "type": "function", - "name": "grant_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "revoke_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "is_writer", + "name": "is_owner", "inputs": [ { "name": "resource", "type": "core::felt252" }, { - "name": "contract", + "name": "address", "type": "core::starknet::contract_address::ContractAddress" } ], @@ -464,14 +446,14 @@ }, { "type": "function", - "name": "grant_writer", + "name": "grant_owner", "inputs": [ { "name": "resource", "type": "core::felt252" }, { - "name": "contract", + "name": "address", "type": "core::starknet::contract_address::ContractAddress" } ], @@ -480,14 +462,14 @@ }, { "type": "function", - "name": "revoke_writer", + "name": "revoke_owner", "inputs": [ { "name": "resource", "type": "core::felt252" }, { - "name": "contract", + "name": "address", "type": "core::starknet::contract_address::ContractAddress" } ], @@ -496,30 +478,10 @@ }, { "type": "function", - "name": "can_write_resource", - "inputs": [ - { - "name": "resource_id", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "can_write_model", + "name": "is_writer", "inputs": [ { - "name": "selector", + "name": "resource", "type": "core::felt252" }, { @@ -536,10 +498,10 @@ }, { "type": "function", - "name": "can_write_contract", + "name": "grant_writer", "inputs": [ { - "name": "selector", + "name": "resource", "type": "core::felt252" }, { @@ -547,19 +509,15 @@ "type": "core::starknet::contract_address::ContractAddress" } ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" }, { "type": "function", - "name": "can_write_namespace", + "name": "revoke_writer", "inputs": [ { - "name": "selector", + "name": "resource", "type": "core::felt252" }, { @@ -567,12 +525,8 @@ "type": "core::starknet::contract_address::ContractAddress" } ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" } ] }, @@ -848,6 +802,23 @@ } ] }, + { + "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", @@ -898,6 +869,33 @@ "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", @@ -975,6 +973,33 @@ } ] }, + { + "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", @@ -1126,6 +1151,11 @@ "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", @@ -1146,6 +1176,11 @@ "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", @@ -1156,6 +1191,11 @@ "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", diff --git a/manifests/dev/deployment/manifest.json b/manifests/dev/deployment/manifest.json index 8a74d62..a145c04 100644 --- a/manifests/dev/deployment/manifest.json +++ b/manifests/dev/deployment/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde", - "original_class_hash": "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde", + "class_hash": "0x76ced5a15cb43c7be7176cff4779cd57c56638a46ddf2c9da709d22298c5e5a", + "original_class_hash": "0x76ced5a15cb43c7be7176cff4779cd57c56638a46ddf2c9da709d22298c5e5a", "abi": [ { "type": "impl", @@ -143,6 +143,32 @@ } ] }, + { + "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", @@ -166,7 +192,7 @@ "name": "metadata", "inputs": [ { - "name": "resource_id", + "name": "resource_selector", "type": "core::felt252" } ], @@ -191,35 +217,15 @@ }, { "type": "function", - "name": "model", - "inputs": [ - { - "name": "selector", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "contract", + "name": "register_namespace", "inputs": [ { - "name": "selector", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + "name": "namespace", + "type": "core::byte_array::ByteArray" } ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" }, { "type": "function", @@ -235,11 +241,11 @@ }, { "type": "function", - "name": "register_namespace", + "name": "upgrade_model", "inputs": [ { - "name": "namespace", - "type": "core::byte_array::ByteArray" + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" } ], "outputs": [], @@ -256,10 +262,6 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "init_calldata", - "type": "core::array::Span::" } ], "outputs": [ @@ -289,6 +291,22 @@ ], "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", @@ -397,66 +415,30 @@ }, { "type": "function", - "name": "is_owner", + "name": "resource", "inputs": [ { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", + "name": "selector", "type": "core::felt252" } ], "outputs": [ { - "type": "core::bool" + "type": "dojo::world::world_contract::Resource" } ], "state_mutability": "view" }, { "type": "function", - "name": "grant_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "revoke_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "is_writer", + "name": "is_owner", "inputs": [ { "name": "resource", "type": "core::felt252" }, { - "name": "contract", + "name": "address", "type": "core::starknet::contract_address::ContractAddress" } ], @@ -469,14 +451,14 @@ }, { "type": "function", - "name": "grant_writer", + "name": "grant_owner", "inputs": [ { "name": "resource", "type": "core::felt252" }, { - "name": "contract", + "name": "address", "type": "core::starknet::contract_address::ContractAddress" } ], @@ -485,14 +467,14 @@ }, { "type": "function", - "name": "revoke_writer", + "name": "revoke_owner", "inputs": [ { "name": "resource", "type": "core::felt252" }, { - "name": "contract", + "name": "address", "type": "core::starknet::contract_address::ContractAddress" } ], @@ -501,30 +483,10 @@ }, { "type": "function", - "name": "can_write_resource", - "inputs": [ - { - "name": "resource_id", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "can_write_model", + "name": "is_writer", "inputs": [ { - "name": "selector", + "name": "resource", "type": "core::felt252" }, { @@ -541,10 +503,10 @@ }, { "type": "function", - "name": "can_write_contract", + "name": "grant_writer", "inputs": [ { - "name": "selector", + "name": "resource", "type": "core::felt252" }, { @@ -552,19 +514,15 @@ "type": "core::starknet::contract_address::ContractAddress" } ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" }, { "type": "function", - "name": "can_write_namespace", + "name": "revoke_writer", "inputs": [ { - "name": "selector", + "name": "resource", "type": "core::felt252" }, { @@ -572,12 +530,8 @@ "type": "core::starknet::contract_address::ContractAddress" } ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" + "outputs": [], + "state_mutability": "external" } ] }, @@ -853,6 +807,23 @@ } ] }, + { + "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", @@ -903,6 +874,33 @@ "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", @@ -980,6 +978,33 @@ } ] }, + { + "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", @@ -1131,6 +1156,11 @@ "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", @@ -1151,6 +1181,11 @@ "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", @@ -1161,6 +1196,11 @@ "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", @@ -1189,8 +1229,8 @@ ] } ], - "address": "0x70835f8344647b1e573fe7aeccbf044230089eb19624d3c7dea4080f5dcb025", - "transaction_hash": "0x51a2a73afb296548a8452242d4075fb51903b78b884ac97dc9d5ea573d0816b", + "address": "0xb4bbca2b3f16a2494491f41737036eecd07152348fd89d1311233fba311adf", + "transaction_hash": "0x10066e5326ff0ea6c067ad85ced2da22440aa39b8e6e7451675a1c5dc8c6473", "block_number": 3, "seed": "dojo_starter", "metadata": { @@ -1210,9 +1250,9 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x5f4c155f43bdc72bcedeb4cc20cac9fe62102a2d86f13b0bd4473066824b69", - "class_hash": "0x58bba620da6e6411af49f295669985f8832c56caae31903e1078e149356115f", - "original_class_hash": "0x58bba620da6e6411af49f295669985f8832c56caae31903e1078e149356115f", + "address": "0x27776c5c29c6b37ef2225d26703bba34b11327c723318c9f7bbd8f5513fe1be", + "class_hash": "0x6cab0993661f567fb76937e42860f7767d66b7b5d32f6b1240387bb7161dbfc", + "original_class_hash": "0x6cab0993661f567fb76937e42860f7767d66b7b5d32f6b1240387bb7161dbfc", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -1482,7 +1522,6 @@ "dojo_starter-Position", "dojo_starter-DirectionsAvailable" ], - "computed": [], "init_calldata": [], "tag": "dojo_starter-actions", "manifest_name": "dojo_starter-actions-7a1c7102" @@ -2417,8 +2456,8 @@ "key": false } ], - "class_hash": "0x44a126682e03558cadba7e42eddc836f2c72db906953a7f10706b8eaf5501e7", - "original_class_hash": "0x44a126682e03558cadba7e42eddc836f2c72db906953a7f10706b8eaf5501e7", + "class_hash": "0x55b543e138538f5f6e0af9d5b190e83ec47efbddbc26236ca915ca40a6ffb4d", + "original_class_hash": "0x55b543e138538f5f6e0af9d5b190e83ec47efbddbc26236ca915ca40a6ffb4d", "abi": [ { "type": "impl", diff --git a/manifests/dev/deployment/manifest.toml b/manifests/dev/deployment/manifest.toml index 61ef074..717e168 100644 --- a/manifests/dev/deployment/manifest.toml +++ b/manifests/dev/deployment/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" -original_class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde" +class_hash = "0x76ced5a15cb43c7be7176cff4779cd57c56638a46ddf2c9da709d22298c5e5a" +original_class_hash = "0x76ced5a15cb43c7be7176cff4779cd57c56638a46ddf2c9da709d22298c5e5a" abi = "manifests/dev/deployment/abis/dojo-world.json" -address = "0x70835f8344647b1e573fe7aeccbf044230089eb19624d3c7dea4080f5dcb025" -transaction_hash = "0x51a2a73afb296548a8452242d4075fb51903b78b884ac97dc9d5ea573d0816b" +address = "0xb4bbca2b3f16a2494491f41737036eecd07152348fd89d1311233fba311adf" +transaction_hash = "0x10066e5326ff0ea6c067ad85ced2da22440aa39b8e6e7451675a1c5dc8c6473" block_number = 3 seed = "dojo_starter" manifest_name = "dojo-world" @@ -23,9 +23,9 @@ manifest_name = "dojo-base" [[contracts]] kind = "DojoContract" -address = "0x5f4c155f43bdc72bcedeb4cc20cac9fe62102a2d86f13b0bd4473066824b69" -class_hash = "0x58bba620da6e6411af49f295669985f8832c56caae31903e1078e149356115f" -original_class_hash = "0x58bba620da6e6411af49f295669985f8832c56caae31903e1078e149356115f" +address = "0x27776c5c29c6b37ef2225d26703bba34b11327c723318c9f7bbd8f5513fe1be" +class_hash = "0x6cab0993661f567fb76937e42860f7767d66b7b5d32f6b1240387bb7161dbfc" +original_class_hash = "0x6cab0993661f567fb76937e42860f7767d66b7b5d32f6b1240387bb7161dbfc" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/dojo_starter-actions-7a1c7102.json" reads = [] @@ -34,7 +34,6 @@ writes = [ "dojo_starter-Position", "dojo_starter-DirectionsAvailable", ] -computed = [] init_calldata = [] tag = "dojo_starter-actions" manifest_name = "dojo_starter-actions-7a1c7102" @@ -77,8 +76,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x44a126682e03558cadba7e42eddc836f2c72db906953a7f10706b8eaf5501e7" -original_class_hash = "0x44a126682e03558cadba7e42eddc836f2c72db906953a7f10706b8eaf5501e7" +class_hash = "0x55b543e138538f5f6e0af9d5b190e83ec47efbddbc26236ca915ca40a6ffb4d" +original_class_hash = "0x55b543e138538f5f6e0af9d5b190e83ec47efbddbc26236ca915ca40a6ffb4d" abi = "manifests/dev/deployment/abis/models/dojo_starter-Moves-2a29373f.json" tag = "dojo_starter-Moves" manifest_name = "dojo_starter-Moves-2a29373f" From 7d83040fd956b41f7bbe034ca64b704a2d28a678 Mon Sep 17 00:00:00 2001 From: glihm Date: Tue, 13 Aug 2024 11:59:02 -0400 Subject: [PATCH 2/3] ci: fix dojo version --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f2c087f..9417f5b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v3 - run: curl -L https://install.dojoengine.org | bash - - run: /home/runner/.config/.dojo/bin/dojoup -v v1.0.0-alpha.4 + - run: /home/runner/.config/.dojo/bin/dojoup -v v1.0.0-alpha.5 - run: | /home/runner/.config/.dojo/bin/sozo build /home/runner/.config/.dojo/bin/sozo test From 00f67864d8595830dca39cfac71f7bab3046a6c5 Mon Sep 17 00:00:00 2001 From: glihm Date: Tue, 13 Aug 2024 12:04:36 -0400 Subject: [PATCH 3/3] fix: ensure test takes new ACL in account --- src/tests/test_world.cairo | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tests/test_world.cairo b/src/tests/test_world.cairo index 7848567..a08d072 100644 --- a/src/tests/test_world.cairo +++ b/src/tests/test_world.cairo @@ -23,8 +23,11 @@ mod tests { // deploy systems contract let contract_address = world - .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap(), array![].span()); + .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap()); let actions_system = IActionsDispatcher { contract_address }; + + world.grant_writer(dojo::utils::bytearray_hash(@"dojo_starter"), contract_address); + // call spawn() actions_system.spawn();