Skip to content

Commit

Permalink
docs(guides/hello/add system): update for the app namespace 🚗 (#2859)
Browse files Browse the repository at this point in the history
  • Loading branch information
qbzzt authored May 23, 2024
1 parent 46874e4 commit 1e43543
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/pages/guides/hello-world/add-system.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ In this tutorial you add a system to decrement the counter and update the applic
[Create a new MUD application from the template](../../templates/typescript/getting-started).
Use the vanilla template.

```sh copy
pnpm create mud@latest tutorial --template vanilla
cd tutorial
```

## Add a contract for the new system

Create a file `packages/contracts/src/systems/DecrementSystem.sol`.
Expand Down Expand Up @@ -109,13 +114,13 @@ In this case, the vanilla getting started front end.
* 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.app__increment();
await waitForTransaction(tx);
return getComponentValue(Counter, singletonEntity);
};

const decrement = async () => {
const tx = await worldContract.write.decrement();
const tx = await worldContract.write.app__decrement();
await waitForTransaction(tx);
return getComponentValue(Counter, singletonEntity);
};
Expand Down

0 comments on commit 1e43543

Please sign in to comment.