Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix content about dispatcher #132

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/cairo/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Consider this as the most basic Dojo world setup:
- Scarb.toml
```

While seemingly simple, behind the scenes Dojo generates foundational contracts, setting the stage for you to focus purely on data and logic.
While seemingly simple, behind the scenes Dojo generates foundational contracts, setting the stage for you to focus purely on data and logic.

Lets take a look at the `main.cairo`:

Expand Down Expand Up @@ -54,8 +54,7 @@ mod player_actions {

#[external(v0)]
impl PlayerActionsImpl of IPlayerActions<ContractState> {
//
// NOTICE: we pass the world dispatcher as an argument to every function.
//
// This is how we interact with the world contract.
//
fn spawn(self: @ContractState) {
Expand Down Expand Up @@ -87,7 +86,7 @@ Read more about models [here](./models.md).

#### `spawn` function - a dojo system

In the `spawn` function, take note of the second parameter: the `IWorldDispatcher` interface. This provides a gateway to the world contract. By integrating it into the function, it enables the `get!` and `set!` macros to interface directly with the world contract.
In the `spawn` function, we just call `self.world_dispatcher`. This provides a gateway to the world contract. This facilitates the effortless utilization of the get! and set! commands, allowing seamless interaction with the world contract.

Commands, a significant innovation in Dojo, are further explored [here](./commands.md).

Expand Down