diff --git a/client/src/components/status-bar.tsx b/client/src/components/status-bar.tsx
index 8775311..24b6140 100644
--- a/client/src/components/status-bar.tsx
+++ b/client/src/components/status-bar.tsx
@@ -65,7 +65,20 @@ export function StatusBar() {
return { color: "bg-yellow-500", text: "Loading..." };
};
- // function to open the Controller Profile
+ const getDeploymentType = () => {
+ switch (import.meta.env.VITE_PUBLIC_DEPLOY_TYPE) {
+ case "localhost":
+ return "Localhost";
+ case "mainnet":
+ return "Mainnet";
+ case "sepolia":
+ return "Sepolia";
+ default:
+ return "Sepolia";
+ }
+ };
+
+ // function to open the Controller Profile
const handlePlayerReady = useCallback(() => {
if (!connector || !('controller' in connector)) {
console.error("Connector not initialized");
@@ -79,6 +92,7 @@ export function StatusBar() {
}, [connector]);
const playerStatus = getPlayerStatus();
+ const deploymentType = getDeploymentType();
return (
@@ -107,7 +121,7 @@ export function StatusBar() {
@@ -199,4 +213,4 @@ export function StatusBar() {
)}
)
-}
\ No newline at end of file
+}
diff --git a/client/src/config/cartridgeConnector.tsx b/client/src/config/cartridgeConnector.tsx
index 31eb75d..e078b13 100644
--- a/client/src/config/cartridgeConnector.tsx
+++ b/client/src/config/cartridgeConnector.tsx
@@ -1,12 +1,46 @@
-
import { Connector } from "@starknet-react/core";
import { ControllerConnector } from "@cartridge/connector";
import { ControllerOptions } from "@cartridge/controller";
import { constants } from "starknet";
+import { manifest } from "./manifest";
const { VITE_PUBLIC_DEPLOY_TYPE } = import.meta.env;
-const CONTRACT_ADDRESS_GAME = '0x31b119987eeb1a6c0d13b029ad9a3c64856369dcdfd6e69d9af4c9fba6f507f'
+console.log("VITE_PUBLIC_DEPLOY_TYPE", VITE_PUBLIC_DEPLOY_TYPE);
+
+const getRpcUrl = () => {
+ switch (VITE_PUBLIC_DEPLOY_TYPE) {
+ case "localhost":
+ return "http://localhost:5050"; // Katana localhost default port
+ case "mainnet":
+ return "https://api.cartridge.gg/x/starknet/mainnet";
+ case "sepolia":
+ return "https://api.cartridge.gg/x/starknet/sepolia";
+ default:
+ return "https://api.cartridge.gg/x/starknet/sepolia";
+ }
+};
+
+const getDefaultChainId = () => {
+ switch (VITE_PUBLIC_DEPLOY_TYPE) {
+ case "localhost":
+ return "0x4b4154414e41"; // KATANA in ASCII
+ case "mainnet":
+ return constants.StarknetChainId.SN_MAIN;
+ case "sepolia":
+ return constants.StarknetChainId.SN_SEPOLIA;
+ default:
+ return constants.StarknetChainId.SN_SEPOLIA;
+ }
+};
+
+const getGameContractAddress = () => {
+ return manifest.contracts[0].address;
+
+};
+
+const CONTRACT_ADDRESS_GAME = getGameContractAddress();
+console.log("Using game contract address:", CONTRACT_ADDRESS_GAME);
const policies = {
contracts: {
@@ -22,12 +56,8 @@ const policies = {
}
const options: ControllerOptions = {
- chains: [
- {
- rpcUrl: "https://api.cartridge.gg/x/starknet/sepolia",
- },
- ],
- defaultChainId: VITE_PUBLIC_DEPLOY_TYPE === 'mainnet' ? constants.StarknetChainId.SN_MAIN : constants.StarknetChainId.SN_SEPOLIA,
+ chains: [{ rpcUrl: getRpcUrl() }],
+ defaultChainId: getDefaultChainId(),
policies,
namespace: "full_starter_react",
slot: "full-starter-react",
diff --git a/client/src/config/manifest.ts b/client/src/config/manifest.ts
index 24a1a2e..4382da9 100644
--- a/client/src/config/manifest.ts
+++ b/client/src/config/manifest.ts
@@ -1,12 +1,14 @@
-import slot from "../config/manifest_sepolia.json"; // change for the right slot manifest
-import sepolia from "../config/manifest_sepolia.json"; // sepolia example manifest for this starter
-import mainnet from "../config/manifest_sepolia.json"; // change for the right mainnet manifest
+import localhost from "../../../contract/manifest_dev.json"; // local development manifest
+import sepolia from "./manifest_sepolia.json"; // sepolia manifest
+import mainnet from "./manifest_sepolia.json"; // change for the right mainnet manifest
+import slot from "./manifest_sepolia.json"; // change for the right slot manifest
// Define valid deploy types
type DeployType = keyof typeof manifests;
// Create the manifests object
const manifests = {
+ localhost,
mainnet,
sepolia,
slot,
@@ -16,8 +18,8 @@ const manifests = {
const deployType = import.meta.env.VITE_PUBLIC_DEPLOY_TYPE as string;
// Export the appropriate manifest with a fallback
-export const manifest = deployType in manifests
- ? manifests[deployType as DeployType]
+export const manifest = deployType in manifests
+ ? manifests[deployType as DeployType]
: sepolia;
-export type Manifest = typeof manifest;
\ No newline at end of file
+export type Manifest = typeof manifest;
diff --git a/contract/README.md b/contract/README.md
index 238c3c5..9f98b93 100644
--- a/contract/README.md
+++ b/contract/README.md
@@ -68,6 +68,38 @@ pub enum Achievement {
}
```
+## 🛠️ Local Development
+
+> The next three steps assume you are in the `contract/` directory.
+
+### 1️⃣ Start Katana (Local Blockchain)
+```bash
+katana --config katana.toml
+```
+
+### 2️⃣ Local Deployment
+```bash
+sozo build
+sozo migrate
+```
+
+### 3️⃣ Start Local Torii
+```bash
+torii --world --http.cors_origins "*"
+```
+
+### 4️⃣ Configure the Client for local development
+
+In the `client/` directory, create an `.env.development.local` file with the following contents:
+
+```bash
+VITE_PUBLIC_DEPLOY_TYPE=localhost
+VITE_PUBLIC_NODE_URL=http://localhost:5050
+VITE_PUBLIC_TORII=http://localhost:8080
+```
+
+Now run `npm run dev:https` and you should be ready to go!
+
## 🚀 Deploy to Sepolia
### 1️⃣ Prepare Deploy Account
@@ -193,25 +225,6 @@ sozo test
- **`test_rest_player()`**: Rest system
- **`test_complete_game_flow()`**: Complete flow of the game
-## 🛠️ Local Development
-
-### 1️⃣ Start Katana (Local Blockchain)
-```bash
-katana --dev --dev.no-fee
-```
-
-### 2️⃣ Local Deployment
-```bash
-cd contract
-sozo build
-sozo migrate
-```
-
-### 3️⃣ Start Local Torii
-```bash
-torii --world --http.cors_origins "*"
-```
-
## 📝 Configs
### Scarb.toml
diff --git a/contract/katana.toml b/contract/katana.toml
new file mode 100644
index 0000000..8c78eb9
--- /dev/null
+++ b/contract/katana.toml
@@ -0,0 +1,10 @@
+[dev]
+dev = true
+no_fee = true
+
+[server]
+http_cors_origins = "*"
+
+[cartridge]
+controllers = true
+paymaster = true
diff --git a/contract/manifest_dev.json b/contract/manifest_dev.json
new file mode 100644
index 0000000..b9f4511
--- /dev/null
+++ b/contract/manifest_dev.json
@@ -0,0 +1,1586 @@
+{
+ "world": {
+ "class_hash": "0x4c60dc46a8ca8bb47675b7b914053cef769afbf0e340523187336b72bd71d1f",
+ "address": "0x11097187dc00f79265f35e73ba674b792624f77dfa239e381dfc6744e1c8265",
+ "seed": "full_starter_react1",
+ "name": "Full-Starter-React",
+ "entrypoints": [
+ "uuid",
+ "set_metadata",
+ "register_namespace",
+ "register_event",
+ "register_model",
+ "register_contract",
+ "register_library",
+ "init_contract",
+ "upgrade_event",
+ "upgrade_model",
+ "upgrade_contract",
+ "emit_event",
+ "emit_events",
+ "set_entity",
+ "set_entities",
+ "delete_entity",
+ "delete_entities",
+ "grant_owner",
+ "revoke_owner",
+ "grant_writer",
+ "revoke_writer",
+ "upgrade"
+ ],
+ "abi": [
+ {
+ "type": "impl",
+ "name": "World",
+ "interface_name": "dojo::world::iworld::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": "enum",
+ "name": "dojo::world::resource::Resource",
+ "variants": [
+ {
+ "name": "Model",
+ "type": "(core::starknet::contract_address::ContractAddress, core::felt252)"
+ },
+ {
+ "name": "Event",
+ "type": "(core::starknet::contract_address::ContractAddress, core::felt252)"
+ },
+ {
+ "name": "Contract",
+ "type": "(core::starknet::contract_address::ContractAddress, core::felt252)"
+ },
+ {
+ "name": "Namespace",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "World",
+ "type": "()"
+ },
+ {
+ "name": "Unregistered",
+ "type": "()"
+ },
+ {
+ "name": "Library",
+ "type": "(core::starknet::class_hash::ClassHash, core::felt252)"
+ }
+ ]
+ },
+ {
+ "type": "struct",
+ "name": "dojo::model::metadata::ResourceMetadata",
+ "members": [
+ {
+ "name": "resource_id",
+ "type": "core::felt252"
+ },
+ {
+ "name": "metadata_uri",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "metadata_hash",
+ "type": "core::felt252"
+ }
+ ]
+ },
+ {
+ "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::definition::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::meta::layout::FieldLayout",
+ "members": [
+ {
+ "name": "selector",
+ "type": "core::felt252"
+ },
+ {
+ "name": "layout",
+ "type": "dojo::meta::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::meta::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": "enum",
+ "name": "core::bool",
+ "variants": [
+ {
+ "name": "False",
+ "type": "()"
+ },
+ {
+ "name": "True",
+ "type": "()"
+ }
+ ]
+ },
+ {
+ "type": "interface",
+ "name": "dojo::world::iworld::IWorld",
+ "items": [
+ {
+ "type": "function",
+ "name": "resource",
+ "inputs": [
+ {
+ "name": "selector",
+ "type": "core::felt252"
+ }
+ ],
+ "outputs": [
+ {
+ "type": "dojo::world::resource::Resource"
+ }
+ ],
+ "state_mutability": "view"
+ },
+ {
+ "type": "function",
+ "name": "uuid",
+ "inputs": [],
+ "outputs": [
+ {
+ "type": "core::integer::u32"
+ }
+ ],
+ "state_mutability": "external"
+ },
+ {
+ "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_event",
+ "inputs": [
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "register_model",
+ "inputs": [
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "register_contract",
+ "inputs": [
+ {
+ "name": "salt",
+ "type": "core::felt252"
+ },
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash"
+ }
+ ],
+ "outputs": [
+ {
+ "type": "core::starknet::contract_address::ContractAddress"
+ }
+ ],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "register_library",
+ "inputs": [
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash"
+ },
+ {
+ "name": "name",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "version",
+ "type": "core::byte_array::ByteArray"
+ }
+ ],
+ "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": "upgrade_event",
+ "inputs": [
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "upgrade_model",
+ "inputs": [
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "upgrade_contract",
+ "inputs": [
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash"
+ }
+ ],
+ "outputs": [
+ {
+ "type": "core::starknet::class_hash::ClassHash"
+ }
+ ],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "emit_event",
+ "inputs": [
+ {
+ "name": "event_selector",
+ "type": "core::felt252"
+ },
+ {
+ "name": "keys",
+ "type": "core::array::Span::"
+ },
+ {
+ "name": "values",
+ "type": "core::array::Span::"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "emit_events",
+ "inputs": [
+ {
+ "name": "event_selector",
+ "type": "core::felt252"
+ },
+ {
+ "name": "keys",
+ "type": "core::array::Span::>"
+ },
+ {
+ "name": "values",
+ "type": "core::array::Span::>"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "entity",
+ "inputs": [
+ {
+ "name": "model_selector",
+ "type": "core::felt252"
+ },
+ {
+ "name": "index",
+ "type": "dojo::model::definition::ModelIndex"
+ },
+ {
+ "name": "layout",
+ "type": "dojo::meta::layout::Layout"
+ }
+ ],
+ "outputs": [
+ {
+ "type": "core::array::Span::"
+ }
+ ],
+ "state_mutability": "view"
+ },
+ {
+ "type": "function",
+ "name": "entities",
+ "inputs": [
+ {
+ "name": "model_selector",
+ "type": "core::felt252"
+ },
+ {
+ "name": "indexes",
+ "type": "core::array::Span::"
+ },
+ {
+ "name": "layout",
+ "type": "dojo::meta::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::definition::ModelIndex"
+ },
+ {
+ "name": "values",
+ "type": "core::array::Span::"
+ },
+ {
+ "name": "layout",
+ "type": "dojo::meta::layout::Layout"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "set_entities",
+ "inputs": [
+ {
+ "name": "model_selector",
+ "type": "core::felt252"
+ },
+ {
+ "name": "indexes",
+ "type": "core::array::Span::"
+ },
+ {
+ "name": "values",
+ "type": "core::array::Span::>"
+ },
+ {
+ "name": "layout",
+ "type": "dojo::meta::layout::Layout"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "delete_entity",
+ "inputs": [
+ {
+ "name": "model_selector",
+ "type": "core::felt252"
+ },
+ {
+ "name": "index",
+ "type": "dojo::model::definition::ModelIndex"
+ },
+ {
+ "name": "layout",
+ "type": "dojo::meta::layout::Layout"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "delete_entities",
+ "inputs": [
+ {
+ "name": "model_selector",
+ "type": "core::felt252"
+ },
+ {
+ "name": "indexes",
+ "type": "core::array::Span::"
+ },
+ {
+ "name": "layout",
+ "type": "dojo::meta::layout::Layout"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "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": "owners_count",
+ "inputs": [
+ {
+ "name": "resource",
+ "type": "core::felt252"
+ }
+ ],
+ "outputs": [
+ {
+ "type": "core::integer::u64"
+ }
+ ],
+ "state_mutability": "view"
+ },
+ {
+ "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::iworld::IUpgradeableWorld"
+ },
+ {
+ "type": "interface",
+ "name": "dojo::world::iworld::IUpgradeableWorld",
+ "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": [
+ {
+ "name": "world_class_hash",
+ "type": "core::starknet::class_hash::ClassHash"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::WorldSpawned",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "creator",
+ "type": "core::starknet::contract_address::ContractAddress",
+ "kind": "data"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash",
+ "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::NamespaceRegistered",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray",
+ "kind": "key"
+ },
+ {
+ "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": "key"
+ },
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray",
+ "kind": "key"
+ },
+ {
+ "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::EventRegistered",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "name",
+ "type": "core::byte_array::ByteArray",
+ "kind": "key"
+ },
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray",
+ "kind": "key"
+ },
+ {
+ "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::ContractRegistered",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "name",
+ "type": "core::byte_array::ByteArray",
+ "kind": "key"
+ },
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray",
+ "kind": "key"
+ },
+ {
+ "name": "address",
+ "type": "core::starknet::contract_address::ContractAddress",
+ "kind": "data"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash",
+ "kind": "data"
+ },
+ {
+ "name": "salt",
+ "type": "core::felt252",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::ModelUpgraded",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "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::EventUpgraded",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "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::ContractUpgraded",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::ContractInitialized",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "init_calldata",
+ "type": "core::array::Span::",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::LibraryRegistered",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "name",
+ "type": "core::byte_array::ByteArray",
+ "kind": "key"
+ },
+ {
+ "name": "namespace",
+ "type": "core::byte_array::ByteArray",
+ "kind": "key"
+ },
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::EventEmitted",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "system_address",
+ "type": "core::starknet::contract_address::ContractAddress",
+ "kind": "key"
+ },
+ {
+ "name": "keys",
+ "type": "core::array::Span::",
+ "kind": "data"
+ },
+ {
+ "name": "values",
+ "type": "core::array::Span::",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::MetadataUpdate",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "resource",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "uri",
+ "type": "core::byte_array::ByteArray",
+ "kind": "data"
+ },
+ {
+ "name": "hash",
+ "type": "core::felt252",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::StoreSetRecord",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "entity_id",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "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": "selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "entity_id",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "values",
+ "type": "core::array::Span::",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::StoreUpdateMember",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "entity_id",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "member_selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "values",
+ "type": "core::array::Span::",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::StoreDelRecord",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "selector",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "entity_id",
+ "type": "core::felt252",
+ "kind": "key"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::WriterUpdated",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "resource",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "contract",
+ "type": "core::starknet::contract_address::ContractAddress",
+ "kind": "key"
+ },
+ {
+ "name": "value",
+ "type": "core::bool",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::world::world_contract::world::OwnerUpdated",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "resource",
+ "type": "core::felt252",
+ "kind": "key"
+ },
+ {
+ "name": "contract",
+ "type": "core::starknet::contract_address::ContractAddress",
+ "kind": "key"
+ },
+ {
+ "name": "value",
+ "type": "core::bool",
+ "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": "WorldUpgraded",
+ "type": "dojo::world::world_contract::world::WorldUpgraded",
+ "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": "EventRegistered",
+ "type": "dojo::world::world_contract::world::EventRegistered",
+ "kind": "nested"
+ },
+ {
+ "name": "ContractRegistered",
+ "type": "dojo::world::world_contract::world::ContractRegistered",
+ "kind": "nested"
+ },
+ {
+ "name": "ModelUpgraded",
+ "type": "dojo::world::world_contract::world::ModelUpgraded",
+ "kind": "nested"
+ },
+ {
+ "name": "EventUpgraded",
+ "type": "dojo::world::world_contract::world::EventUpgraded",
+ "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": "LibraryRegistered",
+ "type": "dojo::world::world_contract::world::LibraryRegistered",
+ "kind": "nested"
+ },
+ {
+ "name": "EventEmitted",
+ "type": "dojo::world::world_contract::world::EventEmitted",
+ "kind": "nested"
+ },
+ {
+ "name": "MetadataUpdate",
+ "type": "dojo::world::world_contract::world::MetadataUpdate",
+ "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"
+ }
+ ]
+ }
+ ]
+ },
+ "contracts": [
+ {
+ "address": "0x19d9e6beac2177d4f48014861f4eead47192b9c450431cf31908f5359f49562",
+ "class_hash": "0x701ef74c653b7c3eacadf65d7186be46dbc25b4959575dc25ff5ef24643a801",
+ "abi": [
+ {
+ "type": "impl",
+ "name": "game__ContractImpl",
+ "interface_name": "dojo::contract::interface::IContract"
+ },
+ {
+ "type": "interface",
+ "name": "dojo::contract::interface::IContract",
+ "items": []
+ },
+ {
+ "type": "impl",
+ "name": "game__DeployedContractImpl",
+ "interface_name": "dojo::meta::interface::IDeployedResource"
+ },
+ {
+ "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::meta::interface::IDeployedResource",
+ "items": [
+ {
+ "type": "function",
+ "name": "dojo_name",
+ "inputs": [],
+ "outputs": [
+ {
+ "type": "core::byte_array::ByteArray"
+ }
+ ],
+ "state_mutability": "view"
+ }
+ ]
+ },
+ {
+ "type": "function",
+ "name": "dojo_init",
+ "inputs": [],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "impl",
+ "name": "GameImpl",
+ "interface_name": "full_starter_react::systems::game::IGame"
+ },
+ {
+ "type": "interface",
+ "name": "full_starter_react::systems::game::IGame",
+ "items": [
+ {
+ "type": "function",
+ "name": "spawn_player",
+ "inputs": [],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "train",
+ "inputs": [],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "mine",
+ "inputs": [],
+ "outputs": [],
+ "state_mutability": "external"
+ },
+ {
+ "type": "function",
+ "name": "rest",
+ "inputs": [],
+ "outputs": [],
+ "state_mutability": "external"
+ }
+ ]
+ },
+ {
+ "type": "impl",
+ "name": "WorldProviderImpl",
+ "interface_name": "dojo::contract::components::world_provider::IWorldProvider"
+ },
+ {
+ "type": "struct",
+ "name": "dojo::world::iworld::IWorldDispatcher",
+ "members": [
+ {
+ "name": "contract_address",
+ "type": "core::starknet::contract_address::ContractAddress"
+ }
+ ]
+ },
+ {
+ "type": "interface",
+ "name": "dojo::contract::components::world_provider::IWorldProvider",
+ "items": [
+ {
+ "type": "function",
+ "name": "world_dispatcher",
+ "inputs": [],
+ "outputs": [
+ {
+ "type": "dojo::world::iworld::IWorldDispatcher"
+ }
+ ],
+ "state_mutability": "view"
+ }
+ ]
+ },
+ {
+ "type": "impl",
+ "name": "UpgradeableImpl",
+ "interface_name": "dojo::contract::components::upgradeable::IUpgradeable"
+ },
+ {
+ "type": "interface",
+ "name": "dojo::contract::components::upgradeable::IUpgradeable",
+ "items": [
+ {
+ "type": "function",
+ "name": "upgrade",
+ "inputs": [
+ {
+ "name": "new_class_hash",
+ "type": "core::starknet::class_hash::ClassHash"
+ }
+ ],
+ "outputs": [],
+ "state_mutability": "external"
+ }
+ ]
+ },
+ {
+ "type": "constructor",
+ "name": "constructor",
+ "inputs": []
+ },
+ {
+ "type": "event",
+ "name": "dojo::contract::components::upgradeable::upgradeable_cpt::Upgraded",
+ "kind": "struct",
+ "members": [
+ {
+ "name": "class_hash",
+ "type": "core::starknet::class_hash::ClassHash",
+ "kind": "data"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::contract::components::upgradeable::upgradeable_cpt::Event",
+ "kind": "enum",
+ "variants": [
+ {
+ "name": "Upgraded",
+ "type": "dojo::contract::components::upgradeable::upgradeable_cpt::Upgraded",
+ "kind": "nested"
+ }
+ ]
+ },
+ {
+ "type": "event",
+ "name": "dojo::contract::components::world_provider::world_provider_cpt::Event",
+ "kind": "enum",
+ "variants": []
+ },
+ {
+ "type": "event",
+ "name": "achievement::components::achievable::AchievableComponent::Event",
+ "kind": "enum",
+ "variants": []
+ },
+ {
+ "type": "event",
+ "name": "full_starter_react::systems::game::game::Event",
+ "kind": "enum",
+ "variants": [
+ {
+ "name": "UpgradeableEvent",
+ "type": "dojo::contract::components::upgradeable::upgradeable_cpt::Event",
+ "kind": "nested"
+ },
+ {
+ "name": "WorldProviderEvent",
+ "type": "dojo::contract::components::world_provider::world_provider_cpt::Event",
+ "kind": "nested"
+ },
+ {
+ "name": "AchievableEvent",
+ "type": "achievement::components::achievable::AchievableComponent::Event",
+ "kind": "flat"
+ }
+ ]
+ }
+ ],
+ "init_calldata": [],
+ "tag": "full_starter_react-game",
+ "selector": "0x4c3a60c69390276b1cdfe902f6305743f3668c5ab9e68a96105dea78d8ccd61",
+ "systems": [
+ "dojo_init",
+ "spawn_player",
+ "train",
+ "mine",
+ "rest",
+ "upgrade"
+ ]
+ }
+ ],
+ "libraries": [],
+ "models": [
+ {
+ "members": [],
+ "class_hash": "0x252e99793931b5225530b751c1246f47f4db7b2eed99bd5c3e6bbad9268668a",
+ "tag": "full_starter_react-Player",
+ "selector": "0x13986cc36a0f8437378d1efa3068103f37b22361ff3cc31be99d50ddf2e4187"
+ }
+ ],
+ "events": [
+ {
+ "members": [],
+ "class_hash": "0x702d5440a155e0704b268f8d6dbf74cb8ae09b164064fe3b4f896cf725dcac7",
+ "tag": "full_starter_react-TrophyCreation",
+ "selector": "0x3ee5e843803cc1ec151088d980d09c665c10f9282fea6204ebec09706791977"
+ },
+ {
+ "members": [],
+ "class_hash": "0x113e43bc604068a5811205b126a3e318b21e5c72746138efa6fb40277067f00",
+ "tag": "full_starter_react-TrophyProgression",
+ "selector": "0x6f15029fdaa4c14b9f4690bad922d22e5646466e5fe4c688e633d67028b68d8"
+ }
+ ],
+ "external_contracts": []
+}
\ No newline at end of file