dojo_cairo_macros 1.7.0
Dojo Cairo proc macros.
This crate contains the proc macros for the Dojo framework.
#[dojo::model]
: Defines a struct as a model.#[dojo::event]
: Defines a struct as an event.#[dojo::contract]
: Defines a struct as a contract.#[derive(Introspect)]
: Makes the struct introspectable, which allows to get the struct metadata at runtime and for offchain components.#[derive(IntrospectPacked)]
: Same as #[derive(Introspect)]
but use this one if you wish your struct to be packed in the storage (usually uses less space).#[derive(DojoStore)]
: Derives DojoStore
trait for the struct, which allows to store the struct in the world's database.#[derive(DojoLegacyStore)]
: Uses the legacy storage API for the struct, only for models that were deployed in a world on mainnet previous to 1.7.0
.More information about the migration to 1.7.0
can be found in the book.
Add the following to your Scarb.toml
file:
[dependencies]
dojo_cairo_macros = "1.7.0"
Version 1.7.0
Uploaded 2 weeks ago
License MIT
Size 39.4 KB
Run the following command in your project dir
scarb add dojo_cairo_macros@1.7.0
Or add the following line to your Scarb.toml
dojo_cairo_macros = "1.7.0"