From a04761b63c4623cf1a1897b242f06290eeea69bd Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Tue, 2 Jul 2024 18:13:03 +0100 Subject: [PATCH] Revert "feat(world): support namespaced systems" (#2918) --- .changeset/eighty-poems-tan.md | 13 -------- .changeset/small-snakes-guess.md | 14 -------- .../minimal/packages/contracts/mud.config.ts | 4 +++ .../contracts/script/PostDeploy.s.sol | 13 +++++--- .../contracts/src/codegen/world/IWorld.sol | 10 +----- .../codegen/world/namespace__IChatSystem.sol | 13 -------- .../src/interfaces/IChatNamespacedSystem.sol | 6 ++++ ...hatSystem.sol => ChatNamespacedSystem.sol} | 4 +-- .../{ChatTest.t.sol => ChatNamespaced.t.sol} | 6 ++-- ...{game__IHealSystem.sol => IHealSystem.sol} | 4 +-- ...{game__IMoveSystem.sol => IMoveSystem.sol} | 4 +-- .../src/codegen/world/IWorld.sol | 6 ++-- .../{game__HealSystem.sol => HealSystem.sol} | 2 +- .../{game__MoveSystem.sol => MoveSystem.sol} | 2 +- packages/cli/src/deploy/resolveConfig.ts | 2 +- packages/common/src/common.ts | 2 -- packages/common/src/resourceToLabel.ts | 6 ++-- .../world/ts/config/resolveWorldConfig.ts | 33 ++++--------------- .../world/ts/node/render-solidity/worldgen.ts | 8 ++--- .../src/codegen/world/IIncrementSystem.sol} | 4 +-- .../contracts/src/codegen/world/IWorld.sol | 4 +-- ...crementSystem.sol => IIncrementSystem.sol} | 4 +-- .../contracts/src/codegen/world/IWorld.sol | 4 +-- ...app__ITasksSystem.sol => ITasksSystem.sol} | 4 +-- .../contracts/src/codegen/world/IWorld.sol | 4 +-- .../{app__IMoveSystem.sol => IMoveSystem.sol} | 4 +-- .../contracts/src/codegen/world/IWorld.sol | 4 +-- .../src/codegen/world/IIncrementSystem.sol} | 4 +-- .../contracts/src/codegen/world/IWorld.sol | 4 +-- 29 files changed, 65 insertions(+), 127 deletions(-) delete mode 100644 .changeset/eighty-poems-tan.md delete mode 100644 .changeset/small-snakes-guess.md delete mode 100644 examples/minimal/packages/contracts/src/codegen/world/namespace__IChatSystem.sol create mode 100644 examples/minimal/packages/contracts/src/interfaces/IChatNamespacedSystem.sol rename examples/minimal/packages/contracts/src/systems/{namespace__ChatSystem.sol => ChatNamespacedSystem.sol} (65%) rename examples/minimal/packages/contracts/test/{ChatTest.t.sol => ChatNamespaced.t.sol} (80%) rename examples/multiple-namespaces/src/codegen/world/{game__IHealSystem.sol => IHealSystem.sol} (85%) rename examples/multiple-namespaces/src/codegen/world/{game__IMoveSystem.sol => IMoveSystem.sol} (86%) rename examples/multiple-namespaces/src/systems/{game__HealSystem.sol => HealSystem.sol} (87%) rename examples/multiple-namespaces/src/systems/{game__MoveSystem.sol => MoveSystem.sol} (88%) rename templates/{vanilla/packages/contracts/src/codegen/world/app__IIncrementSystem.sol => phaser/packages/contracts/src/codegen/world/IIncrementSystem.sol} (84%) rename templates/react-ecs/packages/contracts/src/codegen/world/{app__IIncrementSystem.sol => IIncrementSystem.sol} (84%) rename templates/react/packages/contracts/src/codegen/world/{app__ITasksSystem.sol => ITasksSystem.sol} (90%) rename templates/threejs/packages/contracts/src/codegen/world/{app__IMoveSystem.sol => IMoveSystem.sol} (86%) rename templates/{phaser/packages/contracts/src/codegen/world/app__IIncrementSystem.sol => vanilla/packages/contracts/src/codegen/world/IIncrementSystem.sol} (84%) diff --git a/.changeset/eighty-poems-tan.md b/.changeset/eighty-poems-tan.md deleted file mode 100644 index 43622c6166..0000000000 --- a/.changeset/eighty-poems-tan.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"@latticexyz/common": patch ---- - -Added an export for the root namespace string, which can be imported like so: - -``` -import { ROOT_NAMESPACE } from "@latticexyz/common"; - -if (namespace === ROOT_NAMESPACE) { - ... -} -``` diff --git a/.changeset/small-snakes-guess.md b/.changeset/small-snakes-guess.md deleted file mode 100644 index 5dacd9c431..0000000000 --- a/.changeset/small-snakes-guess.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"@latticexyz/world": patch -"@latticexyz/cli": patch ---- - -Added support for namespaced systems. Namespaced systems are declared like regular systems, but the file and contract name is prefixed with the namespace name and two underscores in the form `{namespace}__{system}.sol`. For example, the contract `app__ChatSystem` will be registered as `"ChatSystem"` in the `"app"` namespace. - -```solidity -contract app__ChatSystem is System { - function sendMessage(string memory message) public { - ... - } -} -``` diff --git a/examples/minimal/packages/contracts/mud.config.ts b/examples/minimal/packages/contracts/mud.config.ts index 9713ab08f2..a6ced4ce58 100644 --- a/examples/minimal/packages/contracts/mud.config.ts +++ b/examples/minimal/packages/contracts/mud.config.ts @@ -8,6 +8,10 @@ export default defineWorld({ openAccess: true, }, }, + excludeSystems: [ + // Until namespace overrides, this system must be manually deployed in PostDeploy + "ChatNamespacedSystem", + ], tables: { CounterTable: { schema: { diff --git a/examples/minimal/packages/contracts/script/PostDeploy.s.sol b/examples/minimal/packages/contracts/script/PostDeploy.s.sol index badfe40d9d..f39faa8fed 100644 --- a/examples/minimal/packages/contracts/script/PostDeploy.s.sol +++ b/examples/minimal/packages/contracts/script/PostDeploy.s.sol @@ -6,11 +6,10 @@ import { console } from "forge-std/console.sol"; import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { ResourceId, WorldResourceIdLib, WorldResourceIdInstance } from "@latticexyz/world/src/WorldResourceId.sol"; import { RESOURCE_SYSTEM } from "@latticexyz/world/src/worldResourceTypes.sol"; -import { Systems } from "@latticexyz/world/src/codegen/tables/Systems.sol"; import { MessageTable } from "../src/codegen/index.sol"; import { IWorld } from "../src/codegen/world/IWorld.sol"; -import { namespace__ChatSystem } from "../src/systems/namespace__ChatSystem.sol"; +import { ChatNamespacedSystem } from "../src/systems/ChatNamespacedSystem.sol"; contract PostDeploy is Script { using WorldResourceIdInstance for ResourceId; @@ -25,15 +24,19 @@ contract PostDeploy is Script { // Start broadcasting transactions from the deployer account vm.startBroadcast(deployerPrivateKey); + // Manually deploy a system with another namespace + ChatNamespacedSystem chatNamespacedSystem = new ChatNamespacedSystem(); ResourceId systemId = WorldResourceIdLib.encode({ typeId: RESOURCE_SYSTEM, namespace: "namespace", - name: "ChatSystem" + name: "ChatNamespaced" }); - address chatSystem = Systems.getSystem(systemId); + IWorld(worldAddress).registerNamespace(systemId.getNamespaceId()); + IWorld(worldAddress).registerSystem(systemId, chatNamespacedSystem, true); + IWorld(worldAddress).registerFunctionSelector(systemId, "sendMessage(string)"); // Grant this system access to MessageTable - IWorld(worldAddress).grantAccess(MessageTable._tableId, chatSystem); + IWorld(worldAddress).grantAccess(MessageTable._tableId, address(chatNamespacedSystem)); // ------------------ EXAMPLES ------------------ diff --git a/examples/minimal/packages/contracts/src/codegen/world/IWorld.sol b/examples/minimal/packages/contracts/src/codegen/world/IWorld.sol index 5068298366..6eb7845c59 100644 --- a/examples/minimal/packages/contracts/src/codegen/world/IWorld.sol +++ b/examples/minimal/packages/contracts/src/codegen/world/IWorld.sol @@ -8,7 +8,6 @@ import { IBaseWorld } from "@latticexyz/world/src/codegen/interfaces/IBaseWorld. import { IChatSystem } from "./IChatSystem.sol"; import { IIncrementSystem } from "./IIncrementSystem.sol"; import { IInventorySystem } from "./IInventorySystem.sol"; -import { namespace__IChatSystem } from "./namespace__IChatSystem.sol"; import { IStructSystem } from "./IStructSystem.sol"; /** @@ -18,11 +17,4 @@ import { IStructSystem } from "./IStructSystem.sol"; * that are dynamically registered in the World during deployment. * @dev This is an autogenerated file; do not edit manually. */ -interface IWorld is - IBaseWorld, - IChatSystem, - IIncrementSystem, - IInventorySystem, - namespace__IChatSystem, - IStructSystem -{} +interface IWorld is IBaseWorld, IChatSystem, IIncrementSystem, IInventorySystem, IStructSystem {} diff --git a/examples/minimal/packages/contracts/src/codegen/world/namespace__IChatSystem.sol b/examples/minimal/packages/contracts/src/codegen/world/namespace__IChatSystem.sol deleted file mode 100644 index 8119b0ff03..0000000000 --- a/examples/minimal/packages/contracts/src/codegen/world/namespace__IChatSystem.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.24; - -/* Autogenerated file. Do not edit manually. */ - -/** - * @title namespace__IChatSystem - * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) - * @dev This interface is automatically generated from the corresponding system contract. Do not edit manually. - */ -interface namespace__IChatSystem { - function namespace__sendMessage(string memory message) external; -} diff --git a/examples/minimal/packages/contracts/src/interfaces/IChatNamespacedSystem.sol b/examples/minimal/packages/contracts/src/interfaces/IChatNamespacedSystem.sol new file mode 100644 index 0000000000..e8280c717f --- /dev/null +++ b/examples/minimal/packages/contracts/src/interfaces/IChatNamespacedSystem.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.24; + +interface IChatNamespacedSystem { + function namespace__sendMessage(string memory message) external; +} diff --git a/examples/minimal/packages/contracts/src/systems/namespace__ChatSystem.sol b/examples/minimal/packages/contracts/src/systems/ChatNamespacedSystem.sol similarity index 65% rename from examples/minimal/packages/contracts/src/systems/namespace__ChatSystem.sol rename to examples/minimal/packages/contracts/src/systems/ChatNamespacedSystem.sol index 1d79bd6e0a..5531e515db 100644 --- a/examples/minimal/packages/contracts/src/systems/namespace__ChatSystem.sol +++ b/examples/minimal/packages/contracts/src/systems/ChatNamespacedSystem.sol @@ -3,8 +3,8 @@ pragma solidity >=0.8.24; import { System } from "@latticexyz/world/src/System.sol"; import { MessageTable } from "../codegen/index.sol"; -// This system has a different namespace, but is otherwise identical to ChatSystem -contract namespace__ChatSystem is System { +// This system is supposed to have a different namespace, but otherwise be identical to ChatSystem +contract ChatNamespacedSystem is System { function sendMessage(string memory message) public { MessageTable.set(message); } diff --git a/examples/minimal/packages/contracts/test/ChatTest.t.sol b/examples/minimal/packages/contracts/test/ChatNamespaced.t.sol similarity index 80% rename from examples/minimal/packages/contracts/test/ChatTest.t.sol rename to examples/minimal/packages/contracts/test/ChatNamespaced.t.sol index 92ed61f29e..fe27846c43 100644 --- a/examples/minimal/packages/contracts/test/ChatTest.t.sol +++ b/examples/minimal/packages/contracts/test/ChatNamespaced.t.sol @@ -8,9 +8,9 @@ import { IStoreEvents } from "@latticexyz/store/src/IStoreEvents.sol"; import { IWorld } from "../src/codegen/world/IWorld.sol"; import { MessageTable } from "../src/codegen/index.sol"; -import { namespace__IChatSystem } from "../src/codegen/world/namespace__IChatSystem.sol"; +import { IChatNamespacedSystem } from "../src/interfaces/IChatNamespacedSystem.sol"; -contract ChatTest is MudTest { +contract ChatNamespacedTest is MudTest { function testOffchain() public { bytes32[] memory keyTuple; string memory value = "test"; @@ -22,6 +22,6 @@ contract ChatTest is MudTest { MessageTable.encodeLengths(value), MessageTable.encodeDynamic(value) ); - namespace__IChatSystem(worldAddress).namespace__sendMessage(value); + IChatNamespacedSystem(worldAddress).namespace__sendMessage(value); } } diff --git a/examples/multiple-namespaces/src/codegen/world/game__IHealSystem.sol b/examples/multiple-namespaces/src/codegen/world/IHealSystem.sol similarity index 85% rename from examples/multiple-namespaces/src/codegen/world/game__IHealSystem.sol rename to examples/multiple-namespaces/src/codegen/world/IHealSystem.sol index 81b053579a..5a42ff66bf 100644 --- a/examples/multiple-namespaces/src/codegen/world/game__IHealSystem.sol +++ b/examples/multiple-namespaces/src/codegen/world/IHealSystem.sol @@ -4,10 +4,10 @@ pragma solidity >=0.8.24; /* Autogenerated file. Do not edit manually. */ /** - * @title game__IHealSystem + * @title IHealSystem * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) * @dev This interface is automatically generated from the corresponding system contract. Do not edit manually. */ -interface game__IHealSystem { +interface IHealSystem { function game__heal(address player) external; } diff --git a/examples/multiple-namespaces/src/codegen/world/game__IMoveSystem.sol b/examples/multiple-namespaces/src/codegen/world/IMoveSystem.sol similarity index 86% rename from examples/multiple-namespaces/src/codegen/world/game__IMoveSystem.sol rename to examples/multiple-namespaces/src/codegen/world/IMoveSystem.sol index 8a0fef6c4f..dc94d2bad1 100644 --- a/examples/multiple-namespaces/src/codegen/world/game__IMoveSystem.sol +++ b/examples/multiple-namespaces/src/codegen/world/IMoveSystem.sol @@ -4,10 +4,10 @@ pragma solidity >=0.8.24; /* Autogenerated file. Do not edit manually. */ /** - * @title game__IMoveSystem + * @title IMoveSystem * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) * @dev This interface is automatically generated from the corresponding system contract. Do not edit manually. */ -interface game__IMoveSystem { +interface IMoveSystem { function game__move(address player, int32 x, int32 y) external; } diff --git a/examples/multiple-namespaces/src/codegen/world/IWorld.sol b/examples/multiple-namespaces/src/codegen/world/IWorld.sol index 874a7c36aa..af8a6d4c3a 100644 --- a/examples/multiple-namespaces/src/codegen/world/IWorld.sol +++ b/examples/multiple-namespaces/src/codegen/world/IWorld.sol @@ -5,8 +5,8 @@ pragma solidity >=0.8.24; import { IBaseWorld } from "@latticexyz/world/src/codegen/interfaces/IBaseWorld.sol"; -import { game__IHealSystem } from "./game__IHealSystem.sol"; -import { game__IMoveSystem } from "./game__IMoveSystem.sol"; +import { IHealSystem } from "./IHealSystem.sol"; +import { IMoveSystem } from "./IMoveSystem.sol"; /** * @title IWorld @@ -15,4 +15,4 @@ import { game__IMoveSystem } from "./game__IMoveSystem.sol"; * that are dynamically registered in the World during deployment. * @dev This is an autogenerated file; do not edit manually. */ -interface IWorld is IBaseWorld, game__IHealSystem, game__IMoveSystem {} +interface IWorld is IBaseWorld, IHealSystem, IMoveSystem {} diff --git a/examples/multiple-namespaces/src/systems/game__HealSystem.sol b/examples/multiple-namespaces/src/systems/HealSystem.sol similarity index 87% rename from examples/multiple-namespaces/src/systems/game__HealSystem.sol rename to examples/multiple-namespaces/src/systems/HealSystem.sol index fd47970ab1..76fd429295 100644 --- a/examples/multiple-namespaces/src/systems/game__HealSystem.sol +++ b/examples/multiple-namespaces/src/systems/HealSystem.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.24; import { System } from "@latticexyz/world/src/System.sol"; import { Health } from "../codegen/game/tables/Health.sol"; -contract game__HealSystem is System { +contract HealSystem is System { function heal(address player) public { Health.set(player, Health.get(player) + 1); } diff --git a/examples/multiple-namespaces/src/systems/game__MoveSystem.sol b/examples/multiple-namespaces/src/systems/MoveSystem.sol similarity index 88% rename from examples/multiple-namespaces/src/systems/game__MoveSystem.sol rename to examples/multiple-namespaces/src/systems/MoveSystem.sol index cb5cdfc7b6..8362719053 100644 --- a/examples/multiple-namespaces/src/systems/game__MoveSystem.sol +++ b/examples/multiple-namespaces/src/systems/MoveSystem.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.24; import { System } from "@latticexyz/world/src/System.sol"; import { Position } from "../codegen/game/tables/Position.sol"; -contract game__MoveSystem is System { +contract MoveSystem is System { function move(address player, int32 x, int32 y) public { Position.set(player, x, y); } diff --git a/packages/cli/src/deploy/resolveConfig.ts b/packages/cli/src/deploy/resolveConfig.ts index dcab55c47b..0a4466f7dc 100644 --- a/packages/cli/src/deploy/resolveConfig.ts +++ b/packages/cli/src/deploy/resolveConfig.ts @@ -44,7 +44,7 @@ export function resolveConfig({ .map(toFunctionSignature); const systems = Object.entries(resolvedConfig.systems).map(([systemName, system]): System => { - const namespace = system.namespace; + const namespace = config.namespace; const name = system.name; const systemId = resourceToHex({ type: "system", namespace, name }); const contractData = getContractData(`${systemName}.sol`, systemName, forgeOutDir); diff --git a/packages/common/src/common.ts b/packages/common/src/common.ts index 3eda76c0d3..b89a8f8ce7 100644 --- a/packages/common/src/common.ts +++ b/packages/common/src/common.ts @@ -7,5 +7,3 @@ export type Resource = { readonly namespace: string; readonly name: string; }; - -export const ROOT_NAMESPACE = ""; diff --git a/packages/common/src/resourceToLabel.ts b/packages/common/src/resourceToLabel.ts index 907b397f17..9079eeb290 100644 --- a/packages/common/src/resourceToLabel.ts +++ b/packages/common/src/resourceToLabel.ts @@ -1,9 +1,9 @@ -import { ROOT_NAMESPACE } from "./common"; +const rootNamespace = ""; export type ResourceLabel< namespace extends string = string, name extends string = string, -> = namespace extends typeof ROOT_NAMESPACE ? name : `${namespace}__${name}`; +> = namespace extends typeof rootNamespace ? name : `${namespace}__${name}`; export function resourceToLabel({ namespace, @@ -12,5 +12,5 @@ export function resourceToLabel({ readonly namespace: namespace; readonly name: name; }): ResourceLabel { - return (namespace === ROOT_NAMESPACE ? name : `${namespace}__${name}`) as ResourceLabel; + return (namespace === rootNamespace ? name : `${namespace}__${name}`) as ResourceLabel; } diff --git a/packages/world/ts/config/resolveWorldConfig.ts b/packages/world/ts/config/resolveWorldConfig.ts index fc743ac6dd..7dd9766464 100644 --- a/packages/world/ts/config/resolveWorldConfig.ts +++ b/packages/world/ts/config/resolveWorldConfig.ts @@ -12,13 +12,12 @@ export type ResolvedWorldConfig = ReturnType; * splitting the access list into addresses and system names. */ export function resolveWorldConfig( - config: Pick, + config: Pick, existingContracts?: string[], ) { // Include contract names ending in "System", but not the base "System" contract, and not Interfaces const defaultSystemNames = - existingContracts?.filter((name) => name.endsWith("System") && name !== "System" && !/(^|__)I[A-Z]/.test(name)) ?? - []; + existingContracts?.filter((name) => name.endsWith("System") && name !== "System" && !name.match(/^I[A-Z]/)) ?? []; const overriddenSystemNames = Object.keys(config.systems); // Validate every key in systems refers to an existing system contract (and is not called "World") @@ -39,12 +38,7 @@ export function resolveWorldConfig( const resolvedSystems: Record = systemNames.reduce((acc, systemName) => { return { ...acc, - [systemName]: resolveSystemConfig({ - systemName, - configNamespace: config.namespace, - config: config.systems[systemName], - existingContracts, - }), + [systemName]: resolveSystemConfig(systemName, config.systems[systemName], existingContracts), }; }, {}); @@ -63,23 +57,8 @@ export function resolveWorldConfig( * Default value for accessListAddresses is [] * Default value for accessListSystems is [] */ -export function resolveSystemConfig({ - systemName, - configNamespace, - config, - existingContracts, -}: { - systemName: string; - configNamespace: string; - config?: SystemConfig; - existingContracts?: string[]; -}) { - // If the namespace is not set in the system name, default to the config namespace - const parts = systemName.split("__"); - const namespaceIsSet = parts.length === 2; - const namespace = namespaceIsSet ? parts[0] : configNamespace; - const name = namespaceIsSet ? parts[1] : systemName; - +export function resolveSystemConfig(systemName: string, config?: SystemConfig, existingContracts?: string[]) { + const name = config?.name ?? systemName; const registerFunctionSelectors = config?.registerFunctionSelectors ?? true; const openAccess = config?.openAccess ?? true; const accessListAddresses: string[] = []; @@ -99,5 +78,5 @@ export function resolveSystemConfig({ } } - return { name, namespace, registerFunctionSelectors, openAccess, accessListAddresses, accessListSystems }; + return { name, registerFunctionSelectors, openAccess, accessListAddresses, accessListSystems }; } diff --git a/packages/world/ts/node/render-solidity/worldgen.ts b/packages/world/ts/node/render-solidity/worldgen.ts index 9babf066ba..4f9c096486 100644 --- a/packages/world/ts/node/render-solidity/worldgen.ts +++ b/packages/world/ts/node/render-solidity/worldgen.ts @@ -6,7 +6,6 @@ import { renderWorldInterface } from "./renderWorldInterface"; import { resolveWorldConfig } from "../../config/resolveWorldConfig"; import { World as WorldConfig } from "../../config/v2/output"; import { worldToV1 } from "../../config/v2/compat"; -import { ROOT_NAMESPACE } from "@latticexyz/common"; export async function worldgen( configV2: WorldConfig, @@ -43,13 +42,10 @@ export async function worldgen( }; } }); - - const { namespace, name } = resolvedConfig.systems[system.basename]; - - const systemInterfaceName = namespace === ROOT_NAMESPACE ? `I${name}` : `${namespace}__I${name}`; + const systemInterfaceName = `I${system.basename}`; const output = renderSystemInterface({ name: systemInterfaceName, - functionPrefix: namespace === ROOT_NAMESPACE ? "" : `${namespace}__`, + functionPrefix: config.namespace === "" ? "" : `${config.namespace}__`, functions, errors, imports, diff --git a/templates/vanilla/packages/contracts/src/codegen/world/app__IIncrementSystem.sol b/templates/phaser/packages/contracts/src/codegen/world/IIncrementSystem.sol similarity index 84% rename from templates/vanilla/packages/contracts/src/codegen/world/app__IIncrementSystem.sol rename to templates/phaser/packages/contracts/src/codegen/world/IIncrementSystem.sol index 335c90833d..39c7df755b 100644 --- a/templates/vanilla/packages/contracts/src/codegen/world/app__IIncrementSystem.sol +++ b/templates/phaser/packages/contracts/src/codegen/world/IIncrementSystem.sol @@ -4,10 +4,10 @@ pragma solidity >=0.8.24; /* Autogenerated file. Do not edit manually. */ /** - * @title app__IIncrementSystem + * @title IIncrementSystem * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) * @dev This interface is automatically generated from the corresponding system contract. Do not edit manually. */ -interface app__IIncrementSystem { +interface IIncrementSystem { function app__increment() external returns (uint32); } diff --git a/templates/phaser/packages/contracts/src/codegen/world/IWorld.sol b/templates/phaser/packages/contracts/src/codegen/world/IWorld.sol index 5afc8294cc..34615b56ae 100644 --- a/templates/phaser/packages/contracts/src/codegen/world/IWorld.sol +++ b/templates/phaser/packages/contracts/src/codegen/world/IWorld.sol @@ -5,7 +5,7 @@ pragma solidity >=0.8.24; import { IBaseWorld } from "@latticexyz/world/src/codegen/interfaces/IBaseWorld.sol"; -import { app__IIncrementSystem } from "./app__IIncrementSystem.sol"; +import { IIncrementSystem } from "./IIncrementSystem.sol"; /** * @title IWorld @@ -14,4 +14,4 @@ import { app__IIncrementSystem } from "./app__IIncrementSystem.sol"; * that are dynamically registered in the World during deployment. * @dev This is an autogenerated file; do not edit manually. */ -interface IWorld is IBaseWorld, app__IIncrementSystem {} +interface IWorld is IBaseWorld, IIncrementSystem {} diff --git a/templates/react-ecs/packages/contracts/src/codegen/world/app__IIncrementSystem.sol b/templates/react-ecs/packages/contracts/src/codegen/world/IIncrementSystem.sol similarity index 84% rename from templates/react-ecs/packages/contracts/src/codegen/world/app__IIncrementSystem.sol rename to templates/react-ecs/packages/contracts/src/codegen/world/IIncrementSystem.sol index 335c90833d..39c7df755b 100644 --- a/templates/react-ecs/packages/contracts/src/codegen/world/app__IIncrementSystem.sol +++ b/templates/react-ecs/packages/contracts/src/codegen/world/IIncrementSystem.sol @@ -4,10 +4,10 @@ pragma solidity >=0.8.24; /* Autogenerated file. Do not edit manually. */ /** - * @title app__IIncrementSystem + * @title IIncrementSystem * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) * @dev This interface is automatically generated from the corresponding system contract. Do not edit manually. */ -interface app__IIncrementSystem { +interface IIncrementSystem { function app__increment() external returns (uint32); } diff --git a/templates/react-ecs/packages/contracts/src/codegen/world/IWorld.sol b/templates/react-ecs/packages/contracts/src/codegen/world/IWorld.sol index 5afc8294cc..34615b56ae 100644 --- a/templates/react-ecs/packages/contracts/src/codegen/world/IWorld.sol +++ b/templates/react-ecs/packages/contracts/src/codegen/world/IWorld.sol @@ -5,7 +5,7 @@ pragma solidity >=0.8.24; import { IBaseWorld } from "@latticexyz/world/src/codegen/interfaces/IBaseWorld.sol"; -import { app__IIncrementSystem } from "./app__IIncrementSystem.sol"; +import { IIncrementSystem } from "./IIncrementSystem.sol"; /** * @title IWorld @@ -14,4 +14,4 @@ import { app__IIncrementSystem } from "./app__IIncrementSystem.sol"; * that are dynamically registered in the World during deployment. * @dev This is an autogenerated file; do not edit manually. */ -interface IWorld is IBaseWorld, app__IIncrementSystem {} +interface IWorld is IBaseWorld, IIncrementSystem {} diff --git a/templates/react/packages/contracts/src/codegen/world/app__ITasksSystem.sol b/templates/react/packages/contracts/src/codegen/world/ITasksSystem.sol similarity index 90% rename from templates/react/packages/contracts/src/codegen/world/app__ITasksSystem.sol rename to templates/react/packages/contracts/src/codegen/world/ITasksSystem.sol index 45177e8c6a..7ac8215848 100644 --- a/templates/react/packages/contracts/src/codegen/world/app__ITasksSystem.sol +++ b/templates/react/packages/contracts/src/codegen/world/ITasksSystem.sol @@ -4,11 +4,11 @@ pragma solidity >=0.8.24; /* Autogenerated file. Do not edit manually. */ /** - * @title app__ITasksSystem + * @title ITasksSystem * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) * @dev This interface is automatically generated from the corresponding system contract. Do not edit manually. */ -interface app__ITasksSystem { +interface ITasksSystem { function app__addTask(string memory description) external returns (bytes32 id); function app__completeTask(bytes32 id) external; diff --git a/templates/react/packages/contracts/src/codegen/world/IWorld.sol b/templates/react/packages/contracts/src/codegen/world/IWorld.sol index eb6433d2ed..b3848a4577 100644 --- a/templates/react/packages/contracts/src/codegen/world/IWorld.sol +++ b/templates/react/packages/contracts/src/codegen/world/IWorld.sol @@ -5,7 +5,7 @@ pragma solidity >=0.8.24; import { IBaseWorld } from "@latticexyz/world/src/codegen/interfaces/IBaseWorld.sol"; -import { app__ITasksSystem } from "./app__ITasksSystem.sol"; +import { ITasksSystem } from "./ITasksSystem.sol"; /** * @title IWorld @@ -14,4 +14,4 @@ import { app__ITasksSystem } from "./app__ITasksSystem.sol"; * that are dynamically registered in the World during deployment. * @dev This is an autogenerated file; do not edit manually. */ -interface IWorld is IBaseWorld, app__ITasksSystem {} +interface IWorld is IBaseWorld, ITasksSystem {} diff --git a/templates/threejs/packages/contracts/src/codegen/world/app__IMoveSystem.sol b/templates/threejs/packages/contracts/src/codegen/world/IMoveSystem.sol similarity index 86% rename from templates/threejs/packages/contracts/src/codegen/world/app__IMoveSystem.sol rename to templates/threejs/packages/contracts/src/codegen/world/IMoveSystem.sol index 989f45350c..33a83db16c 100644 --- a/templates/threejs/packages/contracts/src/codegen/world/app__IMoveSystem.sol +++ b/templates/threejs/packages/contracts/src/codegen/world/IMoveSystem.sol @@ -4,10 +4,10 @@ pragma solidity >=0.8.24; /* Autogenerated file. Do not edit manually. */ /** - * @title app__IMoveSystem + * @title IMoveSystem * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) * @dev This interface is automatically generated from the corresponding system contract. Do not edit manually. */ -interface app__IMoveSystem { +interface IMoveSystem { function app__move(int32 x, int32 y, int32 z) external; } diff --git a/templates/threejs/packages/contracts/src/codegen/world/IWorld.sol b/templates/threejs/packages/contracts/src/codegen/world/IWorld.sol index 1d66149091..d27f33eb9a 100644 --- a/templates/threejs/packages/contracts/src/codegen/world/IWorld.sol +++ b/templates/threejs/packages/contracts/src/codegen/world/IWorld.sol @@ -5,7 +5,7 @@ pragma solidity >=0.8.24; import { IBaseWorld } from "@latticexyz/world/src/codegen/interfaces/IBaseWorld.sol"; -import { app__IMoveSystem } from "./app__IMoveSystem.sol"; +import { IMoveSystem } from "./IMoveSystem.sol"; /** * @title IWorld @@ -14,4 +14,4 @@ import { app__IMoveSystem } from "./app__IMoveSystem.sol"; * that are dynamically registered in the World during deployment. * @dev This is an autogenerated file; do not edit manually. */ -interface IWorld is IBaseWorld, app__IMoveSystem {} +interface IWorld is IBaseWorld, IMoveSystem {} diff --git a/templates/phaser/packages/contracts/src/codegen/world/app__IIncrementSystem.sol b/templates/vanilla/packages/contracts/src/codegen/world/IIncrementSystem.sol similarity index 84% rename from templates/phaser/packages/contracts/src/codegen/world/app__IIncrementSystem.sol rename to templates/vanilla/packages/contracts/src/codegen/world/IIncrementSystem.sol index 335c90833d..39c7df755b 100644 --- a/templates/phaser/packages/contracts/src/codegen/world/app__IIncrementSystem.sol +++ b/templates/vanilla/packages/contracts/src/codegen/world/IIncrementSystem.sol @@ -4,10 +4,10 @@ pragma solidity >=0.8.24; /* Autogenerated file. Do not edit manually. */ /** - * @title app__IIncrementSystem + * @title IIncrementSystem * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) * @dev This interface is automatically generated from the corresponding system contract. Do not edit manually. */ -interface app__IIncrementSystem { +interface IIncrementSystem { function app__increment() external returns (uint32); } diff --git a/templates/vanilla/packages/contracts/src/codegen/world/IWorld.sol b/templates/vanilla/packages/contracts/src/codegen/world/IWorld.sol index 5afc8294cc..34615b56ae 100644 --- a/templates/vanilla/packages/contracts/src/codegen/world/IWorld.sol +++ b/templates/vanilla/packages/contracts/src/codegen/world/IWorld.sol @@ -5,7 +5,7 @@ pragma solidity >=0.8.24; import { IBaseWorld } from "@latticexyz/world/src/codegen/interfaces/IBaseWorld.sol"; -import { app__IIncrementSystem } from "./app__IIncrementSystem.sol"; +import { IIncrementSystem } from "./IIncrementSystem.sol"; /** * @title IWorld @@ -14,4 +14,4 @@ import { app__IIncrementSystem } from "./app__IIncrementSystem.sol"; * that are dynamically registered in the World during deployment. * @dev This is an autogenerated file; do not edit manually. */ -interface IWorld is IBaseWorld, app__IIncrementSystem {} +interface IWorld is IBaseWorld, IIncrementSystem {}