diff --git a/templates/react-ecs/packages/client/src/mud/createSystemCalls.ts b/templates/react-ecs/packages/client/src/mud/createSystemCalls.ts index 30b4f7f6b7..e223535070 100644 --- a/templates/react-ecs/packages/client/src/mud/createSystemCalls.ts +++ b/templates/react-ecs/packages/client/src/mud/createSystemCalls.ts @@ -40,7 +40,7 @@ export function createSystemCalls( * is in the root namespace, `.increment` can be called directly * on the World contract. */ - const tx = await worldContract.write.increment(); + const tx = await worldContract.write.counter__increment(); await waitForTransaction(tx); return getComponentValue(Counter, singletonEntity); }; diff --git a/templates/react-ecs/packages/contracts/mud.config.ts b/templates/react-ecs/packages/contracts/mud.config.ts index 4a495d0c4e..f3135d292e 100644 --- a/templates/react-ecs/packages/contracts/mud.config.ts +++ b/templates/react-ecs/packages/contracts/mud.config.ts @@ -1,6 +1,7 @@ import { defineWorld } from "@latticexyz/world"; export default defineWorld({ + namespace: "counter", tables: { Counter: { schema: { diff --git a/templates/react-ecs/packages/contracts/script/PostDeploy.s.sol b/templates/react-ecs/packages/contracts/script/PostDeploy.s.sol index 115adfec53..35244575ce 100644 --- a/templates/react-ecs/packages/contracts/script/PostDeploy.s.sol +++ b/templates/react-ecs/packages/contracts/script/PostDeploy.s.sol @@ -21,7 +21,7 @@ contract PostDeploy is Script { // ------------------ EXAMPLES ------------------ // Call increment on the world via the registered function selector - uint32 newValue = IWorld(worldAddress).increment(); + uint32 newValue = IWorld(worldAddress).counter__increment(); console.log("Increment via IWorld:", newValue); vm.stopBroadcast(); diff --git a/templates/react-ecs/packages/contracts/test/CounterTest.t.sol b/templates/react-ecs/packages/contracts/test/CounterTest.t.sol index 4946ef57ff..7445894f3e 100644 --- a/templates/react-ecs/packages/contracts/test/CounterTest.t.sol +++ b/templates/react-ecs/packages/contracts/test/CounterTest.t.sol @@ -24,7 +24,7 @@ contract CounterTest is MudTest { assertEq(counter, 1); // Expect the counter to be 2 after calling increment. - IWorld(worldAddress).increment(); + IWorld(worldAddress).counter__increment(); counter = Counter.get(); assertEq(counter, 2); }