Skip to content

World Contract

The World in Dojo acts as a comprehensive database, maintaining a registry of all models and systems, while also managing permissions. This centralized contract ensures that every interaction within the Dojo ecosystem is consistent and secure, providing a reliable foundation for game state management and operations.

By abstracting these details with the Dojo macros, developers can focus on building rich, interactive systems without worrying about the underlying data management intricacies.

Each project utilizing the same version of Dojo employs an identical world contract, which is part of the dojo-core library.

Although we suggest strongly to structure your world around an ECS pattern you are not required to do so. You can simply use the dojo-models as a keypair store along with the supporting infrastructure.

Dive into the world contract details:

  • Events emitted by the world to notify the indexer about state changes of the world.
  • Authorization how to grant and revoke permissions to define who can write and read to the world's models.
  • Metadata how to set and get metadata for the world.
  • API the full API of the world contract and some utilities functions.