Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

dojo

Fully qualified path: dojo

Modules

contract
event
meta
model
storage
utils
world

Modules

Modules

contract
event
meta
model
storage
utils
world

contract

Fully qualified path: dojo::contract

Modules


Re-exports:




Groups:

dispatchers

Modules

Modules

interface

Fully qualified path: dojo::contract::interface

Modules

Traits


Groups:

dispatchers

Modules

Modules

__external_IContractForwardImpl

Fully qualified path: dojo::contract::interface::__external_IContractForwardImpl

__l1_handler_IContractForwardImpl

Fully qualified path: dojo::contract::interface::__l1_handler_IContractForwardImpl

__constructor_IContractForwardImpl

Fully qualified path: dojo::contract::interface::__constructor_IContractForwardImpl

__external_ILibraryForwardImpl

Fully qualified path: dojo::contract::interface::__external_ILibraryForwardImpl

__l1_handler_ILibraryForwardImpl

Fully qualified path: dojo::contract::interface::__l1_handler_ILibraryForwardImpl

__constructor_ILibraryForwardImpl

Fully qualified path: dojo::contract::interface::__constructor_ILibraryForwardImpl

Traits

Traits

IContract

Fully qualified path: dojo::contract::interface::IContract

pub trait IContract<T>

ILibrary

Fully qualified path: dojo::contract::interface::ILibrary

pub trait ILibrary<T>

UnsafeNewContractStateTraitForIContractForwardImpl

Fully qualified path: dojo::contract::interface::UnsafeNewContractStateTraitForIContractForwardImpl

pub trait UnsafeNewContractStateTraitForIContractForwardImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::contract::interface::UnsafeNewContractStateTraitForIContractForwardImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForILibraryForwardImpl

Fully qualified path: dojo::contract::interface::UnsafeNewContractStateTraitForILibraryForwardImpl

pub trait UnsafeNewContractStateTraitForILibraryForwardImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::contract::interface::UnsafeNewContractStateTraitForILibraryForwardImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

components

Fully qualified path: dojo::contract::components

Modules

Modules

Modules

upgradeable

Fully qualified path: dojo::contract::components::upgradeable

Modules

Traits


Groups:

dispatchers

Modules

Modules

upgradeable_cpt

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt

Modules

Free functions

Structs

Enums

Event

Traits

Modules

Modules

Errors

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Errors

Constants

Constants

Constants

INVALID_CLASS

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Errors::INVALID_CLASS

pub const INVALID_CLASS: felt252 = 624090558047339724222917448946231719296404662567931163800175;

INVALID_CLASS_CONTENT

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Errors::INVALID_CLASS_CONTENT

pub const INVALID_CLASS_CONTENT: felt252 =
    2680448536555713735339089457894821564698468915003290616835807725577076;

INVALID_CALLER

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Errors::INVALID_CALLER

pub const INVALID_CALLER: felt252 = 10484069504843620783117914822889090570483853581985410148;

INVALID_WORLD_ADDRESS

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Errors::INVALID_WORLD_ADDRESS

pub const INVALID_WORLD_ADDRESS: felt252 = 154088300879251175208531552724051232493855893189491;

__external_UpgradeableImpl

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::__external_UpgradeableImpl

__l1_handler_UpgradeableImpl

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::__l1_handler_UpgradeableImpl

__constructor_UpgradeableImpl

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::__constructor_UpgradeableImpl

Free functions

Free functions

unsafe_new_component_state

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::unsafe_new_component_state

pub fn unsafe_new_component_state<TContractState>() -> ComponentState<TContractState>

Structs

Structs

Storage

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Storage

[storage]
pub struct Storage {}

Upgraded

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Upgraded

[derive(Drop, starknet::Event)]
pub struct Upgraded {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Upgraded::class_hash

pub class_hash: ClassHash

ComponentState

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::ComponentState

pub struct ComponentState<TContractState> {}

Enums

Enums

Event

Event

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Event

pub enum Event {
    Upgraded: Upgraded,
}

Variants

Upgraded

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::Event::Upgraded

Upgraded: Upgraded

Traits

Traits

HasComponent

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::HasComponent

pub trait HasComponent<TContractState>

Trait functions

get_component

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::HasComponent::get_component

fn get_component(self: @TContractState) -> @ComponentState<TContractState>

get_component_mut

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::HasComponent::get_component_mut

fn get_component_mut(ref self: TContractState) -> ComponentState<TContractState>

get_contract

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::HasComponent::get_contract

fn get_contract(self: @ComponentState<TContractState>) -> @TContractState

get_contract_mut

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::HasComponent::get_contract_mut

fn get_contract_mut(ref self: ComponentState<TContractState>) -> TContractState

emit

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::HasComponent::emit

fn emit<S, impl IntoImp: Into<S, dojo::contract::components::upgradeable::upgradeable_cpt::Event>>(
    ref self: ComponentState<TContractState>, event: S,
)

UnsafeNewContractStateTraitForUpgradeableImpl

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::UnsafeNewContractStateTraitForUpgradeableImpl

pub trait UnsafeNewContractStateTraitForUpgradeableImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::contract::components::upgradeable::upgradeable_cpt::UnsafeNewContractStateTraitForUpgradeableImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

__external_IUpgradeableForwardImpl

Fully qualified path: dojo::contract::components::upgradeable::__external_IUpgradeableForwardImpl

__l1_handler_IUpgradeableForwardImpl

Fully qualified path: dojo::contract::components::upgradeable::__l1_handler_IUpgradeableForwardImpl

__constructor_IUpgradeableForwardImpl

Fully qualified path: dojo::contract::components::upgradeable::__constructor_IUpgradeableForwardImpl

Traits

Traits

IUpgradeable

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeable

pub trait IUpgradeable<T>

Trait functions

upgrade

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeable::upgrade

fn upgrade(ref self: T, new_class_hash: ClassHash)

UnsafeNewContractStateTraitForIUpgradeableForwardImpl

Fully qualified path: dojo::contract::components::upgradeable::UnsafeNewContractStateTraitForIUpgradeableForwardImpl

pub trait UnsafeNewContractStateTraitForIUpgradeableForwardImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::contract::components::upgradeable::UnsafeNewContractStateTraitForIUpgradeableForwardImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

world_provider

Fully qualified path: dojo::contract::components::world_provider

Modules

Traits


Groups:

dispatchers

Modules

Modules

world_provider_cpt

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt

Modules

Free functions

Structs

Enums

Event

Traits

Impls

Modules

Modules

__external_WorldProviderImpl

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::__external_WorldProviderImpl

__l1_handler_WorldProviderImpl

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::__l1_handler_WorldProviderImpl

__constructor_WorldProviderImpl

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::__constructor_WorldProviderImpl

Free functions

Free functions

unsafe_new_component_state

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::unsafe_new_component_state

pub fn unsafe_new_component_state<TContractState>() -> ComponentState<TContractState>

Structs

Structs

Storage

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::Storage

    [storage]
pub struct Storage { /* private fields */ }

ComponentState

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::ComponentState

pub struct ComponentState<TContractState> {}

Enums

Enums

Event

Event

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::Event

pub enum Event {}

Traits

Traits

HasComponent

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::HasComponent

pub trait HasComponent<TContractState>

Trait functions

get_component

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::HasComponent::get_component

fn get_component(self: @TContractState) -> @ComponentState<TContractState>

get_component_mut

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::HasComponent::get_component_mut

fn get_component_mut(ref self: TContractState) -> ComponentState<TContractState>

get_contract

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::HasComponent::get_contract

fn get_contract(self: @ComponentState<TContractState>) -> @TContractState

get_contract_mut

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::HasComponent::get_contract_mut

fn get_contract_mut(ref self: ComponentState<TContractState>) -> TContractState

emit

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::HasComponent::emit

fn emit<
    S, impl IntoImp: Into<S, dojo::contract::components::world_provider::world_provider_cpt::Event>,
>(
    ref self: ComponentState<TContractState>, event: S,
)

InternalTrait

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::InternalTrait

pub trait InternalTrait<TContractState, +HasComponent<TContractState>>

Trait functions

initializer

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::InternalTrait::initializer

fn initializer(ref self: ComponentState<TContractState>)

UnsafeNewContractStateTraitForWorldProviderImpl

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::UnsafeNewContractStateTraitForWorldProviderImpl

pub trait UnsafeNewContractStateTraitForWorldProviderImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::UnsafeNewContractStateTraitForWorldProviderImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

Impls

Impls

WorldProvider

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::WorldProvider

pub impl WorldProvider<
    TContractState, +HasComponent<TContractState>,
> of IWorldProvider<ComponentState<TContractState>>;

Impl functions

world_dispatcher

Fully qualified path: dojo::contract::components::world_provider::world_provider_cpt::WorldProvider::world_dispatcher

fn world_dispatcher(self: @ComponentState<TContractState>) -> IWorldDispatcher

__external_IWorldProviderForwardImpl

Fully qualified path: dojo::contract::components::world_provider::__external_IWorldProviderForwardImpl

__l1_handler_IWorldProviderForwardImpl

Fully qualified path: dojo::contract::components::world_provider::__l1_handler_IWorldProviderForwardImpl

__constructor_IWorldProviderForwardImpl

Fully qualified path: dojo::contract::components::world_provider::__constructor_IWorldProviderForwardImpl

Traits

Traits

IWorldProvider

Fully qualified path: dojo::contract::components::world_provider::IWorldProvider

pub trait IWorldProvider<T>

Trait functions

world_dispatcher

Fully qualified path: dojo::contract::components::world_provider::IWorldProvider::world_dispatcher

fn world_dispatcher(self: @T) -> IWorldDispatcher

UnsafeNewContractStateTraitForIWorldProviderForwardImpl

Fully qualified path: dojo::contract::components::world_provider::UnsafeNewContractStateTraitForIWorldProviderForwardImpl

pub trait UnsafeNewContractStateTraitForIWorldProviderForwardImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::contract::components::world_provider::UnsafeNewContractStateTraitForIWorldProviderForwardImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

event

Fully qualified path: dojo::event

Modules


Re-exports:


Event
EventDefinition
IEvent
IEventDispatcherTrait
EventStorageA EventStorage trait that abstracts where the storage is and how events are emitted.
EventStorageTest


Groups:

dispatchers

Modules

Modules

component

Fully qualified path: dojo::event::component

Modules

Traits

Modules

Modules

__external_IDeployedEventImpl

Fully qualified path: dojo::event::component::__external_IDeployedEventImpl

__l1_handler_IDeployedEventImpl

Fully qualified path: dojo::event::component::__l1_handler_IDeployedEventImpl

__constructor_IDeployedEventImpl

Fully qualified path: dojo::event::component::__constructor_IDeployedEventImpl

__external_IStoredEventImpl

Fully qualified path: dojo::event::component::__external_IStoredEventImpl

__l1_handler_IStoredEventImpl

Fully qualified path: dojo::event::component::__l1_handler_IStoredEventImpl

__constructor_IStoredEventImpl

Fully qualified path: dojo::event::component::__constructor_IStoredEventImpl

__external_IEventImpl

Fully qualified path: dojo::event::component::__external_IEventImpl

__l1_handler_IEventImpl

Fully qualified path: dojo::event::component::__l1_handler_IEventImpl

__constructor_IEventImpl

Fully qualified path: dojo::event::component::__constructor_IEventImpl

Traits

Traits

UnsafeNewContractStateTraitForIDeployedEventImpl

Fully qualified path: dojo::event::component::UnsafeNewContractStateTraitForIDeployedEventImpl

pub trait UnsafeNewContractStateTraitForIDeployedEventImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::event::component::UnsafeNewContractStateTraitForIDeployedEventImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForIStoredEventImpl

Fully qualified path: dojo::event::component::UnsafeNewContractStateTraitForIStoredEventImpl

pub trait UnsafeNewContractStateTraitForIStoredEventImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::event::component::UnsafeNewContractStateTraitForIStoredEventImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForIEventImpl

Fully qualified path: dojo::event::component::UnsafeNewContractStateTraitForIEventImpl

pub trait UnsafeNewContractStateTraitForIEventImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::event::component::UnsafeNewContractStateTraitForIEventImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

event

Fully qualified path: dojo::event::event

Structs

Traits

Structs

Structs

EventDef

Fully qualified path: dojo::event::event::EventDef

#[derive(Drop, Serde, Debug, PartialEq)]
pub struct EventDef {
    pub name: ByteArray,
    pub layout: Layout,
    pub schema: Struct,
}

Members

name

Fully qualified path: dojo::event::event::EventDef::name

pub name: ByteArray

layout

Fully qualified path: dojo::event::event::EventDef::layout

pub layout: Layout

schema

Fully qualified path: dojo::event::event::EventDef::schema

pub schema: Struct

Traits

Traits

EventDefinition

Fully qualified path: dojo::event::event::EventDefinition

pub trait EventDefinition<E>

Trait functions

name

Fully qualified path: dojo::event::event::EventDefinition::name

fn name() -> ByteArray

Event

Fully qualified path: dojo::event::event::Event

pub trait Event<T>

Trait functions

name

Fully qualified path: dojo::event::event::Event::name

fn name() -> ByteArray

definition

Fully qualified path: dojo::event::event::Event::definition

fn definition() -> EventDef

layout

Fully qualified path: dojo::event::event::Event::layout

fn layout() -> Layout

schema

Fully qualified path: dojo::event::event::Event::schema

fn schema() -> Struct

serialized_keys

Fully qualified path: dojo::event::event::Event::serialized_keys

fn serialized_keys(self: @T) -> Span<felt252>

serialized_values

Fully qualified path: dojo::event::event::Event::serialized_values

fn serialized_values(self: @T) -> Span<felt252>

selector

Returns the selector of the event computed for the given namespace hash.

Fully qualified path: dojo::event::event::Event::selector

fn selector(namespace_hash: felt252) -> felt252

interface

Fully qualified path: dojo::event::interface

Modules

Traits


Groups:

dispatchers

Modules

Modules

__external_IEventForwardImpl

Fully qualified path: dojo::event::interface::__external_IEventForwardImpl

__l1_handler_IEventForwardImpl

Fully qualified path: dojo::event::interface::__l1_handler_IEventForwardImpl

__constructor_IEventForwardImpl

Fully qualified path: dojo::event::interface::__constructor_IEventForwardImpl

Traits

Traits

IEvent

Fully qualified path: dojo::event::interface::IEvent

pub trait IEvent<T>

Trait functions

definition

Fully qualified path: dojo::event::interface::IEvent::definition

fn definition(self: @T) -> EventDef

UnsafeNewContractStateTraitForIEventForwardImpl

Fully qualified path: dojo::event::interface::UnsafeNewContractStateTraitForIEventForwardImpl

pub trait UnsafeNewContractStateTraitForIEventForwardImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::event::interface::UnsafeNewContractStateTraitForIEventForwardImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

storage

Fully qualified path: dojo::event::storage

Traits

EventStorageA EventStorage trait that abstracts where the storage is and how events are emitted.
EventStorageTest

Traits

Traits

EventStorageA EventStorage trait that abstracts where the storage is and how events are emitted.
EventStorageTest

EventStorage

A EventStorage trait that abstracts where the storage is and how events are emitted.

Fully qualified path: dojo::event::storage::EventStorage

pub trait EventStorage<S, E>

Trait functions

emit_event

Fully qualified path: dojo::event::storage::EventStorage::emit_event

fn emit_event(ref self: S, event: @E)

EventStorageTest

Fully qualified path: dojo::event::storage::EventStorageTest

pub trait EventStorageTest<S, E>

Trait functions

emit_event_test

Fully qualified path: dojo::event::storage::EventStorageTest::emit_event_test

fn emit_event_test(ref self: S, event: @E)

meta

Fully qualified path: dojo::meta

Modules


Re-exports:


TyNote that for Array and FixedArray we can’t directly use Ty as it will cause infinite recursion, so we decided to use a Span with one item only. Note also that, now, Torii uses this Span
Layout

IDeployedResourceThe IDeployedResource starknet interface. This is the interface used by offchain components and other contracts to get some info such Dojo name from a deployed resource.
IDeployedResourceDispatcherTrait
IStoredResourceThe IStoredResource starknet interface. This is the interface used by offchain components and other contracts to access to storage related data of a deployed resource.
IStoredResourceDispatcherTrait
Introspect
TyCompareTrait
LayoutCompareTrait


Groups:

dispatchers

Modules

Modules

interface

Fully qualified path: dojo::meta::interface

Modules

Traits

IDeployedResourceThe IDeployedResource starknet interface. This is the interface used by offchain components and other contracts to get some info such Dojo name from a deployed resource.
IStoredResourceThe IStoredResource starknet interface. This is the interface used by offchain components and other contracts to access to storage related data of a deployed resource.
UnsafeNewContractStateTraitForIDeployedResourceForwardImpl
UnsafeNewContractStateTraitForIStoredResourceForwardImpl

Groups:

dispatchers

Modules

Modules

__external_IDeployedResourceForwardImpl

Fully qualified path: dojo::meta::interface::__external_IDeployedResourceForwardImpl

__l1_handler_IDeployedResourceForwardImpl

Fully qualified path: dojo::meta::interface::__l1_handler_IDeployedResourceForwardImpl

__constructor_IDeployedResourceForwardImpl

Fully qualified path: dojo::meta::interface::__constructor_IDeployedResourceForwardImpl

__external_IStoredResourceForwardImpl

Fully qualified path: dojo::meta::interface::__external_IStoredResourceForwardImpl

__l1_handler_IStoredResourceForwardImpl

Fully qualified path: dojo::meta::interface::__l1_handler_IStoredResourceForwardImpl

__constructor_IStoredResourceForwardImpl

Fully qualified path: dojo::meta::interface::__constructor_IStoredResourceForwardImpl

Traits

Traits

IDeployedResourceThe IDeployedResource starknet interface. This is the interface used by offchain components and other contracts to get some info such Dojo name from a deployed resource.
IStoredResourceThe IStoredResource starknet interface. This is the interface used by offchain components and other contracts to access to storage related data of a deployed resource.
UnsafeNewContractStateTraitForIDeployedResourceForwardImpl
UnsafeNewContractStateTraitForIStoredResourceForwardImpl

IDeployedResource

The IDeployedResource starknet interface.

This is the interface used by offchain components and other contracts to get some info such Dojo name from a deployed resource.

Fully qualified path: dojo::meta::interface::IDeployedResource

pub trait IDeployedResource<T>

Trait functions

dojo_name

Fully qualified path: dojo::meta::interface::IDeployedResource::dojo_name

fn dojo_name(self: @T) -> ByteArray

IStoredResource

The IStoredResource starknet interface.

This is the interface used by offchain components and other contracts to access to storage related data of a deployed resource.

Fully qualified path: dojo::meta::interface::IStoredResource

pub trait IStoredResource<T>

Trait functions

layout

Fully qualified path: dojo::meta::interface::IStoredResource::layout

fn layout(self: @T) -> Layout

schema

Fully qualified path: dojo::meta::interface::IStoredResource::schema

fn schema(self: @T) -> Struct

UnsafeNewContractStateTraitForIDeployedResourceForwardImpl

Fully qualified path: dojo::meta::interface::UnsafeNewContractStateTraitForIDeployedResourceForwardImpl

pub trait UnsafeNewContractStateTraitForIDeployedResourceForwardImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::meta::interface::UnsafeNewContractStateTraitForIDeployedResourceForwardImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForIStoredResourceForwardImpl

Fully qualified path: dojo::meta::interface::UnsafeNewContractStateTraitForIStoredResourceForwardImpl

pub trait UnsafeNewContractStateTraitForIStoredResourceForwardImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::meta::interface::UnsafeNewContractStateTraitForIStoredResourceForwardImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

introspect

Fully qualified path: dojo::meta::introspect

Structs

Struct
Enum
Member

Enums

TyNote that for Array and FixedArray we can’t directly use Ty as it will cause infinite recursion, so we decided to use a Span with one item only. Note also that, now, Torii uses this Span

Traits

Impls

Structs

Structs

Struct
Enum
Member

Struct

Fully qualified path: dojo::meta::introspect::Struct

[derive(Copy, Drop, Serde, Debug, PartialEq)]
pub struct Struct {
    pub name: felt252,
    pub attrs: Span<felt252>,
    pub children: Span<Member>,
}

Members

name

Fully qualified path: dojo::meta::introspect::Struct::name

pub name: felt252

attrs

Fully qualified path: dojo::meta::introspect::Struct::attrs

pub attrs: Span<felt252>

children

Fully qualified path: dojo::meta::introspect::Struct::children

pub children: Span<Member>

Enum

Fully qualified path: dojo::meta::introspect::Enum

[derive(Copy, Drop, Serde, Debug, PartialEq)]
pub struct Enum {
    pub name: felt252,
    pub attrs: Span<felt252>,
    pub children: Span<(felt252, Ty)>,
}

Members

name

Fully qualified path: dojo::meta::introspect::Enum::name

pub name: felt252

attrs

Fully qualified path: dojo::meta::introspect::Enum::attrs

pub attrs: Span<felt252>

children

Fully qualified path: dojo::meta::introspect::Enum::children

pub children: Span<(felt252, Ty)>

Member

Fully qualified path: dojo::meta::introspect::Member

#[derive(Copy, Drop, Serde, Debug, PartialEq)]
pub struct Member {
    pub name: felt252,
    pub attrs: Span<felt252>,
    pub ty: Ty,
}

Members

name

Fully qualified path: dojo::meta::introspect::Member::name

pub name: felt252

attrs

Fully qualified path: dojo::meta::introspect::Member::attrs

pub attrs: Span<felt252>

ty

Fully qualified path: dojo::meta::introspect::Member::ty

pub ty: Ty

Enums

Enums

TyNote that for Array and FixedArray we can’t directly use Ty as it will cause infinite recursion, so we decided to use a Span with one item only. Note also that, now, Torii uses this Span

Ty

Note that for Array and FixedArray we can’t directly use Ty as it will cause infinite recursion, so we decided to use a Span with one item only. Note also that, now, Torii uses this Span for specific processing on its side, so it cannot be changed directly by a Box.

Fully qualified path: dojo::meta::introspect::Ty

pub enum Ty {
    Primitive: felt252,
    Struct: Struct,
    Enum: Enum,
    Tuple: Span<Ty>,
    Array: Span<Ty>,
    ByteArray,
    FixedArray: (Span<Ty>, u32),
}

Variants

Primitive

Fully qualified path: dojo::meta::introspect::Ty::Primitive

Primitive: felt252

Struct

Fully qualified path: dojo::meta::introspect::Ty::Struct

Struct: Struct

Enum

Fully qualified path: dojo::meta::introspect::Ty::Enum

Enum: Enum

Tuple

Fully qualified path: dojo::meta::introspect::Ty::Tuple

Tuple: Span<Ty>

Array

Fully qualified path: dojo::meta::introspect::Ty::Array

Array: Span<Ty>

ByteArray

Fully qualified path: dojo::meta::introspect::Ty::ByteArray

ByteArray

FixedArray

Fully qualified path: dojo::meta::introspect::Ty::FixedArray

FixedArray: (Span<Ty>, u32)

Traits

Traits

TyCompareTrait

Fully qualified path: dojo::meta::introspect::TyCompareTrait

pub trait TyCompareTrait<T>

Trait functions

is_a_key_upgrade_of

Fully qualified path: dojo::meta::introspect::TyCompareTrait::is_a_key_upgrade_of

fn is_a_key_upgrade_of(self: @T, old: @T) -> bool

is_an_upgrade_of

Fully qualified path: dojo::meta::introspect::TyCompareTrait::is_an_upgrade_of

fn is_an_upgrade_of(self: @T, old: @T) -> bool

Introspect

Fully qualified path: dojo::meta::introspect::Introspect

pub trait Introspect<T>

Trait functions

size

Fully qualified path: dojo::meta::introspect::Introspect::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect::ty

fn ty() -> Ty

Impls

Impls

Introspect_felt252

Fully qualified path: dojo::meta::introspect::Introspect_felt252

pub impl Introspect_felt252 of Introspect<felt252>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_felt252::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_felt252::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_felt252::ty

fn ty() -> Ty

Introspect_bytes31

Fully qualified path: dojo::meta::introspect::Introspect_bytes31

pub impl Introspect_bytes31 of Introspect<bytes31>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_bytes31::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_bytes31::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_bytes31::ty

fn ty() -> Ty

Introspect_bool

Fully qualified path: dojo::meta::introspect::Introspect_bool

pub impl Introspect_bool of Introspect<bool>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_bool::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_bool::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_bool::ty

fn ty() -> Ty

Introspect_u8

Fully qualified path: dojo::meta::introspect::Introspect_u8

pub impl Introspect_u8 of Introspect<u8>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_u8::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_u8::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_u8::ty

fn ty() -> Ty

Introspect_u16

Fully qualified path: dojo::meta::introspect::Introspect_u16

pub impl Introspect_u16 of Introspect<u16>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_u16::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_u16::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_u16::ty

fn ty() -> Ty

Introspect_u32

Fully qualified path: dojo::meta::introspect::Introspect_u32

pub impl Introspect_u32 of Introspect<u32>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_u32::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_u32::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_u32::ty

fn ty() -> Ty

Introspect_u64

Fully qualified path: dojo::meta::introspect::Introspect_u64

pub impl Introspect_u64 of Introspect<u64>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_u64::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_u64::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_u64::ty

fn ty() -> Ty

Introspect_u128

Fully qualified path: dojo::meta::introspect::Introspect_u128

pub impl Introspect_u128 of Introspect<u128>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_u128::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_u128::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_u128::ty

fn ty() -> Ty

Introspect_u256

Fully qualified path: dojo::meta::introspect::Introspect_u256

pub impl Introspect_u256 of Introspect<u256>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_u256::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_u256::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_u256::ty

fn ty() -> Ty

Introspect_i8

Fully qualified path: dojo::meta::introspect::Introspect_i8

pub impl Introspect_i8 of Introspect<i8>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_i8::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_i8::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_i8::ty

fn ty() -> Ty

Introspect_i16

Fully qualified path: dojo::meta::introspect::Introspect_i16

pub impl Introspect_i16 of Introspect<i16>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_i16::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_i16::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_i16::ty

fn ty() -> Ty

Introspect_i32

Fully qualified path: dojo::meta::introspect::Introspect_i32

pub impl Introspect_i32 of Introspect<i32>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_i32::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_i32::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_i32::ty

fn ty() -> Ty

Introspect_i64

Fully qualified path: dojo::meta::introspect::Introspect_i64

pub impl Introspect_i64 of Introspect<i64>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_i64::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_i64::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_i64::ty

fn ty() -> Ty

Introspect_i128

Fully qualified path: dojo::meta::introspect::Introspect_i128

pub impl Introspect_i128 of Introspect<i128>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_i128::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_i128::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_i128::ty

fn ty() -> Ty

Introspect_address

Fully qualified path: dojo::meta::introspect::Introspect_address

pub impl Introspect_address of Introspect<ContractAddress>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_address::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_address::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_address::ty

fn ty() -> Ty

Introspect_classhash

Fully qualified path: dojo::meta::introspect::Introspect_classhash

pub impl Introspect_classhash of Introspect<ClassHash>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_classhash::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_classhash::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_classhash::ty

fn ty() -> Ty

Introspect_ethaddress

Fully qualified path: dojo::meta::introspect::Introspect_ethaddress

pub impl Introspect_ethaddress of Introspect<EthAddress>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_ethaddress::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_ethaddress::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_ethaddress::ty

fn ty() -> Ty

Introspect_bytearray

Fully qualified path: dojo::meta::introspect::Introspect_bytearray

pub impl Introspect_bytearray of Introspect<ByteArray>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_bytearray::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_bytearray::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_bytearray::ty

fn ty() -> Ty

Introspect_option

Fully qualified path: dojo::meta::introspect::Introspect_option

pub impl Introspect_option<T, +Introspect<T>> of Introspect<Option<T>>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_option::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_option::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_option::ty

fn ty() -> Ty

Introspect_array

Fully qualified path: dojo::meta::introspect::Introspect_array

pub impl Introspect_array<T, +Introspect<T>> of Introspect<Array<T>>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_array::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_array::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_array::ty

fn ty() -> Ty

Introspect_span

Fully qualified path: dojo::meta::introspect::Introspect_span

pub impl Introspect_span<T, +Introspect<T>> of Introspect<Span<T>>;

Impl functions

size

Fully qualified path: dojo::meta::introspect::Introspect_span::size

fn size() -> Option<u32>

layout

Fully qualified path: dojo::meta::introspect::Introspect_span::layout

fn layout() -> Layout

ty

Fully qualified path: dojo::meta::introspect::Introspect_span::ty

fn ty() -> Ty

layout

Fully qualified path: dojo::meta::layout

Free functions

compute_packed_sizeCompute the full size in bytes of a layout, when all the fields are bit-packed. Could be None if at least a field has a dynamic size.
build_legacy_layoutWith the new Dojo storage management (DojoStore trait), variants start from 1, while they were started from 0 in the legacy Dojo storage system….

Structs

Enums

Layout

Traits

Impls

Free functions

Free functions

compute_packed_sizeCompute the full size in bytes of a layout, when all the fields are bit-packed. Could be None if at least a field has a dynamic size.
build_legacy_layoutWith the new Dojo storage management (DojoStore trait), variants start from 1, while they were started from 0 in the legacy Dojo storage system….

compute_packed_size

Compute the full size in bytes of a layout, when all the fields are bit-packed. Could be None if at least a field has a dynamic size.

Fully qualified path: dojo::meta::layout::compute_packed_size

pub fn compute_packed_size(layout: Layout) -> Option<u32>

build_legacy_layout

With the new Dojo storage management (DojoStore trait), variants start from 1, while they were started from 0 in the legacy Dojo storage system. To still support legacy Dojo models, we have to rebuild the legacy storage layout from the new storage layout, meaning that variant selectors have to be decremented by one.

Fully qualified path: dojo::meta::layout::build_legacy_layout

pub fn build_legacy_layout(layout: Layout) -> Layout

Structs

Structs

FieldLayout

Fully qualified path: dojo::meta::layout::FieldLayout

#[derive(Copy, Drop, Serde, Debug, PartialEq)]
pub struct FieldLayout {
    pub selector: felt252,
    pub layout: Layout,
}

Members

selector

Fully qualified path: dojo::meta::layout::FieldLayout::selector

pub selector: felt252

layout

Fully qualified path: dojo::meta::layout::FieldLayout::layout

pub layout: Layout

Enums

Enums

Layout

Layout

Fully qualified path: dojo::meta::layout::Layout

pub enum Layout {
    Fixed: Span<u8>,
    Struct: Span<FieldLayout>,
    Tuple: Span<Layout>,
    Array: Span<Layout>,
    ByteArray,
    Enum: Span<FieldLayout>,
    FixedArray: (Span<Layout>, u32),
}

Variants

Fixed

Fully qualified path: dojo::meta::layout::Layout::Fixed

Fixed: Span<u8>

Struct

Fully qualified path: dojo::meta::layout::Layout::Struct

Struct: Span<FieldLayout>

Tuple

Fully qualified path: dojo::meta::layout::Layout::Tuple

Tuple: Span<Layout>

Array

Fully qualified path: dojo::meta::layout::Layout::Array

Array: Span<Layout>

ByteArray

Fully qualified path: dojo::meta::layout::Layout::ByteArray

ByteArray

Enum

Fully qualified path: dojo::meta::layout::Layout::Enum

Enum: Span<FieldLayout>

FixedArray

Fully qualified path: dojo::meta::layout::Layout::FixedArray

FixedArray: (Span<Layout>, u32)

Traits

Traits

LayoutCompareTrait

Fully qualified path: dojo::meta::layout::LayoutCompareTrait

pub trait LayoutCompareTrait

Trait functions

is_same_type_of

Fully qualified path: dojo::meta::layout::LayoutCompareTrait::is_same_type_of

fn is_same_type_of(self: @Layout, old: @Layout) -> bool

Impls

Impls

LayoutCompareImpl

Fully qualified path: dojo::meta::layout::LayoutCompareImpl

pub impl LayoutCompareImpl of LayoutCompareTrait;

Impl functions

is_same_type_of

Fully qualified path: dojo::meta::layout::LayoutCompareImpl::is_same_type_of

fn is_same_type_of(self: @Layout, old: @Layout) -> bool

model

Fully qualified path: dojo::model

Modules

component
definition
model
model_value
interface
metadataResourceMetadata model.
storage

Re-exports:

ModelDefA plain struct with all the fields of a model definition.
ModelPtrTrait KeyParser defines a trait for parsing keys from a given model. A pointer to a model, which can be expressed by an entity id.
IModelDispatcher
ResourceMetadata

ModelIndexThe ModelIndex provides encapsulation for different ways to access a model’s data….

ModelDefinitionThe ModelDefinition trait. Definition of the model containing all the fields that makes up a model.
KeyParser
ModelThe Model trait. It provides a standardized way to interact with models.
ModelPtrsTraitTrait that defines a method for converting a span of model pointers to a span of model indexes….
ModelValueThe ModelValue trait defines a set of methods that must be implemented by any model value type V .
ModelValueKey
IModelThe IModel starknet interface. This is the interface used by offchain components and other contracts to interact with deployed models.
IModelDispatcherTrait
ModelStorageA ModelStorage trait that abstracts where the storage is. Currently it’s only world storage, but this will be useful when we have other storage solutions (micro worlds).
ModelStorageTestA ModelStorage trait that abstracts where the storage is. Currently it’s only world storage, but this will be useful when we have other storage solutions (micro worlds).
ModelValueStorageA ModelValueStorage trait that abstracts where the storage is.
ModelValueStorageTestA ModelValueStorageTest trait that abstracts where the storage is and bypass the permission checks.


Groups:

dispatchers

Modules

Modules

component
definition
model
model_value
interface
metadataResourceMetadata model.
storage

component

Fully qualified path: dojo::model::component

Modules

Traits

Modules

Modules

__external_IDeployedModelImpl

Fully qualified path: dojo::model::component::__external_IDeployedModelImpl

__l1_handler_IDeployedModelImpl

Fully qualified path: dojo::model::component::__l1_handler_IDeployedModelImpl

__constructor_IDeployedModelImpl

Fully qualified path: dojo::model::component::__constructor_IDeployedModelImpl

__external_IStoredModelImpl

Fully qualified path: dojo::model::component::__external_IStoredModelImpl

__l1_handler_IStoredModelImpl

Fully qualified path: dojo::model::component::__l1_handler_IStoredModelImpl

__constructor_IStoredModelImpl

Fully qualified path: dojo::model::component::__constructor_IStoredModelImpl

__external_IModelImpl

Fully qualified path: dojo::model::component::__external_IModelImpl

__l1_handler_IModelImpl

Fully qualified path: dojo::model::component::__l1_handler_IModelImpl

__constructor_IModelImpl

Fully qualified path: dojo::model::component::__constructor_IModelImpl

Traits

Traits

UnsafeNewContractStateTraitForIDeployedModelImpl

Fully qualified path: dojo::model::component::UnsafeNewContractStateTraitForIDeployedModelImpl

pub trait UnsafeNewContractStateTraitForIDeployedModelImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::model::component::UnsafeNewContractStateTraitForIDeployedModelImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForIStoredModelImpl

Fully qualified path: dojo::model::component::UnsafeNewContractStateTraitForIStoredModelImpl

pub trait UnsafeNewContractStateTraitForIStoredModelImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::model::component::UnsafeNewContractStateTraitForIStoredModelImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForIModelImpl

Fully qualified path: dojo::model::component::UnsafeNewContractStateTraitForIModelImpl

pub trait UnsafeNewContractStateTraitForIModelImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::model::component::UnsafeNewContractStateTraitForIModelImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

definition

Fully qualified path: dojo::model::definition

Structs

ModelDefA plain struct with all the fields of a model definition.

Enums

ModelIndexThe ModelIndex provides encapsulation for different ways to access a model’s data….

Traits

ModelDefinitionThe ModelDefinition trait. Definition of the model containing all the fields that makes up a model.

Structs

Structs

ModelDefA plain struct with all the fields of a model definition.

ModelDef

A plain struct with all the fields of a model definition.

Fully qualified path: dojo::model::definition::ModelDef

#[derive(Drop, Serde, Debug, PartialEq)]
pub struct ModelDef {
    pub name: ByteArray,
    pub layout: Layout,
    pub schema: Struct,
    pub packed_size: Option<u32>,
    pub unpacked_size: Option<u32>,
}

Members

name

Fully qualified path: dojo::model::definition::ModelDef::name

pub name: ByteArray

layout

Fully qualified path: dojo::model::definition::ModelDef::layout

pub layout: Layout

schema

Fully qualified path: dojo::model::definition::ModelDef::schema

pub schema: Struct

packed_size

Fully qualified path: dojo::model::definition::ModelDef::packed_size

pub packed_size: Option<u32>

unpacked_size

Fully qualified path: dojo::model::definition::ModelDef::unpacked_size

pub unpacked_size: Option<u32>

Enums

Enums

ModelIndexThe ModelIndex provides encapsulation for different ways to access a model’s data….

ModelIndex

The ModelIndex provides encapsulation for different ways to access a model’s data.

  • Keys: Access by keys, where each individual key is known, and can be hashed.
  • Id: Access by id, where only the id of the entity is known (keys already hashed).
  • MemberId: Access by member id, where the member id and entity id are known.

Fully qualified path: dojo::model::definition::ModelIndex

pub enum ModelIndex {
    Keys: Span<felt252>,
    Id: felt252,
    MemberId: (felt252, felt252),
}

Variants

Keys

Fully qualified path: dojo::model::definition::ModelIndex::Keys

Keys: Span<felt252>

Id

Fully qualified path: dojo::model::definition::ModelIndex::Id

Id: felt252

MemberId

Fully qualified path: dojo::model::definition::ModelIndex::MemberId

MemberId: (felt252, felt252)

Traits

Traits

ModelDefinitionThe ModelDefinition trait. Definition of the model containing all the fields that makes up a model.

ModelDefinition

The ModelDefinition trait.

Definition of the model containing all the fields that makes up a model.

Fully qualified path: dojo::model::definition::ModelDefinition

pub trait ModelDefinition<T>

Trait functions

name

Fully qualified path: dojo::model::definition::ModelDefinition::name

fn name() -> ByteArray

layout

Fully qualified path: dojo::model::definition::ModelDefinition::layout

fn layout() -> Layout

use_legacy_storage

Fully qualified path: dojo::model::definition::ModelDefinition::use_legacy_storage

fn use_legacy_storage() -> bool

schema

Fully qualified path: dojo::model::definition::ModelDefinition::schema

fn schema() -> Struct

size

Fully qualified path: dojo::model::definition::ModelDefinition::size

fn size() -> Option<u32>

model

Fully qualified path: dojo::model::model

Structs

ModelPtrTrait KeyParser defines a trait for parsing keys from a given model. A pointer to a model, which can be expressed by an entity id.

Traits

ModelPtrsTraitTrait that defines a method for converting a span of model pointers to a span of model indexes….
KeyParser
ModelParserDefines a trait for parsing models, providing methods to serialize keys and values.
ModelThe Model trait. It provides a standardized way to interact with models.

Structs

Structs

ModelPtrTrait KeyParser defines a trait for parsing keys from a given model. A pointer to a model, which can be expressed by an entity id.

ModelPtr

Trait KeyParser defines a trait for parsing keys from a given model.

A pointer to a model, which can be expressed by an entity id.

Fully qualified path: dojo::model::model::ModelPtr

[derive(Copy, Drop, Serde, Debug, PartialEq)]
pub struct ModelPtr<M> {
    pub id: felt252,
}

Members

id

Fully qualified path: dojo::model::model::ModelPtr::id

pub id: felt252

Traits

Traits

ModelPtrsTraitTrait that defines a method for converting a span of model pointers to a span of model indexes….
KeyParser
ModelParserDefines a trait for parsing models, providing methods to serialize keys and values.
ModelThe Model trait. It provides a standardized way to interact with models.

ModelPtrsTrait

Trait that defines a method for converting a span of model pointers to a span of model indexes.

Type Parameters

  • M: The type of the model.

Methods

  • to_indexes(self: Span<ModelPtr<M>>) -> Span<ModelIndex>: Converts the span of model pointers to a span of model indexes.

Fully qualified path: dojo::model::model::ModelPtrsTrait

pub trait ModelPtrsTrait<M>

Trait functions

to_indexes

Fully qualified path: dojo::model::model::ModelPtrsTrait::to_indexes

fn to_indexes(self: Span<ModelPtr<M>>) -> Span<ModelIndex>

to_member_indexes

Fully qualified path: dojo::model::model::ModelPtrsTrait::to_member_indexes

fn to_member_indexes(self: Span<ModelPtr<M>>, field_selector: felt252) -> Span<ModelIndex>

KeyParser

Fully qualified path: dojo::model::model::KeyParser

pub trait KeyParser<M, K>

Trait functions

parse_key

Parses the key from the given model.

Fully qualified path: dojo::model::model::KeyParser::parse_key

fn parse_key(self: @M) -> K

ModelParser

Defines a trait for parsing models, providing methods to serialize keys and values.

Fully qualified path: dojo::model::model::ModelParser

pub trait ModelParser<M>

Trait functions

deserialize

Deserializes raw keys and values into a model struct.

Fully qualified path: dojo::model::model::ModelParser::deserialize

fn deserialize(ref keys: Span<felt252>, ref values: Span<felt252>) -> Option<M>

serialize_keys

Serializes the keys of the model.

Fully qualified path: dojo::model::model::ModelParser::serialize_keys

fn serialize_keys(self: @M) -> Span<felt252>

serialize_values

Serializes the values of the model.

Fully qualified path: dojo::model::model::ModelParser::serialize_values

fn serialize_values(self: @M) -> Span<felt252>

Model

The Model trait.

It provides a standardized way to interact with models.

Fully qualified path: dojo::model::model::Model

pub trait Model<M>

Trait functions

keys

Parses the key from the given model, where K is a type containing the keys of the model.

Fully qualified path: dojo::model::model::Model::keys

fn keys<K, +KeyParser<M, K>>(self: @M) -> K

entity_id

Returns the entity id of the model.

Fully qualified path: dojo::model::model::Model::entity_id

fn entity_id(self: @M) -> felt252

serialized_keys

Returns the keys of the model.

Fully qualified path: dojo::model::model::Model::serialized_keys

fn serialized_keys(self: @M) -> Span<felt252>

serialized_values

Returns the values of the model.

Fully qualified path: dojo::model::model::Model::serialized_values

fn serialized_values(self: @M) -> Span<felt252>

from_serialized

Constructs a model from the given keys and values.

Fully qualified path: dojo::model::model::Model::from_serialized

fn from_serialized(keys: Span<felt252>, values: Span<felt252>) -> Option<M>

from_serialized_subset

Contrutcs a model subset (member or schema) from its serialized value.

Fully qualified path: dojo::model::model::Model::from_serialized_subset

fn from_serialized_subset<T, +Serde<T>, +DojoStore<T>>(value: Span<felt252>) -> Option<T>

serialized_subset

Returns the serialized value of a model subset (member or schema).

Fully qualified path: dojo::model::model::Model::serialized_subset

fn serialized_subset<T, +Serde<T>, +DojoStore<T>>(value: @T) -> Span<felt252>

name

Returns the name of the model. (TODO: internalizing the name_hash could reduce poseidon costs).

Fully qualified path: dojo::model::model::Model::name

fn name() -> ByteArray

schema

Returns the schema of the model.

Fully qualified path: dojo::model::model::Model::schema

fn schema() -> Struct

layout

Returns the memory layout of the model.

Fully qualified path: dojo::model::model::Model::layout

fn layout() -> Layout

field_layout

Returns the layout of a field in the model.

Fully qualified path: dojo::model::model::Model::field_layout

fn field_layout(field_selector: felt252) -> Option<Layout>

use_legacy_storage

Indicates if the model uses the legacy storage (true), or the new one (false).

Fully qualified path: dojo::model::model::Model::use_legacy_storage

fn use_legacy_storage() -> bool

unpacked_size

Returns the unpacked size of the model. Only applicable for fixed size models.

Fully qualified path: dojo::model::model::Model::unpacked_size

fn unpacked_size() -> Option<u32>

packed_size

Returns the packed size of the model. Only applicable for fixed size models.

Fully qualified path: dojo::model::model::Model::packed_size

fn packed_size() -> Option<u32>

instance_layout

Returns the instance selector of the model.

Fully qualified path: dojo::model::model::Model::instance_layout

fn instance_layout(self: @M) -> Layout

definition

Returns the definition of the model.

Fully qualified path: dojo::model::model::Model::definition

fn definition() -> ModelDef

selector

Returns the selector of the model computed for the given namespace hash.

Fully qualified path: dojo::model::model::Model::selector

fn selector(namespace_hash: felt252) -> felt252

ptr_from_keys

Returns the pointer to the model from the keys.

Fully qualified path: dojo::model::model::Model::ptr_from_keys

fn ptr_from_keys<K, +Serde<K>, +Drop<K>>(keys: K) -> ModelPtr<M>

ptr_from_serialized_keys

Returns the pointer to the model from the serialised keys.

Fully qualified path: dojo::model::model::Model::ptr_from_serialized_keys

fn ptr_from_serialized_keys(keys: Span<felt252>) -> ModelPtr<M>

ptr_from_id

Returns the pointer to the model from the entity id.

Fully qualified path: dojo::model::model::Model::ptr_from_id

fn ptr_from_id(entity_id: felt252) -> ModelPtr<M>

ptrs_from_keys

Returns the pointers to models from the keys.

Fully qualified path: dojo::model::model::Model::ptrs_from_keys

fn ptrs_from_keys<K, +Serde<K>, +Drop<K>>(keys: Span<K>) -> Span<ModelPtr<M>>

ptrs_from_serialized_keys

Returns the pointers to models from the serialised keys.

Fully qualified path: dojo::model::model::Model::ptrs_from_serialized_keys

fn ptrs_from_serialized_keys(keys: Span<Span<felt252>>) -> Span<ModelPtr<M>>

ptrs_from_ids

Returns the pointers to models from the entity ids.

Fully qualified path: dojo::model::model::Model::ptrs_from_ids

fn ptrs_from_ids(entity_ids: Span<felt252>) -> Span<ModelPtr<M>>

ptr

Returns the ptr of the model.

Fully qualified path: dojo::model::model::Model::ptr

fn ptr(self: @M) -> ModelPtr<M>

model_value

Fully qualified path: dojo::model::model_value

Traits

ModelValueKey
ModelValueParserTrait ModelValueParser defines the interface for parsing and serializing entities of type V .
ModelValueThe ModelValue trait defines a set of methods that must be implemented by any model value type V .

Traits

Traits

ModelValueKey
ModelValueParserTrait ModelValueParser defines the interface for parsing and serializing entities of type V .
ModelValueThe ModelValue trait defines a set of methods that must be implemented by any model value type V .

ModelValueKey

Fully qualified path: dojo::model::model_value::ModelValueKey

pub trait ModelValueKey<V, K>

ModelValueParser

Trait ModelValueParser defines the interface for parsing and serializing entities of type V.

Fully qualified path: dojo::model::model_value::ModelValueParser

pub trait ModelValueParser<V>

Trait functions

deserialize

Deserializes the values of the model into a ModelValue struct.

Fully qualified path: dojo::model::model_value::ModelValueParser::deserialize

fn deserialize(ref values: Span<felt252>) -> Option<V>

serialize_values

Serializes the values of the model and returns them as a Span<felt252>.

Fully qualified path: dojo::model::model_value::ModelValueParser::serialize_values

fn serialize_values(self: @V) -> Span<felt252>

ModelValue

The ModelValue trait defines a set of methods that must be implemented by any model value type V.

Fully qualified path: dojo::model::model_value::ModelValue

pub trait ModelValue<V>

Trait functions

serialized_values

Returns a span of values associated with the entity, every field of a model that is not a key.

Fully qualified path: dojo::model::model_value::ModelValue::serialized_values

fn serialized_values(self: @V) -> Span<felt252>

from_serialized

Constructs a model value from its identifier and values.

Fully qualified path: dojo::model::model_value::ModelValue::from_serialized

fn from_serialized(values: Span<felt252>) -> Option<V>

name

Returns the name of the model value type.

Fully qualified path: dojo::model::model_value::ModelValue::name

fn name() -> ByteArray

layout

Returns the layout of the model value type.

Fully qualified path: dojo::model::model_value::ModelValue::layout

fn layout() -> Layout

instance_layout

Returns the layout of the model value.

Fully qualified path: dojo::model::model_value::ModelValue::instance_layout

fn instance_layout(self: @V) -> Layout

selector

Returns the selector of the model value type with the given namespace hash.

Fully qualified path: dojo::model::model_value::ModelValue::selector

fn selector(namespace_hash: felt252) -> felt252

interface

Fully qualified path: dojo::model::interface

Modules

Traits

IModelThe IModel starknet interface. This is the interface used by offchain components and other contracts to interact with deployed models.
UnsafeNewContractStateTraitForIModelForwardImpl

Groups:

dispatchers

Modules

Modules

__external_IModelForwardImpl

Fully qualified path: dojo::model::interface::__external_IModelForwardImpl

__l1_handler_IModelForwardImpl

Fully qualified path: dojo::model::interface::__l1_handler_IModelForwardImpl

__constructor_IModelForwardImpl

Fully qualified path: dojo::model::interface::__constructor_IModelForwardImpl

Traits

Traits

IModelThe IModel starknet interface. This is the interface used by offchain components and other contracts to interact with deployed models.
UnsafeNewContractStateTraitForIModelForwardImpl

IModel

The IModel starknet interface.

This is the interface used by offchain components and other contracts to interact with deployed models.

Fully qualified path: dojo::model::interface::IModel

pub trait IModel<T>

Trait functions

unpacked_size

Fully qualified path: dojo::model::interface::IModel::unpacked_size

fn unpacked_size(self: @T) -> Option<u32>

packed_size

Fully qualified path: dojo::model::interface::IModel::packed_size

fn packed_size(self: @T) -> Option<u32>

definition

Fully qualified path: dojo::model::interface::IModel::definition

fn definition(self: @T) -> ModelDef

use_legacy_storage

Fully qualified path: dojo::model::interface::IModel::use_legacy_storage

fn use_legacy_storage(self: @T) -> bool

UnsafeNewContractStateTraitForIModelForwardImpl

Fully qualified path: dojo::model::interface::UnsafeNewContractStateTraitForIModelForwardImpl

pub trait UnsafeNewContractStateTraitForIModelForwardImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: dojo::model::interface::UnsafeNewContractStateTraitForIModelForwardImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

metadata

ResourceMetadata model.

Fully qualified path: dojo::model::metadata

Free functions

Structs

Free functions

Free functions

resource_metadata_selector

Fully qualified path: dojo::model::metadata::resource_metadata_selector

pub fn resource_metadata_selector(default_namespace_hash: felt252) -> felt252

Structs

Structs

ResourceMetadata

Fully qualified path: dojo::model::metadata::ResourceMetadata

[derive(PartialEq, Clone, Debug)]
[dojo::model]
pub struct ResourceMetadata {
    pub resource_id: felt252,
    pub metadata_uri: ByteArray,
    pub metadata_hash: felt252,
}

Members

resource_id

Fully qualified path: dojo::model::metadata::ResourceMetadata::resource_id

pub resource_id: felt252

metadata_uri

Fully qualified path: dojo::model::metadata::ResourceMetadata::metadata_uri

pub metadata_uri: ByteArray

metadata_hash

Fully qualified path: dojo::model::metadata::ResourceMetadata::metadata_hash

pub metadata_hash: felt252

storage

Fully qualified path: dojo::model::storage

Traits

ModelStorageA ModelStorage trait that abstracts where the storage is. Currently it’s only world storage, but this will be useful when we have other storage solutions (micro worlds).
ModelValueStorageA ModelValueStorage trait that abstracts where the storage is.
ModelStorageTestA ModelStorage trait that abstracts where the storage is. Currently it’s only world storage, but this will be useful when we have other storage solutions (micro worlds).
ModelValueStorageTestA ModelValueStorageTest trait that abstracts where the storage is and bypass the permission checks.

Traits

Traits

ModelStorageA ModelStorage trait that abstracts where the storage is. Currently it’s only world storage, but this will be useful when we have other storage solutions (micro worlds).
ModelValueStorageA ModelValueStorage trait that abstracts where the storage is.
ModelStorageTestA ModelStorage trait that abstracts where the storage is. Currently it’s only world storage, but this will be useful when we have other storage solutions (micro worlds).
ModelValueStorageTestA ModelValueStorageTest trait that abstracts where the storage is and bypass the permission checks.

ModelStorage

A ModelStorage trait that abstracts where the storage is.

Currently it’s only world storage, but this will be useful when we have other storage solutions (micro worlds).

Fully qualified path: dojo::model::storage::ModelStorage

pub trait ModelStorage<S, M>

Trait functions

write_model

Sets a model of type M.

Fully qualified path: dojo::model::storage::ModelStorage::write_model

fn write_model(ref self: S, model: @M)

write_models

Sets multiple models of type M.

Fully qualified path: dojo::model::storage::ModelStorage::write_models

fn write_models(ref self: S, models: Span<@M>)

read_model

Retrieves a model of type M using the provided key of type K.

Fully qualified path: dojo::model::storage::ModelStorage::read_model

fn read_model<K, +Drop<K>, +Serde<K>>(self: @S, keys: K) -> M

read_models

Retrieves multiple models of type M using the provided keys of type K. Returnes an array to ensure the user can consume the models, even if the type is not copiable.

Fully qualified path: dojo::model::storage::ModelStorage::read_models

fn read_models<K, +Drop<K>, +Serde<K>>(self: @S, keys: Span<K>) -> Array<M>

erase_model

Deletes a model of type M.

Fully qualified path: dojo::model::storage::ModelStorage::erase_model

fn erase_model(ref self: S, model: @M)

erase_models

Deletes multiple models of type M.

Fully qualified path: dojo::model::storage::ModelStorage::erase_models

fn erase_models(ref self: S, models: Span<@M>)

erase_model_ptr

Deletes a model of type M using the provided entity id. The ptr is mostly used for type inferrence.

Fully qualified path: dojo::model::storage::ModelStorage::erase_model_ptr

fn erase_model_ptr(ref self: S, ptr: ModelPtr<M>)

erase_models_ptrs

Deletes a model of type M using the provided entity id. The ptr is mostly used for type inferrence.

Fully qualified path: dojo::model::storage::ModelStorage::erase_models_ptrs

fn erase_models_ptrs(ref self: S, ptrs: Span<ModelPtr<M>>)

read_member

Retrieves a single member from a model.

Fully qualified path: dojo::model::storage::ModelStorage::read_member

fn read_member<T, +Serde<T>, +DojoStore<T>>(
    self: @S, ptr: ModelPtr<M>, field_selector: felt252,
) -> T

read_member_of_models

Retrieves a single member from multiple models.

Fully qualified path: dojo::model::storage::ModelStorage::read_member_of_models

fn read_member_of_models<T, +Serde<T>, +DojoStore<T>, +Drop<T>>(
    self: @S, ptrs: Span<ModelPtr<M>>, field_selector: felt252,
) -> Array<T>

write_member

Updates a member of a model.

Fully qualified path: dojo::model::storage::ModelStorage::write_member

fn write_member<T, +Serde<T>, +DojoStore<T>, +Drop<T>>(
    ref self: S, ptr: ModelPtr<M>, field_selector: felt252, value: T,
)

write_member_of_models

Updates a member of multiple models.

Fully qualified path: dojo::model::storage::ModelStorage::write_member_of_models

fn write_member_of_models<T, +Serde<T>, +DojoStore<T>, +Drop<T>>(
    ref self: S, ptrs: Span<ModelPtr<M>>, field_selector: felt252, values: Span<T>,
)

read_schema

Retrieves a subset of members in a model, matching a defined schema .

Fully qualified path: dojo::model::storage::ModelStorage::read_schema

fn read_schema<T, +Serde<T>, +DojoStore<T>, +Introspect<T>>(self: @S, ptr: ModelPtr<M>) -> T

read_schemas

Retrieves part of multiple models, matching a schema.

Fully qualified path: dojo::model::storage::ModelStorage::read_schemas

fn read_schemas<T, +Drop<T>, +Serde<T>, +DojoStore<T>, +Introspect<T>>(
    self: @S, ptrs: Span<ModelPtr<M>>,
) -> Array<T>

read_member_legacy

— legacy functions — due to the fact that the generic type T of original functions have to be constrained to Serde and DojoStore and legacy model inner structs do not implement DojoStore. Retrieves a single member from a model.

Fully qualified path: dojo::model::storage::ModelStorage::read_member_legacy

fn read_member_legacy<T, +Serde<T>>(self: @S, ptr: ModelPtr<M>, field_selector: felt252) -> T

read_member_of_models_legacy

Retrieves a single member from multiple models.

Fully qualified path: dojo::model::storage::ModelStorage::read_member_of_models_legacy

fn read_member_of_models_legacy<T, +Serde<T>, +Drop<T>>(
    self: @S, ptrs: Span<ModelPtr<M>>, field_selector: felt252,
) -> Array<T>

write_member_legacy

Updates a member of a model.

Fully qualified path: dojo::model::storage::ModelStorage::write_member_legacy

fn write_member_legacy<T, +Serde<T>, +Drop<T>>(
    ref self: S, ptr: ModelPtr<M>, field_selector: felt252, value: T,
)

write_member_of_models_legacy

Updates a member of multiple models.

Fully qualified path: dojo::model::storage::ModelStorage::write_member_of_models_legacy

fn write_member_of_models_legacy<T, +Serde<T>, +Drop<T>>(
    ref self: S, ptrs: Span<ModelPtr<M>>, field_selector: felt252, values: Span<T>,
)

read_schema_legacy

Retrieves a subset of members in a model, matching a defined schema .

Fully qualified path: dojo::model::storage::ModelStorage::read_schema_legacy

fn read_schema_legacy<T, +Serde<T>, +Introspect<T>>(self: @S, ptr: ModelPtr<M>) -> T

read_schemas_legacy

Retrieves part of multiple models, matching a schema.

Fully qualified path: dojo::model::storage::ModelStorage::read_schemas_legacy

fn read_schemas_legacy<T, +Drop<T>, +Serde<T>, +Introspect<T>>(
    self: @S, ptrs: Span<ModelPtr<M>>,
) -> Array<T>

namespace_hash

Returns the current namespace hash.

Fully qualified path: dojo::model::storage::ModelStorage::namespace_hash

fn namespace_hash(self: @S) -> felt252

ModelValueStorage

A ModelValueStorage trait that abstracts where the storage is.

Fully qualified path: dojo::model::storage::ModelValueStorage

pub trait ModelValueStorage<S, V>

Trait functions

read_value

Retrieves a model value of type V using the provided key of type K.

Fully qualified path: dojo::model::storage::ModelValueStorage::read_value

fn read_value<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(self: @S, keys: K) -> V

read_values

Retrieves multiple model values of type V using the provided keys of type K.

Fully qualified path: dojo::model::storage::ModelValueStorage::read_values

fn read_values<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(self: @S, keys: Span<K>) -> Array<V>

read_value_from_id

Retrieves a model value of type V using the provided entity id.

Fully qualified path: dojo::model::storage::ModelValueStorage::read_value_from_id

fn read_value_from_id(self: @S, entity_id: felt252) -> V

read_values_from_ids

Retrieves multiple model values of type V using the provided entity ids.

Fully qualified path: dojo::model::storage::ModelValueStorage::read_values_from_ids

fn read_values_from_ids(self: @S, entity_ids: Span<felt252>) -> Array<V>

write_value

Updates a model value of type V.

Fully qualified path: dojo::model::storage::ModelValueStorage::write_value

fn write_value<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(ref self: S, keys: K, value: @V)

write_values

Updates multiple model values of type V.

Fully qualified path: dojo::model::storage::ModelValueStorage::write_values

fn write_values<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(
    ref self: S, keys: Span<K>, values: Span<@V>,
)

write_value_from_id

Updates a model value of type V.

Fully qualified path: dojo::model::storage::ModelValueStorage::write_value_from_id

fn write_value_from_id(ref self: S, entity_id: felt252, value: @V)

write_values_from_ids

Updates multiple model values of type V.

Fully qualified path: dojo::model::storage::ModelValueStorage::write_values_from_ids

fn write_values_from_ids(ref self: S, entity_ids: Span<felt252>, values: Span<@V>)

ModelStorageTest

A ModelStorage trait that abstracts where the storage is.

Currently it’s only world storage, but this will be useful when we have other storage solutions (micro worlds).

Fully qualified path: dojo::model::storage::ModelStorageTest

pub trait ModelStorageTest<S, M>

Trait functions

write_model_test

Sets a model of type M.

Fully qualified path: dojo::model::storage::ModelStorageTest::write_model_test

fn write_model_test(ref self: S, model: @M)

write_models_test

Sets multiple models of type M.

Fully qualified path: dojo::model::storage::ModelStorageTest::write_models_test

fn write_models_test(ref self: S, models: Span<@M>)

erase_model_test

Deletes a model of type M.

Fully qualified path: dojo::model::storage::ModelStorageTest::erase_model_test

fn erase_model_test(ref self: S, model: @M)

erase_models_test

Deletes multiple models of type M.

Fully qualified path: dojo::model::storage::ModelStorageTest::erase_models_test

fn erase_models_test(ref self: S, models: Span<@M>)

erase_model_ptr_test

Deletes a model of type M using the provided entity id.

Fully qualified path: dojo::model::storage::ModelStorageTest::erase_model_ptr_test

fn erase_model_ptr_test(ref self: S, ptr: ModelPtr<M>)

erase_models_ptrs_test

Deletes multiple models of type M using the provided entity ids.

Fully qualified path: dojo::model::storage::ModelStorageTest::erase_models_ptrs_test

fn erase_models_ptrs_test(ref self: S, ptrs: Span<ModelPtr<M>>)

ModelValueStorageTest

A ModelValueStorageTest trait that abstracts where the storage is and bypass the permission checks.

Fully qualified path: dojo::model::storage::ModelValueStorageTest

pub trait ModelValueStorageTest<S, V>

Trait functions

write_value_test

Updates a model value of type V.

Fully qualified path: dojo::model::storage::ModelValueStorageTest::write_value_test

fn write_value_test<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(ref self: S, keys: K, value: @V)

write_values_test

Updates multiple model values of type V.

Fully qualified path: dojo::model::storage::ModelValueStorageTest::write_values_test

fn write_values_test<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(
    ref self: S, keys: Span<K>, values: Span<@V>,
)

write_value_from_id_test

Updates a model value of type V.

Fully qualified path: dojo::model::storage::ModelValueStorageTest::write_value_from_id_test

fn write_value_from_id_test(ref self: S, entity_id: felt252, value: @V)

write_values_from_ids_test

Updates multiple model values of type V.

Fully qualified path: dojo::model::storage::ModelValueStorageTest::write_values_from_ids_test

fn write_values_from_ids_test(ref self: S, entity_ids: Span<felt252>, values: Span<@V>)

storage

Fully qualified path: dojo::storage

Modules

database
dojo_store
entity_modelStorage operations for models and entities.
layout
packing
storage

Re-exports:

DojoStoreHandle data (de)serialization to be stored into the world storage.

Modules

Modules

database
dojo_store
entity_modelStorage operations for models and entities.
layout
packing
storage

database

Fully qualified path: dojo::storage::database

Constants

Free functions

fill_with_zeroesFill the provided array with zeroes….
get_single
getRead a record from a table, with its ID and layout….
set_single
delete_single
setWrite a record with its ID, layout and new value….
deletedelete a record from a table with its ID and layout….
set_arrayWrite a part of an array nested in value , delimited by an offset and a size….
get_arrayRead an array….

Constants

Constants

MAX_ARRAY_LENGTH

Fully qualified path: dojo::storage::database::MAX_ARRAY_LENGTH

pub const MAX_ARRAY_LENGTH: u256 = 4294967295;

Free functions

Free functions

fill_with_zeroesFill the provided array with zeroes….
get_single
getRead a record from a table, with its ID and layout….
set_single
delete_single
setWrite a record with its ID, layout and new value….
deletedelete a record from a table with its ID and layout….
set_arrayWrite a part of an array nested in value , delimited by an offset and a size….
get_arrayRead an array….

fill_with_zeroes

Fill the provided array with zeroes.

Arguments

  • values - the array to fill
  • size - the number of zero to append in the array

Fully qualified path: dojo::storage::database::fill_with_zeroes

pub fn fill_with_zeroes(ref values: Array<felt252>, size: u32)

get_single

Fully qualified path: dojo::storage::database::get_single

pub fn get_single(table: felt252, key: felt252) -> felt252

get

Read a record from a table, with its ID and layout.

Arguments

  • table - the table selector
  • key - key of the record to read
  • layout - the layout of the record to read.

Returns

A Span<felt252> containing the raw unpacked data of the read record.

Fully qualified path: dojo::storage::database::get

pub fn get(table: felt252, key: felt252, layout: Span<u8>) -> Span<felt252>

set_single

Fully qualified path: dojo::storage::database::set_single

pub fn set_single(table: felt252, key: felt252, value: felt252)

delete_single

Fully qualified path: dojo::storage::database::delete_single

pub fn delete_single(table: felt252, key: felt252)

set

Write a record with its ID, layout and new value.

Arguments

  • table - the table selector
  • key - key of the record to write
  • value - the new raw unpacked data value of the record
  • offset - the offset in value to start writing from
  • layout - the layout of the record to write.

Fully qualified path: dojo::storage::database::set

pub fn set(table: felt252, key: felt252, value: Span<felt252>, offset: u32, layout: Span<u8>)

delete

delete a record from a table with its ID and layout.

Arguments

  • table - the table selector
  • key - key of the record to delete
  • layout - the layout of the record to delete

Fully qualified path: dojo::storage::database::delete

pub fn delete(table: felt252, key: felt252, layout: Span<u8>)

set_array

Write a part of an array nested in value, delimited by an offset and a size.

Arguments

  • table - the table selector
  • key - key of the record to write
  • value - the new raw unpacked data value of the record
  • offset - the beginning of the nested array to write
  • array_size - the size of the nested array to write

Fully qualified path: dojo::storage::database::set_array

pub fn set_array(table: felt252, key: felt252, value: Span<felt252>, offset: u32, array_size: u32)

get_array

Read an array.

Arguments

  • table - the table selector
  • key - key of the record to write
  • array_size - the size of the array to read.

Returns

Fully qualified path: dojo::storage::database::get_array

pub fn get_array(table: felt252, key: felt252, array_size: u32) -> Span<felt252>

dojo_store

Fully qualified path: dojo::storage::dojo_store

Impl aliases

Traits

DojoStoreHandle data (de)serialization to be stored into the world storage.

Impl aliases

Impl aliases

DojoStore_felt252

Fully qualified path: dojo::storage::dojo_store::DojoStore_felt252

pub impl DojoStore_felt252 = default_impl::SerdeBasedDojoStore<felt252>;

DojoStore_bool

Fully qualified path: dojo::storage::dojo_store::DojoStore_bool

pub impl DojoStore_bool = default_impl::SerdeBasedDojoStore<bool>;

DojoStore_u8

Fully qualified path: dojo::storage::dojo_store::DojoStore_u8

pub impl DojoStore_u8 = default_impl::SerdeBasedDojoStore<u8>;

DojoStore_u16

Fully qualified path: dojo::storage::dojo_store::DojoStore_u16

pub impl DojoStore_u16 = default_impl::SerdeBasedDojoStore<u16>;

DojoStore_u32

Fully qualified path: dojo::storage::dojo_store::DojoStore_u32

pub impl DojoStore_u32 = default_impl::SerdeBasedDojoStore<u32>;

DojoStore_u64

Fully qualified path: dojo::storage::dojo_store::DojoStore_u64

pub impl DojoStore_u64 = default_impl::SerdeBasedDojoStore<u64>;

DojoStore_u128

Fully qualified path: dojo::storage::dojo_store::DojoStore_u128

pub impl DojoStore_u128 = default_impl::SerdeBasedDojoStore<u128>;

DojoStore_u256

Fully qualified path: dojo::storage::dojo_store::DojoStore_u256

pub impl DojoStore_u256 = default_impl::SerdeBasedDojoStore<u256>;

DojoStore_i8

Fully qualified path: dojo::storage::dojo_store::DojoStore_i8

pub impl DojoStore_i8 = default_impl::SerdeBasedDojoStore<i8>;

DojoStore_i16

Fully qualified path: dojo::storage::dojo_store::DojoStore_i16

pub impl DojoStore_i16 = default_impl::SerdeBasedDojoStore<i16>;

DojoStore_i32

Fully qualified path: dojo::storage::dojo_store::DojoStore_i32

pub impl DojoStore_i32 = default_impl::SerdeBasedDojoStore<i32>;

DojoStore_i64

Fully qualified path: dojo::storage::dojo_store::DojoStore_i64

pub impl DojoStore_i64 = default_impl::SerdeBasedDojoStore<i64>;

DojoStore_i128

Fully qualified path: dojo::storage::dojo_store::DojoStore_i128

pub impl DojoStore_i128 = default_impl::SerdeBasedDojoStore<i128>;

DojoStore_ContractAddress

Fully qualified path: dojo::storage::dojo_store::DojoStore_ContractAddress

pub impl DojoStore_ContractAddress = default_impl::SerdeBasedDojoStore<starknet::ContractAddress>;

DojoStore_ClassHash

Fully qualified path: dojo::storage::dojo_store::DojoStore_ClassHash

pub impl DojoStore_ClassHash = default_impl::SerdeBasedDojoStore<starknet::ClassHash>;

DojoStore_EthAddress

Fully qualified path: dojo::storage::dojo_store::DojoStore_EthAddress

pub impl DojoStore_EthAddress = default_impl::SerdeBasedDojoStore<starknet::EthAddress>;

DojoStore_ByteArray

Fully qualified path: dojo::storage::dojo_store::DojoStore_ByteArray

pub impl DojoStore_ByteArray = default_impl::SerdeBasedDojoStore<ByteArray>;

Traits

Traits

DojoStoreHandle data (de)serialization to be stored into the world storage.

DojoStore

Handle data (de)serialization to be stored into the world storage.

Fully qualified path: dojo::storage::dojo_store::DojoStore

pub trait DojoStore<T>

Trait functions

dojo_serialize

Fully qualified path: dojo::storage::dojo_store::DojoStore::dojo_serialize

fn dojo_serialize(self: @T, ref serialized: Array<felt252>)

dojo_deserialize

Fully qualified path: dojo::storage::dojo_store::DojoStore::dojo_deserialize

fn dojo_deserialize(ref values: Span<felt252>) -> Option<T>

entity_model

Storage operations for models and entities.

Fully qualified path: dojo::storage::entity_model

Free functions

write_model_entityWrite a new entity….
delete_model_entityDelete an entity….
read_model_entityRead an entity….
read_model_memberRead a model member value….
write_model_memberWrite a model member value….

Free functions

Free functions

write_model_entityWrite a new entity….
delete_model_entityDelete an entity….
read_model_entityRead an entity….
read_model_memberRead a model member value….
write_model_memberWrite a model member value….

write_model_entity

Write a new entity.

Arguments

  • model_selector - the model selector
  • entity_id - the id used to identify the record
  • values - the field values of the record
  • layout - the model layout

Fully qualified path: dojo::storage::entity_model::write_model_entity

pub fn write_model_entity(
    model_selector: felt252, entity_id: felt252, values: Span<felt252>, layout: Layout,
)

delete_model_entity

Delete an entity.

Arguments

  • model_selector - the model selector
  • entity_id - the ID of the entity to remove.
  • layout - the model layout

Fully qualified path: dojo::storage::entity_model::delete_model_entity

pub fn delete_model_entity(model_selector: felt252, entity_id: felt252, layout: Layout)

read_model_entity

Read an entity.

Arguments

  • model_selector - the model selector
  • entity_id - the ID of the entity to read.
  • layout - the model layout

Fully qualified path: dojo::storage::entity_model::read_model_entity

pub fn read_model_entity(
    model_selector: felt252, entity_id: felt252, layout: Layout,
) -> Span<felt252>

read_model_member

Read a model member value.

Arguments

  • model_selector - the model selector
  • entity_id - the ID of the entity for which to read a member.
  • member_id - the selector of the model member to read.
  • layout - the model layout

Fully qualified path: dojo::storage::entity_model::read_model_member

pub fn read_model_member(
    model_selector: felt252, entity_id: felt252, member_id: felt252, layout: Layout,
) -> Span<felt252>

write_model_member

Write a model member value.

Arguments

  • model_selector - the model selector
  • entity_id - the ID of the entity for which to write a member.
  • member_id - the selector of the model member to write.
  • values - the new member value.
  • layout - the model layout

Fully qualified path: dojo::storage::entity_model::write_model_member

pub fn write_model_member(
    model_selector: felt252,
    entity_id: felt252,
    member_id: felt252,
    values: Span<felt252>,
    layout: Layout,
)

layout

Fully qualified path: dojo::storage::layout

Free functions

write_layoutWrite values to the world storage….
write_fixed_layoutWrite fixed layout model record to the world storage….
write_array_layoutWrite array layout model record to the world storage….
write_fixed_array_layoutWrite fixed array layout model record to the world storage….
write_byte_array_layout
write_struct_layoutWrite struct layout model record to the world storage….
write_tuple_layoutWrite tuple layout model record to the world storage….
write_enum_layout
delete_fixed_layoutDelete a fixed layout model record from the world storage….
delete_array_layoutDelete an array layout model record from the world storage….
delete_fixed_array_layoutDelete a fixed array layout model record from the world storage….
delete_byte_array_layout
delete_layoutDelete a model record from the world storage….
delete_struct_layoutDelete a struct layout model record from the world storage….
delete_tuple_layoutDelete a tuple layout model record from the world storage….
delete_enum_layout
read_layoutRead a model record….
read_fixed_layoutRead a fixed layout model record….
read_array_layoutRead an array layout model record….
read_fixed_array_layoutRead a fixed array layout model record….
read_byte_array_layout
read_struct_layoutRead a struct layout model record….
read_tuple_layoutRead a tuple layout model record….
read_enum_layout

Free functions

Free functions

write_layoutWrite values to the world storage….
write_fixed_layoutWrite fixed layout model record to the world storage….
write_array_layoutWrite array layout model record to the world storage….
write_fixed_array_layoutWrite fixed array layout model record to the world storage….
write_byte_array_layout
write_struct_layoutWrite struct layout model record to the world storage….
write_tuple_layoutWrite tuple layout model record to the world storage….
write_enum_layout
delete_fixed_layoutDelete a fixed layout model record from the world storage….
delete_array_layoutDelete an array layout model record from the world storage….
delete_fixed_array_layoutDelete a fixed array layout model record from the world storage….
delete_byte_array_layout
delete_layoutDelete a model record from the world storage….
delete_struct_layoutDelete a struct layout model record from the world storage….
delete_tuple_layoutDelete a tuple layout model record from the world storage….
delete_enum_layout
read_layoutRead a model record….
read_fixed_layoutRead a fixed layout model record….
read_array_layoutRead an array layout model record….
read_fixed_array_layoutRead a fixed array layout model record….
read_byte_array_layout
read_struct_layoutRead a struct layout model record….
read_tuple_layoutRead a tuple layout model record….
read_enum_layout

write_layout

Write values to the world storage.

Arguments

  • model - the model selector.
  • key - the object key.
  • values - the object values.
  • offset - the start of object values in the values parameter.
  • layout - the object values layout.

Fully qualified path: dojo::storage::layout::write_layout

pub fn write_layout(
    model: felt252, key: felt252, values: Span<felt252>, ref offset: u32, layout: Layout,
)

write_fixed_layout

Write fixed layout model record to the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • values - the model record values.
  • offset - the start of model record values in the values parameter.
  • layout - the model record layout.

Fully qualified path: dojo::storage::layout::write_fixed_layout

pub fn write_fixed_layout(
    model: felt252, key: felt252, values: Span<felt252>, ref offset: u32, layout: Span<u8>,
)

write_array_layout

Write array layout model record to the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • values - the model record values.
  • offset - the start of model record values in the values parameter.
  • item_layout - the model record layout (temporary a Span because of type recursion issue).

Fully qualified path: dojo::storage::layout::write_array_layout

pub fn write_array_layout(
    model: felt252, key: felt252, values: Span<felt252>, ref offset: u32, item_layout: Span<Layout>,
)

write_fixed_array_layout

Write fixed array layout model record to the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • values - the model record values.
  • offset - the start of model record values in the values parameter.
  • item_layout - the model record layout (temporary a Span because of type recursion issue).

Fully qualified path: dojo::storage::layout::write_fixed_array_layout

pub fn write_fixed_array_layout(
    model: felt252,
    key: felt252,
    values: Span<felt252>,
    ref offset: u32,
    mut item_layout: (Span<Layout>, u32),
)

write_byte_array_layout

Fully qualified path: dojo::storage::layout::write_byte_array_layout

pub fn write_byte_array_layout(model: felt252, key: felt252, values: Span<felt252>, ref offset: u32)

write_struct_layout

Write struct layout model record to the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • values - the model record values.
  • offset - the start of model record values in the values parameter.
  • layout - list of field layouts.

Fully qualified path: dojo::storage::layout::write_struct_layout

pub fn write_struct_layout(
    model: felt252, key: felt252, values: Span<felt252>, ref offset: u32, layout: Span<FieldLayout>,
)

write_tuple_layout

Write tuple layout model record to the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • values - the model record values.
  • offset - the start of model record values in the values parameter.
  • layout - list of tuple item layouts.

Fully qualified path: dojo::storage::layout::write_tuple_layout

pub fn write_tuple_layout(
    model: felt252, key: felt252, values: Span<felt252>, ref offset: u32, layout: Span<Layout>,
)

write_enum_layout

Fully qualified path: dojo::storage::layout::write_enum_layout

pub fn write_enum_layout(
    model: felt252,
    key: felt252,
    values: Span<felt252>,
    ref offset: u32,
    variant_layouts: Span<FieldLayout>,
)

delete_fixed_layout

Delete a fixed layout model record from the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • layout - the model layout

Fully qualified path: dojo::storage::layout::delete_fixed_layout

pub fn delete_fixed_layout(model: felt252, key: felt252, layout: Span<u8>)

delete_array_layout

Delete an array layout model record from the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.

Fully qualified path: dojo::storage::layout::delete_array_layout

pub fn delete_array_layout(model: felt252, key: felt252)

delete_fixed_array_layout

Delete a fixed array layout model record from the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • layout - the model layout.

Fully qualified path: dojo::storage::layout::delete_fixed_array_layout

pub fn delete_fixed_array_layout(model: felt252, key: felt252, mut layout: (Span<Layout>, u32))

delete_byte_array_layout

Fully qualified path: dojo::storage::layout::delete_byte_array_layout

pub fn delete_byte_array_layout(model: felt252, key: felt252)

delete_layout

Delete a model record from the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • layout - the model layout

Fully qualified path: dojo::storage::layout::delete_layout

pub fn delete_layout(model: felt252, key: felt252, layout: Layout)

delete_struct_layout

Delete a struct layout model record from the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • layout - list of field layouts.

Fully qualified path: dojo::storage::layout::delete_struct_layout

pub fn delete_struct_layout(model: felt252, key: felt252, layout: Span<FieldLayout>)

delete_tuple_layout

Delete a tuple layout model record from the world storage.

Arguments

  • model - the model selector.
  • key - the model record key.
  • layout - list of tuple item layouts.

Fully qualified path: dojo::storage::layout::delete_tuple_layout

pub fn delete_tuple_layout(model: felt252, key: felt252, layout: Span<Layout>)

delete_enum_layout

Fully qualified path: dojo::storage::layout::delete_enum_layout

pub fn delete_enum_layout(model: felt252, key: felt252, variant_layouts: Span<FieldLayout>)

read_layout

Read a model record.

Arguments

  • model - the model selector
  • key - model record key.
  • read_data - the read data.
  • layout - the model layout

Fully qualified path: dojo::storage::layout::read_layout

pub fn read_layout(model: felt252, key: felt252, ref read_data: Array<felt252>, layout: Layout)

read_fixed_layout

Read a fixed layout model record.

Arguments

  • model - the model selector
  • key - model record key.
  • read_data - the read data.
  • layout - the model layout

Fully qualified path: dojo::storage::layout::read_fixed_layout

pub fn read_fixed_layout(
    model: felt252, key: felt252, ref read_data: Array<felt252>, layout: Span<u8>,
)

read_array_layout

Read an array layout model record.

Arguments

  • model - the model selector
  • key - model record key.
  • read_data - the read data.
  • layout - the array item layout

Fully qualified path: dojo::storage::layout::read_array_layout

pub fn read_array_layout(
    model: felt252, key: felt252, ref read_data: Array<felt252>, layout: Span<Layout>,
)

read_fixed_array_layout

Read a fixed array layout model record.

Arguments

  • model - the model selector
  • key - model record key.
  • read_data - the read data.
  • layout - the array item layout

Fully qualified path: dojo::storage::layout::read_fixed_array_layout

pub fn read_fixed_array_layout(
    model: felt252, key: felt252, ref read_data: Array<felt252>, mut layout: (Span<Layout>, u32),
)

read_byte_array_layout

Fully qualified path: dojo::storage::layout::read_byte_array_layout

pub fn read_byte_array_layout(model: felt252, key: felt252, ref read_data: Array<felt252>)

read_struct_layout

Read a struct layout model record.

Arguments

  • model - the model selector
  • key - model record key.
  • read_data - the read data.
  • layout - the list of field layouts.

Fully qualified path: dojo::storage::layout::read_struct_layout

pub fn read_struct_layout(
    model: felt252, key: felt252, ref read_data: Array<felt252>, layout: Span<FieldLayout>,
)

read_tuple_layout

Read a tuple layout model record.

Arguments

  • model - the model selector
  • key - model record key.
  • read_data - the read data.
  • layout - the tuple item layouts

Fully qualified path: dojo::storage::layout::read_tuple_layout

pub fn read_tuple_layout(
    model: felt252, key: felt252, ref read_data: Array<felt252>, layout: Span<Layout>,
)

read_enum_layout

Fully qualified path: dojo::storage::layout::read_enum_layout

pub fn read_enum_layout(
    model: felt252, key: felt252, ref read_data: Array<felt252>, variant_layouts: Span<FieldLayout>,
)

packing

Fully qualified path: dojo::storage::packing

Constants

Free functions

pack
calculate_packed_size
unpack
pack_innerPack the proposal fields into a single felt252.
unpack_inner
shl
shr
pow2_const

Constants

Constants

PACKING_MAX_BITS

Fully qualified path: dojo::storage::packing::PACKING_MAX_BITS

pub const PACKING_MAX_BITS: u8 = 251;

PACKING_MAX_BITS_USIZE

Fully qualified path: dojo::storage::packing::PACKING_MAX_BITS_USIZE

pub const PACKING_MAX_BITS_USIZE: u32 = 251;

POW_2_MINUS_ONE

Fully qualified path: dojo::storage::packing::POW_2_MINUS_ONE

pub const POW_2_MINUS_ONE: [u256; 256] = [
    2_u256.pow(0) - 1, 2_u256.pow(1) - 1, 2_u256.pow(2) - 1, 2_u256.pow(3) - 1, 2_u256.pow(4) - 1,
    2_u256.pow(5) - 1, 2_u256.pow(6) - 1, 2_u256.pow(7) - 1, 2_u256.pow(8) - 1, 2_u256.pow(9) - 1,
    2_u256.pow(10) - 1, 2_u256.pow(11) - 1, 2_u256.pow(12) - 1, 2_u256.pow(13) - 1,
    2_u256.pow(14) - 1, 2_u256.pow(15) - 1, 2_u256.pow(16) - 1, 2_u256.pow(17) - 1,
    2_u256.pow(18) - 1, 2_u256.pow(19) - 1, 2_u256.pow(20) - 1, 2_u256.pow(21) - 1,
    2_u256.pow(22) - 1, 2_u256.pow(23) - 1, 2_u256.pow(24) - 1, 2_u256.pow(25) - 1,
    2_u256.pow(26) - 1, 2_u256.pow(27) - 1, 2_u256.pow(28) - 1, 2_u256.pow(29) - 1,
    2_u256.pow(30) - 1, 2_u256.pow(31) - 1, 2_u256.pow(32) - 1, 2_u256.pow(33) - 1,
    2_u256.pow(34) - 1, 2_u256.pow(35) - 1, 2_u256.pow(36) - 1, 2_u256.pow(37) - 1,
    2_u256.pow(38) - 1, 2_u256.pow(39) - 1, 2_u256.pow(40) - 1, 2_u256.pow(41) - 1,
    2_u256.pow(42) - 1, 2_u256.pow(43) - 1, 2_u256.pow(44) - 1, 2_u256.pow(45) - 1,
    2_u256.pow(46) - 1, 2_u256.pow(47) - 1, 2_u256.pow(48) - 1, 2_u256.pow(49) - 1,
    2_u256.pow(50) - 1, 2_u256.pow(51) - 1, 2_u256.pow(52) - 1, 2_u256.pow(53) - 1,
    2_u256.pow(54) - 1, 2_u256.pow(55) - 1, 2_u256.pow(56) - 1, 2_u256.pow(57) - 1,
    2_u256.pow(58) - 1, 2_u256.pow(59) - 1, 2_u256.pow(60) - 1, 2_u256.pow(61) - 1,
    2_u256.pow(62) - 1, 2_u256.pow(63) - 1, 2_u256.pow(64) - 1, 2_u256.pow(65) - 1,
    2_u256.pow(66) - 1, 2_u256.pow(67) - 1, 2_u256.pow(68) - 1, 2_u256.pow(69) - 1,
    2_u256.pow(70) - 1, 2_u256.pow(71) - 1, 2_u256.pow(72) - 1, 2_u256.pow(73) - 1,
    2_u256.pow(74) - 1, 2_u256.pow(75) - 1, 2_u256.pow(76) - 1, 2_u256.pow(77) - 1,
    2_u256.pow(78) - 1, 2_u256.pow(79) - 1, 2_u256.pow(80) - 1, 2_u256.pow(81) - 1,
    2_u256.pow(82) - 1, 2_u256.pow(83) - 1, 2_u256.pow(84) - 1, 2_u256.pow(85) - 1,
    2_u256.pow(86) - 1, 2_u256.pow(87) - 1, 2_u256.pow(88) - 1, 2_u256.pow(89) - 1,
    2_u256.pow(90) - 1, 2_u256.pow(91) - 1, 2_u256.pow(92) - 1, 2_u256.pow(93) - 1,
    2_u256.pow(94) - 1, 2_u256.pow(95) - 1, 2_u256.pow(96) - 1, 2_u256.pow(97) - 1,
    2_u256.pow(98) - 1, 2_u256.pow(99) - 1, 2_u256.pow(100) - 1, 2_u256.pow(101) - 1,
    2_u256.pow(102) - 1, 2_u256.pow(103) - 1, 2_u256.pow(104) - 1, 2_u256.pow(105) - 1,
    2_u256.pow(106) - 1, 2_u256.pow(107) - 1, 2_u256.pow(108) - 1, 2_u256.pow(109) - 1,
    2_u256.pow(110) - 1, 2_u256.pow(111) - 1, 2_u256.pow(112) - 1, 2_u256.pow(113) - 1,
    2_u256.pow(114) - 1, 2_u256.pow(115) - 1, 2_u256.pow(116) - 1, 2_u256.pow(117) - 1,
    2_u256.pow(118) - 1, 2_u256.pow(119) - 1, 2_u256.pow(120) - 1, 2_u256.pow(121) - 1,
    2_u256.pow(122) - 1, 2_u256.pow(123) - 1, 2_u256.pow(124) - 1, 2_u256.pow(125) - 1,
    2_u256.pow(126) - 1, 2_u256.pow(127) - 1, 2_u256.pow(128) - 1, 2_u256.pow(129) - 1,
    2_u256.pow(130) - 1, 2_u256.pow(131) - 1, 2_u256.pow(132) - 1, 2_u256.pow(133) - 1,
    2_u256.pow(134) - 1, 2_u256.pow(135) - 1, 2_u256.pow(136) - 1, 2_u256.pow(137) - 1,
    2_u256.pow(138) - 1, 2_u256.pow(139) - 1, 2_u256.pow(140) - 1, 2_u256.pow(141) - 1,
    2_u256.pow(142) - 1, 2_u256.pow(143) - 1, 2_u256.pow(144) - 1, 2_u256.pow(145) - 1,
    2_u256.pow(146) - 1, 2_u256.pow(147) - 1, 2_u256.pow(148) - 1, 2_u256.pow(149) - 1,
    2_u256.pow(150) - 1, 2_u256.pow(151) - 1, 2_u256.pow(152) - 1, 2_u256.pow(153) - 1,
    2_u256.pow(154) - 1, 2_u256.pow(155) - 1, 2_u256.pow(156) - 1, 2_u256.pow(157) - 1,
    2_u256.pow(158) - 1, 2_u256.pow(159) - 1, 2_u256.pow(160) - 1, 2_u256.pow(161) - 1,
    2_u256.pow(162) - 1, 2_u256.pow(163) - 1, 2_u256.pow(164) - 1, 2_u256.pow(165) - 1,
    2_u256.pow(166) - 1, 2_u256.pow(167) - 1, 2_u256.pow(168) - 1, 2_u256.pow(169) - 1,
    2_u256.pow(170) - 1, 2_u256.pow(171) - 1, 2_u256.pow(172) - 1, 2_u256.pow(173) - 1,
    2_u256.pow(174) - 1, 2_u256.pow(175) - 1, 2_u256.pow(176) - 1, 2_u256.pow(177) - 1,
    2_u256.pow(178) - 1, 2_u256.pow(179) - 1, 2_u256.pow(180) - 1, 2_u256.pow(181) - 1,
    2_u256.pow(182) - 1, 2_u256.pow(183) - 1, 2_u256.pow(184) - 1, 2_u256.pow(185) - 1,
    2_u256.pow(186) - 1, 2_u256.pow(187) - 1, 2_u256.pow(188) - 1, 2_u256.pow(189) - 1,
    2_u256.pow(190) - 1, 2_u256.pow(191) - 1, 2_u256.pow(192) - 1, 2_u256.pow(193) - 1,
    2_u256.pow(194) - 1, 2_u256.pow(195) - 1, 2_u256.pow(196) - 1, 2_u256.pow(197) - 1,
    2_u256.pow(198) - 1, 2_u256.pow(199) - 1, 2_u256.pow(200) - 1, 2_u256.pow(201) - 1,
    2_u256.pow(202) - 1, 2_u256.pow(203) - 1, 2_u256.pow(204) - 1, 2_u256.pow(205) - 1,
    2_u256.pow(206) - 1, 2_u256.pow(207) - 1, 2_u256.pow(208) - 1, 2_u256.pow(209) - 1,
    2_u256.pow(210) - 1, 2_u256.pow(211) - 1, 2_u256.pow(212) - 1, 2_u256.pow(213) - 1,
    2_u256.pow(214) - 1, 2_u256.pow(215) - 1, 2_u256.pow(216) - 1, 2_u256.pow(217) - 1,
    2_u256.pow(218) - 1, 2_u256.pow(219) - 1, 2_u256.pow(220) - 1, 2_u256.pow(221) - 1,
    2_u256.pow(222) - 1, 2_u256.pow(223) - 1, 2_u256.pow(224) - 1, 2_u256.pow(225) - 1,
    2_u256.pow(226) - 1, 2_u256.pow(227) - 1, 2_u256.pow(228) - 1, 2_u256.pow(229) - 1,
    2_u256.pow(230) - 1, 2_u256.pow(231) - 1, 2_u256.pow(232) - 1, 2_u256.pow(233) - 1,
    2_u256.pow(234) - 1, 2_u256.pow(235) - 1, 2_u256.pow(236) - 1, 2_u256.pow(237) - 1,
    2_u256.pow(238) - 1, 2_u256.pow(239) - 1, 2_u256.pow(240) - 1, 2_u256.pow(241) - 1,
    2_u256.pow(242) - 1, 2_u256.pow(243) - 1, 2_u256.pow(244) - 1, 2_u256.pow(245) - 1,
    2_u256.pow(246) - 1, 2_u256.pow(247) - 1, 2_u256.pow(248) - 1, 2_u256.pow(249) - 1,
    2_u256.pow(250) - 1, 2_u256.pow(251) - 1, 2_u256.pow(252) - 1, 2_u256.pow(253) - 1,
    2_u256.pow(254) - 1, 2_u256.pow(255) - 1,
];

POW_2

Fully qualified path: dojo::storage::packing::POW_2

pub const POW_2: [u256; 256] = [
    2_u256.pow(0), 2_u256.pow(1), 2_u256.pow(2), 2_u256.pow(3), 2_u256.pow(4), 2_u256.pow(5),
    2_u256.pow(6), 2_u256.pow(7), 2_u256.pow(8), 2_u256.pow(9), 2_u256.pow(10), 2_u256.pow(11),
    2_u256.pow(12), 2_u256.pow(13), 2_u256.pow(14), 2_u256.pow(15), 2_u256.pow(16), 2_u256.pow(17),
    2_u256.pow(18), 2_u256.pow(19), 2_u256.pow(20), 2_u256.pow(21), 2_u256.pow(22), 2_u256.pow(23),
    2_u256.pow(24), 2_u256.pow(25), 2_u256.pow(26), 2_u256.pow(27), 2_u256.pow(28), 2_u256.pow(29),
    2_u256.pow(30), 2_u256.pow(31), 2_u256.pow(32), 2_u256.pow(33), 2_u256.pow(34), 2_u256.pow(35),
    2_u256.pow(36), 2_u256.pow(37), 2_u256.pow(38), 2_u256.pow(39), 2_u256.pow(40), 2_u256.pow(41),
    2_u256.pow(42), 2_u256.pow(43), 2_u256.pow(44), 2_u256.pow(45), 2_u256.pow(46), 2_u256.pow(47),
    2_u256.pow(48), 2_u256.pow(49), 2_u256.pow(50), 2_u256.pow(51), 2_u256.pow(52), 2_u256.pow(53),
    2_u256.pow(54), 2_u256.pow(55), 2_u256.pow(56), 2_u256.pow(57), 2_u256.pow(58), 2_u256.pow(59),
    2_u256.pow(60), 2_u256.pow(61), 2_u256.pow(62), 2_u256.pow(63), 2_u256.pow(64), 2_u256.pow(65),
    2_u256.pow(66), 2_u256.pow(67), 2_u256.pow(68), 2_u256.pow(69), 2_u256.pow(70), 2_u256.pow(71),
    2_u256.pow(72), 2_u256.pow(73), 2_u256.pow(74), 2_u256.pow(75), 2_u256.pow(76), 2_u256.pow(77),
    2_u256.pow(78), 2_u256.pow(79), 2_u256.pow(80), 2_u256.pow(81), 2_u256.pow(82), 2_u256.pow(83),
    2_u256.pow(84), 2_u256.pow(85), 2_u256.pow(86), 2_u256.pow(87), 2_u256.pow(88), 2_u256.pow(89),
    2_u256.pow(90), 2_u256.pow(91), 2_u256.pow(92), 2_u256.pow(93), 2_u256.pow(94), 2_u256.pow(95),
    2_u256.pow(96), 2_u256.pow(97), 2_u256.pow(98), 2_u256.pow(99), 2_u256.pow(100),
    2_u256.pow(101), 2_u256.pow(102), 2_u256.pow(103), 2_u256.pow(104), 2_u256.pow(105),
    2_u256.pow(106), 2_u256.pow(107), 2_u256.pow(108), 2_u256.pow(109), 2_u256.pow(110),
    2_u256.pow(111), 2_u256.pow(112), 2_u256.pow(113), 2_u256.pow(114), 2_u256.pow(115),
    2_u256.pow(116), 2_u256.pow(117), 2_u256.pow(118), 2_u256.pow(119), 2_u256.pow(120),
    2_u256.pow(121), 2_u256.pow(122), 2_u256.pow(123), 2_u256.pow(124), 2_u256.pow(125),
    2_u256.pow(126), 2_u256.pow(127), 2_u256.pow(128), 2_u256.pow(129), 2_u256.pow(130),
    2_u256.pow(131), 2_u256.pow(132), 2_u256.pow(133), 2_u256.pow(134), 2_u256.pow(135),
    2_u256.pow(136), 2_u256.pow(137), 2_u256.pow(138), 2_u256.pow(139), 2_u256.pow(140),
    2_u256.pow(141), 2_u256.pow(142), 2_u256.pow(143), 2_u256.pow(144), 2_u256.pow(145),
    2_u256.pow(146), 2_u256.pow(147), 2_u256.pow(148), 2_u256.pow(149), 2_u256.pow(150),
    2_u256.pow(151), 2_u256.pow(152), 2_u256.pow(153), 2_u256.pow(154), 2_u256.pow(155),
    2_u256.pow(156), 2_u256.pow(157), 2_u256.pow(158), 2_u256.pow(159), 2_u256.pow(160),
    2_u256.pow(161), 2_u256.pow(162), 2_u256.pow(163), 2_u256.pow(164), 2_u256.pow(165),
    2_u256.pow(166), 2_u256.pow(167), 2_u256.pow(168), 2_u256.pow(169), 2_u256.pow(170),
    2_u256.pow(171), 2_u256.pow(172), 2_u256.pow(173), 2_u256.pow(174), 2_u256.pow(175),
    2_u256.pow(176), 2_u256.pow(177), 2_u256.pow(178), 2_u256.pow(179), 2_u256.pow(180),
    2_u256.pow(181), 2_u256.pow(182), 2_u256.pow(183), 2_u256.pow(184), 2_u256.pow(185),
    2_u256.pow(186), 2_u256.pow(187), 2_u256.pow(188), 2_u256.pow(189), 2_u256.pow(190),
    2_u256.pow(191), 2_u256.pow(192), 2_u256.pow(193), 2_u256.pow(194), 2_u256.pow(195),
    2_u256.pow(196), 2_u256.pow(197), 2_u256.pow(198), 2_u256.pow(199), 2_u256.pow(200),
    2_u256.pow(201), 2_u256.pow(202), 2_u256.pow(203), 2_u256.pow(204), 2_u256.pow(205),
    2_u256.pow(206), 2_u256.pow(207), 2_u256.pow(208), 2_u256.pow(209), 2_u256.pow(210),
    2_u256.pow(211), 2_u256.pow(212), 2_u256.pow(213), 2_u256.pow(214), 2_u256.pow(215),
    2_u256.pow(216), 2_u256.pow(217), 2_u256.pow(218), 2_u256.pow(219), 2_u256.pow(220),
    2_u256.pow(221), 2_u256.pow(222), 2_u256.pow(223), 2_u256.pow(224), 2_u256.pow(225),
    2_u256.pow(226), 2_u256.pow(227), 2_u256.pow(228), 2_u256.pow(229), 2_u256.pow(230),
    2_u256.pow(231), 2_u256.pow(232), 2_u256.pow(233), 2_u256.pow(234), 2_u256.pow(235),
    2_u256.pow(236), 2_u256.pow(237), 2_u256.pow(238), 2_u256.pow(239), 2_u256.pow(240),
    2_u256.pow(241), 2_u256.pow(242), 2_u256.pow(243), 2_u256.pow(244), 2_u256.pow(245),
    2_u256.pow(246), 2_u256.pow(247), 2_u256.pow(248), 2_u256.pow(249), 2_u256.pow(250),
    2_u256.pow(251), 2_u256.pow(252), 2_u256.pow(253), 2_u256.pow(254), 2_u256.pow(255),
];

Free functions

Free functions

pack
calculate_packed_size
unpack
pack_innerPack the proposal fields into a single felt252.
unpack_inner
shl
shr
pow2_const

pack

Fully qualified path: dojo::storage::packing::pack

pub fn pack(
    ref packed: Array<felt252>, ref unpacked: Span<felt252>, offset: u32, ref layout: Span<u8>,
)

calculate_packed_size

Fully qualified path: dojo::storage::packing::calculate_packed_size

pub fn calculate_packed_size(ref layout: Span<u8>) -> u32

unpack

Fully qualified path: dojo::storage::packing::unpack

pub fn unpack(ref unpacked: Array<felt252>, ref packed: Span<felt252>, ref layout: Span<u8>)

pack_inner

Pack the proposal fields into a single felt252.

Fully qualified path: dojo::storage::packing::pack_inner

pub fn pack_inner(
    self: @felt252,
    size: u32,
    ref packing: felt252,
    ref packing_offset: u32,
    ref packed: Array<felt252>,
)

unpack_inner

Fully qualified path: dojo::storage::packing::unpack_inner

pub fn unpack_inner(
    size: u32, ref packed: Span<felt252>, ref unpacking: felt252, ref unpacking_offset: u32,
) -> Option<felt252>

shl

Fully qualified path: dojo::storage::packing::shl

pub fn shl(x: u256, n: u32) -> u256

shr

Fully qualified path: dojo::storage::packing::shr

pub fn shr(x: u256, n: u32) -> u256

pow2_const

Fully qualified path: dojo::storage::packing::pow2_const

pub fn pow2_const(n: u32) -> u256

storage

Fully qualified path: dojo::storage::storage

Constants

Free functions

next_index_in_chunk
get
get_manyRead a raw value defined by its layout and identified by its keys….
setWrite a one-felt value identified by its keys….
set_manyWrite a raw value defined by its layout and identified by its keys….
set_packed_arrayWrite a raw array value identified by its keys….
get_packed_arrayRead a raw array value identified by its keys….

Constants

Constants

DEFAULT_ADDRESS_DOMAIN

Fully qualified path: dojo::storage::storage::DEFAULT_ADDRESS_DOMAIN

pub const DEFAULT_ADDRESS_DOMAIN: u32 = 0;

Free functions

Free functions

next_index_in_chunk
get
get_manyRead a raw value defined by its layout and identified by its keys….
setWrite a one-felt value identified by its keys….
set_manyWrite a raw value defined by its layout and identified by its keys….
set_packed_arrayWrite a raw array value identified by its keys….
get_packed_arrayRead a raw array value identified by its keys….

next_index_in_chunk

Fully qualified path: dojo::storage::storage::next_index_in_chunk

pub fn next_index_in_chunk(
    ref index_in_chunk: u8,
    ref chunk: felt252,
    ref chunk_base: StorageBaseAddress,
    base_address: StorageAddress,
)

get

Fully qualified path: dojo::storage::storage::get

pub fn get(address_domain: u32, keys: Span<felt252>) -> felt252

get_many

Read a raw value defined by its layout and identified by its keys.

Arguments

  • address_domain - the address domain to use
  • keys - the keys of the value to read
  • layout - the layout of the value to read

Returns

  • Span<felt252> - the raw value read from the storage

Fully qualified path: dojo::storage::storage::get_many

pub fn get_many(address_domain: u32, keys: Span<felt252>, mut layout: Span<u8>) -> Span<felt252>

set

Write a one-felt value identified by its keys.

Arguments

  • address_domain - the address domain to use
  • keys - the keys of the value to write
  • value - the value to write

Fully qualified path: dojo::storage::storage::set

pub fn set(address_domain: u32, keys: Span<felt252>, value: felt252)

set_many

Write a raw value defined by its layout and identified by its keys.

Arguments

  • address_domain - the address domain to use
  • keys - the keys of the value to write
  • unpacked - the raw value to write
  • offset - the starting point from where to extract raw value from the unpacked array.
  • layout - the layout of the value to write

Fully qualified path: dojo::storage::storage::set_many

pub fn set_many(
    address_domain: u32,
    keys: Span<felt252>,
    mut unpacked: Span<felt252>,
    offset: u32,
    mut layout: Span<u8>,
)

set_packed_array

Write a raw array value identified by its keys.

Arguments

  • address_domain - the address domain to use
  • keys - the keys of the value to write
  • data - the raw value to write
  • offset - the starting point from where to extract raw value from the data array.
  • array_size - the size of the array to write.

Fully qualified path: dojo::storage::storage::set_packed_array

pub fn set_packed_array(
    address_domain: u32, keys: Span<felt252>, mut data: Span<felt252>, offset: u32, array_size: u32,
)

get_packed_array

Read a raw array value identified by its keys.

Arguments

  • address_domain - the address domain to use
  • keys - the keys of the value to read
  • array_size - the size of the array to read.

Fully qualified path: dojo::storage::storage::get_packed_array

pub fn get_packed_array(address_domain: u32, keys: Span<felt252>, array_size: u32) -> Span<felt252>

utils

Fully qualified path: dojo::utils

Modules

default
hash
key
layout
misc
naming
serde

Re-exports:

bytearray_hashCompute the poseidon hash of a serialized ByteArray
selector_from_hashesComputes the selector from two hashes.
selector_from_namesComputes the selector of a resource from the namespace and the name.
selector_from_namespace_and_nameComputes the selector namespace hash and the name of the resource.
combine_keyCombine parent and child keys to build one full key.
entity_id_from_keysComputes the entity id from the key.
entity_id_from_serialized_keysComputes the entity id from the keys….
find_field_layoutfind a field with its selector in a list of layouts
find_model_field_layoutFind the layout of a model field based on its selector….
sum_sizesComputes the sum of the provided sizes. If at least one size is None, returns None.
is_name_validVerifies that the provided name is valid according to the following RegEx: ^ a-zA-Z0-9_ +$
deserialize_unwrap
serialize_inline

Modules

Modules

default
hash
key
layout
misc
naming
serde

default

Fully qualified path: dojo::utils::default

Free functions

Impls

ContractAddressDefaultImplement the Default trait for ContractAddress to be able to use the Default derive attribute on enums/structs which contain a ContractAddress field.
ClassHashDefaultthe Default derive attribute on enums/structs which contain a ClassHash field.

Free functions

Free functions

default_address

Fully qualified path: dojo::utils::default::default_address

pub fn default_address() -> ContractAddress

default_class_hash

Fully qualified path: dojo::utils::default::default_class_hash

pub fn default_class_hash() -> ClassHash

Impls

Impls

ContractAddressDefaultImplement the Default trait for ContractAddress to be able to use the Default derive attribute on enums/structs which contain a ContractAddress field.
ClassHashDefaultthe Default derive attribute on enums/structs which contain a ClassHash field.

ContractAddressDefault

Implement the Default trait for ContractAddress to be able to use the Default derive attribute on enums/structs which contain a ContractAddress field.

Fully qualified path: dojo::utils::default::ContractAddressDefault

pub impl ContractAddressDefault of Default<ContractAddress>;

Impl functions

default

Fully qualified path: dojo::utils::default::ContractAddressDefault::default

fn default() -> ContractAddress

ClassHashDefault

the Default derive attribute on enums/structs which contain a ClassHash field.

Fully qualified path: dojo::utils::default::ClassHashDefault

pub impl ClassHashDefault of Default<ClassHash>;

Impl functions

default

Fully qualified path: dojo::utils::default::ClassHashDefault::default

fn default() -> ClassHash

hash

Fully qualified path: dojo::utils::hash

Free functions

bytearray_hashCompute the poseidon hash of a serialized ByteArray
selector_from_namesComputes the selector of a resource from the namespace and the name.
selector_from_namespace_and_nameComputes the selector namespace hash and the name of the resource.
selector_from_hashesComputes the selector from two hashes.

Free functions

Free functions

bytearray_hashCompute the poseidon hash of a serialized ByteArray
selector_from_namesComputes the selector of a resource from the namespace and the name.
selector_from_namespace_and_nameComputes the selector namespace hash and the name of the resource.
selector_from_hashesComputes the selector from two hashes.

bytearray_hash

Compute the poseidon hash of a serialized ByteArray

Fully qualified path: dojo::utils::hash::bytearray_hash

pub fn bytearray_hash(data: @ByteArray) -> felt252

selector_from_names

Computes the selector of a resource from the namespace and the name.

Fully qualified path: dojo::utils::hash::selector_from_names

pub fn selector_from_names(namespace: @ByteArray, name: @ByteArray) -> felt252

selector_from_namespace_and_name

Computes the selector namespace hash and the name of the resource.

Fully qualified path: dojo::utils::hash::selector_from_namespace_and_name

pub fn selector_from_namespace_and_name(namespace_hash: felt252, name: @ByteArray) -> felt252

selector_from_hashes

Computes the selector from two hashes.

Fully qualified path: dojo::utils::hash::selector_from_hashes

pub fn selector_from_hashes(namespace_hash: felt252, name_hash: felt252) -> felt252

key

Fully qualified path: dojo::utils::key

Free functions

entity_id_from_serialized_keysComputes the entity id from the keys….
combine_keyCombine parent and child keys to build one full key.
entity_id_from_keysComputes the entity id from the key.

Free functions

Free functions

entity_id_from_serialized_keysComputes the entity id from the keys….
combine_keyCombine parent and child keys to build one full key.
entity_id_from_keysComputes the entity id from the key.

entity_id_from_serialized_keys

Computes the entity id from the keys.

Arguments

  • keys - The keys of the entity.

Returns

The entity id.

Fully qualified path: dojo::utils::key::entity_id_from_serialized_keys

pub fn entity_id_from_serialized_keys(keys: Span<felt252>) -> felt252

combine_key

Combine parent and child keys to build one full key.

Fully qualified path: dojo::utils::key::combine_key

pub fn combine_key(parent_key: felt252, child_key: felt252) -> felt252

entity_id_from_keys

Computes the entity id from the key.

Fully qualified path: dojo::utils::key::entity_id_from_keys

pub fn entity_id_from_keys<K, +Serde<K>>(keys: @K) -> felt252

layout

Fully qualified path: dojo::utils::layout

Free functions

find_field_layoutfind a field with its selector in a list of layouts
find_model_field_layoutFind the layout of a model field based on its selector….

Free functions

Free functions

find_field_layoutfind a field with its selector in a list of layouts
find_model_field_layoutFind the layout of a model field based on its selector….

find_field_layout

find a field with its selector in a list of layouts

Fully qualified path: dojo::utils::layout::find_field_layout

pub fn find_field_layout(
    field_selector: felt252, field_layouts: Span<FieldLayout>,
) -> Option<Layout>

find_model_field_layout

Find the layout of a model field based on its selector.

Arguments

  • model_layout - The full model layout (must be a Layout::Struct).
  • member_selector - The model field selector.

Returns

Some(Layout) if the field layout has been found, None otherwise.

Fully qualified path: dojo::utils::layout::find_model_field_layout

pub fn find_model_field_layout(model_layout: Layout, member_selector: felt252) -> Option<Layout>

misc

Fully qualified path: dojo::utils::misc

Free functions

sum_sizesComputes the sum of the provided sizes. If at least one size is None, returns None.

Free functions

Free functions

sum_sizesComputes the sum of the provided sizes. If at least one size is None, returns None.

sum_sizes

Computes the sum of the provided sizes. If at least one size is None, returns None.

Fully qualified path: dojo::utils::misc::sum_sizes

pub fn sum_sizes(sizes: Array<Option<u32>>) -> Option<u32>

naming

Fully qualified path: dojo::utils::naming

Free functions

is_name_validVerifies that the provided name is valid according to the following RegEx: ^ a-zA-Z0-9_ +$

Free functions

Free functions

is_name_validVerifies that the provided name is valid according to the following RegEx: ^ a-zA-Z0-9_ +$

is_name_valid

Verifies that the provided name is valid according to the following RegEx: ^a-zA-Z0-9_+$

Fully qualified path: dojo::utils::naming::is_name_valid

pub fn is_name_valid(name: @ByteArray) -> bool

serde

Fully qualified path: dojo::utils::serde

Free functions

Free functions

Free functions

serialize_inline

Fully qualified path: dojo::utils::serde::serialize_inline

pub fn serialize_inline<T, +Serde<T>>(value: @T) -> Span<felt252>

deserialize_unwrap

Fully qualified path: dojo::utils::serde::deserialize_unwrap

pub fn deserialize_unwrap<T, +Serde<T>>(mut span: Span<felt252>) -> T

world

Fully qualified path: dojo::world

Modules

storageA simple storage abstraction for the world’s storage.
iworldWorld interface.
resourceWorld’s resources.
world_contract

Re-exports:


ResourceResource is the type of the resource that can be registered in the world. Caching the namespace hash of a contract and model in the world saves gas, instead…


world


Groups:

dispatchers

Modules

Modules

storageA simple storage abstraction for the world’s storage.
iworldWorld interface.
resourceWorld’s resources.
world_contract

storage

A simple storage abstraction for the world’s storage.

Fully qualified path: dojo::world::storage

Structs

Traits

Impls

Structs

Structs

WorldStorage

Fully qualified path: dojo::world::storage::WorldStorage

#[derive(Drop, Copy, Serde)]
pub struct WorldStorage {
    pub dispatcher: IWorldDispatcher,
    pub namespace_hash: felt252,
}

Members

dispatcher

Fully qualified path: dojo::world::storage::WorldStorage::dispatcher

pub dispatcher: IWorldDispatcher

namespace_hash

Fully qualified path: dojo::world::storage::WorldStorage::namespace_hash

pub namespace_hash: felt252

Traits

Traits

WorldStorageTrait

Fully qualified path: dojo::world::storage::WorldStorageTrait

pub trait WorldStorageTrait

Trait functions

new

Fully qualified path: dojo::world::storage::WorldStorageTrait::new

fn new(world: IWorldDispatcher, namespace: @ByteArray) -> WorldStorage

new_from_hash

Fully qualified path: dojo::world::storage::WorldStorageTrait::new_from_hash

fn new_from_hash(world: IWorldDispatcher, namespace_hash: felt252) -> WorldStorage

set_namespace

Fully qualified path: dojo::world::storage::WorldStorageTrait::set_namespace

fn set_namespace(ref self: WorldStorage, namespace: @ByteArray)

dns

Fully qualified path: dojo::world::storage::WorldStorageTrait::dns

fn dns(self: @WorldStorage, contract_name: @ByteArray) -> Option<(ContractAddress, ClassHash)>

dns_from_hash

Fully qualified path: dojo::world::storage::WorldStorageTrait::dns_from_hash

fn dns_from_hash(
    self: @WorldStorage, contract_name_hash: felt252,
) -> Option<(ContractAddress, ClassHash)>

dns_from_selector

Fully qualified path: dojo::world::storage::WorldStorageTrait::dns_from_selector

fn dns_from_selector(self: @WorldStorage, selector: felt252) -> Option<(ContractAddress, ClassHash)>

dns_address

Fully qualified path: dojo::world::storage::WorldStorageTrait::dns_address

fn dns_address(self: @WorldStorage, contract_name: @ByteArray) -> Option<ContractAddress>

dns_class_hash

Fully qualified path: dojo::world::storage::WorldStorageTrait::dns_class_hash

fn dns_class_hash(self: @WorldStorage, contract_name: @ByteArray) -> Option<ClassHash>

resource_selector

Fully qualified path: dojo::world::storage::WorldStorageTrait::resource_selector

fn resource_selector(self: @WorldStorage, name: @ByteArray) -> felt252

Impls

Impls

WorldStorageInternalImpl

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl

pub impl WorldStorageInternalImpl of WorldStorageTrait;

Impl functions

new

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl::new

fn new(world: IWorldDispatcher, namespace: @ByteArray) -> WorldStorage

new_from_hash

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl::new_from_hash

fn new_from_hash(world: IWorldDispatcher, namespace_hash: felt252) -> WorldStorage

set_namespace

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl::set_namespace

fn set_namespace(ref self: WorldStorage, namespace: @ByteArray)

dns

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl::dns

fn dns(self: @WorldStorage, contract_name: @ByteArray) -> Option<(ContractAddress, ClassHash)>

dns_from_hash

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl::dns_from_hash

fn dns_from_hash(
    self: @WorldStorage, contract_name_hash: felt252,
) -> Option<(ContractAddress, ClassHash)>

dns_from_selector

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl::dns_from_selector

fn dns_from_selector(self: @WorldStorage, selector: felt252) -> Option<(ContractAddress, ClassHash)>

dns_address

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl::dns_address

fn dns_address(self: @WorldStorage, contract_name: @ByteArray) -> Option<ContractAddress>

dns_class_hash

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl::dns_class_hash

fn dns_class_hash(self: @WorldStorage, contract_name: @ByteArray) -> Option<ClassHash>

resource_selector

Fully qualified path: dojo::world::storage::WorldStorageInternalImpl::resource_selector

fn resource_selector(self: @WorldStorage, name: @ByteArray) -> felt252

EventStorageWorldStorageImpl

Fully qualified path: dojo::world::storage::EventStorageWorldStorageImpl

pub impl EventStorageWorldStorageImpl<E, +Event<E>> of EventStorage<WorldStorage, E>;

Impl functions

emit_event

Fully qualified path: dojo::world::storage::EventStorageWorldStorageImpl::emit_event

fn emit_event(ref self: WorldStorage, event: @E)

ModelStorageWorldStorageImpl

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl

pub impl ModelStorageWorldStorageImpl<M, +Model<M>, +Drop<M>> of ModelStorage<WorldStorage, M>;

Impl functions

read_model

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_model

fn read_model(self: @WorldStorage, keys: K) -> M

read_models

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_models

fn read_models(self: @WorldStorage, keys: Span<K>) -> Array<M>

write_model

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::write_model

fn write_model(ref self: WorldStorage, model: @M)

write_models

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::write_models

fn write_models(ref self: WorldStorage, models: Span<@M>)

erase_model

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::erase_model

fn erase_model(ref self: WorldStorage, model: @M)

erase_models

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::erase_models

fn erase_models(ref self: WorldStorage, models: Span<@M>)

erase_model_ptr

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::erase_model_ptr

fn erase_model_ptr(ref self: WorldStorage, ptr: ModelPtr<M>)

read_member

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_member

fn read_member(self: @WorldStorage, ptr: ModelPtr<M>, field_selector: felt252) -> T

read_member_of_models

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_member_of_models

fn read_member_of_models(
    self: @WorldStorage, ptrs: Span<ModelPtr<M>>, field_selector: felt252,
) -> Array<T>

write_member

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::write_member

fn write_member(ref self: WorldStorage, ptr: ModelPtr<M>, field_selector: felt252, value: T)

write_member_of_models

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::write_member_of_models

fn write_member_of_models(
    ref self: WorldStorage, ptrs: Span<ModelPtr<M>>, field_selector: felt252, values: Span<T>,
)

erase_models_ptrs

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::erase_models_ptrs

fn erase_models_ptrs(ref self: WorldStorage, ptrs: Span<ModelPtr<M>>)

read_schema

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_schema

fn read_schema(self: @WorldStorage, ptr: ModelPtr<M>) -> T

read_schemas

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_schemas

fn read_schemas(self: @WorldStorage, ptrs: Span<ModelPtr<M>>) -> Array<T>

namespace_hash

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::namespace_hash

fn namespace_hash(self: @WorldStorage) -> felt252

read_member_legacy

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_member_legacy

fn read_member_legacy(self: @WorldStorage, ptr: ModelPtr<M>, field_selector: felt252) -> T

read_member_of_models_legacy

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_member_of_models_legacy

fn read_member_of_models_legacy(
    self: @WorldStorage, ptrs: Span<ModelPtr<M>>, field_selector: felt252,
) -> Array<T>

write_member_legacy

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::write_member_legacy

fn write_member_legacy(ref self: WorldStorage, ptr: ModelPtr<M>, field_selector: felt252, value: T)

write_member_of_models_legacy

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::write_member_of_models_legacy

fn write_member_of_models_legacy(
    ref self: WorldStorage, ptrs: Span<ModelPtr<M>>, field_selector: felt252, values: Span<T>,
)

read_schema_legacy

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_schema_legacy

fn read_schema_legacy(self: @WorldStorage, ptr: ModelPtr<M>) -> T

read_schemas_legacy

Fully qualified path: dojo::world::storage::ModelStorageWorldStorageImpl::read_schemas_legacy

fn read_schemas_legacy(self: @WorldStorage, ptrs: Span<ModelPtr<M>>) -> Array<T>

iworld

World interface.

Fully qualified path: dojo::world::iworld

Traits


Groups:

dispatchers

Traits

Traits

IUpgradeableWorld

Fully qualified path: dojo::world::iworld::IUpgradeableWorld

pub trait IUpgradeableWorld<T>

Trait functions

upgrade

Upgrades the world with new_class_hash.

Arguments

  • new_class_hash - The new world class hash.

Fully qualified path: dojo::world::iworld::IUpgradeableWorld::upgrade

fn upgrade(ref self: T, new_class_hash: ClassHash)

IWorld

Fully qualified path: dojo::world::iworld::IWorld

pub trait IWorld<T>

Trait functions

resource

Returns the resource from its selector.

Arguments

  • selector - the resource selector

Returns

  • Resource - the resource data associated with the selector.

Fully qualified path: dojo::world::iworld::IWorld::resource

fn resource(self: @T, selector: felt252) -> Resource

world_version

Returns the version of the world contract as a short string.

Fully qualified path: dojo::world::iworld::IWorld::world_version

fn world_version(self: @T) -> felt252

uuid

Issues an autoincremented id to the caller. This functionalities is useful to generate unique, but sequential ids.

Note: This functionalities may impact performances since transaction parallelisation can’t be achieved since the same storage slot is being written.

Fully qualified path: dojo::world::iworld::IWorld::uuid

fn uuid(ref self: T) -> u32

metadata

Returns the metadata of the resource.

Arguments

resource_selector - The resource selector.

Fully qualified path: dojo::world::iworld::IWorld::metadata

fn metadata(self: @T, resource_selector: felt252) -> ResourceMetadata

set_metadata

Sets the metadata of the resource.

Arguments

metadata - The metadata content for the resource.

Fully qualified path: dojo::world::iworld::IWorld::set_metadata

fn set_metadata(ref self: T, metadata: ResourceMetadata)

register_namespace

Registers a namespace in the world.

Arguments

  • namespace - The name of the namespace to be registered.

Fully qualified path: dojo::world::iworld::IWorld::register_namespace

fn register_namespace(ref self: T, namespace: ByteArray)

register_event

Registers an event in the world.

Arguments

  • namespace - The namespace of the event to be registered.
  • class_hash - The class hash of the event to be registered.

Fully qualified path: dojo::world::iworld::IWorld::register_event

fn register_event(ref self: T, namespace: ByteArray, class_hash: ClassHash)

register_model

Registers a model in the world.

Arguments

  • namespace - The namespace of the model to be registered.
  • class_hash - The class hash of the model to be registered.

Fully qualified path: dojo::world::iworld::IWorld::register_model

fn register_model(ref self: T, namespace: ByteArray, class_hash: ClassHash)

register_contract

Registers and deploys a contract associated with the world and returns the address of newly deployed contract.

Arguments

  • salt - The salt use for contract deployment.
  • namespace - The namespace of the contract to be registered.
  • class_hash - The class hash of the contract.

Fully qualified path: dojo::world::iworld::IWorld::register_contract

fn register_contract(
    ref self: T, salt: felt252, namespace: ByteArray, class_hash: ClassHash,
) -> ContractAddress

register_external_contract

Registers an already deployed external contract.

Arguments

  • namespace - The namespace of the external contract.
  • contract_name - The Starknet contract name.
  • instance_name - A name given to this instance of contract_name.
  • contract_address - The address of the deployed contract.
  • block_number - The block number to use to start contract indexing.

Fully qualified path: dojo::world::iworld::IWorld::register_external_contract

fn register_external_contract(
    ref self: T,
    namespace: ByteArray,
    contract_name: ByteArray,
    instance_name: ByteArray,
    contract_address: ContractAddress,
    block_number: u64,
)

register_library

Registers and declare a library associated with the world and returns the class_hash of newly declared library.

Arguments

  • namespace - The namespace of the contract to be registered.
  • class_hash - The class hash of the library.
  • name - The name of the library.
  • version - The version of the library.

Fully qualified path: dojo::world::iworld::IWorld::register_library

fn register_library(
    ref self: T, namespace: ByteArray, class_hash: ClassHash, name: ByteArray, version: ByteArray,
) -> ClassHash

init_contract

Initializes a contract associated registered in the world.

As a constructor call, the initialization function can be called only once, and only callable by the world itself.

Also, the caller of this function must have the writer owner permission for the contract resource.

Fully qualified path: dojo::world::iworld::IWorld::init_contract

fn init_contract(ref self: T, selector: felt252, init_calldata: Span<felt252>)

upgrade_event

Upgrades an event in the world.

Arguments

  • namespace - The namespace of the event to be upgraded.
  • class_hash - The class hash of the event to be upgraded.

Fully qualified path: dojo::world::iworld::IWorld::upgrade_event

fn upgrade_event(ref self: T, namespace: ByteArray, class_hash: ClassHash)

upgrade_model

Upgrades a model in the world.

Arguments

  • namespace - The namespace of the model to be upgraded.
  • class_hash - The class hash of the model to be upgraded.

Fully qualified path: dojo::world::iworld::IWorld::upgrade_model

fn upgrade_model(ref self: T, namespace: ByteArray, class_hash: ClassHash)

upgrade_contract

Upgrades an already deployed contract associated with the world and returns the new class hash.

Arguments

  • namespace - The namespace of the contract to be upgraded.
  • class_hash - The class hash of the contract.

Fully qualified path: dojo::world::iworld::IWorld::upgrade_contract

fn upgrade_contract(ref self: T, namespace: ByteArray, class_hash: ClassHash) -> ClassHash

upgrade_external_contract

Upgrades an already registered external contract with a new address.

Arguments

  • namespace - The namespace of the external contract.
  • instance_name - The contract instance name.
  • contract_address - The new address of the deployed contract.
  • block_number - The block number to use to start contract indexing.

Fully qualified path: dojo::world::iworld::IWorld::upgrade_external_contract

fn upgrade_external_contract(
    ref self: T,
    namespace: ByteArray,
    instance_name: ByteArray,
    contract_address: ContractAddress,
    block_number: u64,
)

emit_event

Emits a custom event that was previously registered in the world. The dojo event emission is permissioned, since data are collected by Torii and served to clients.

Arguments

  • event_selector - The selector of the event.
  • keys - The keys of the event.
  • values - The data to be logged by the event.

Fully qualified path: dojo::world::iworld::IWorld::emit_event

fn emit_event(ref self: T, event_selector: felt252, keys: Span<felt252>, values: Span<felt252>)

emit_events

Emits multiple events. Permissions are only checked once, then the events are batched.

Arguments

  • event_selector - The selector of the event.
  • keys - The keys of the event.
  • values - The data to be logged by the event.

Fully qualified path: dojo::world::iworld::IWorld::emit_events

fn emit_events(
    ref self: T, event_selector: felt252, keys: Span<Span<felt252>>, values: Span<Span<felt252>>,
)

entity

Gets the values of a model entity/member. Returns a zero initialized model value if the entity/member has not been set.

Arguments

  • model_selector - The selector of the model to be retrieved.
  • index - The index of the entity/member to read.
  • layout - The memory layout of the model.

Returns

  • Span<felt252> - The serialized value of the model, zero initialized if not set.

Fully qualified path: dojo::world::iworld::IWorld::entity

fn entity(self: @T, model_selector: felt252, index: ModelIndex, layout: Layout) -> Span<felt252>

entities

Gets the model values for the given entities.

Arguments

  • model_selector - The selector of the model to be retrieved.
  • indices - The indexes of the entities/members to read.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorld::entities

fn entities(
    self: @T, model_selector: felt252, indexes: Span<ModelIndex>, layout: Layout,
) -> Span<Span<felt252>>

set_entity

Sets the model value for the given entity/member.

Arguments

  • model_selector - The selector of the model to be set.
  • index - The index of the entity/member to write.
  • values - The value to be set, serialized using the model layout format.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorld::set_entity

fn set_entity(
    ref self: T, model_selector: felt252, index: ModelIndex, values: Span<felt252>, layout: Layout,
)

set_entities

Sets the model values for the given entities. The permissions are only checked once, then the writes are batched.

Arguments

  • model_selector - The selector of the model to be set.
  • indexes - The indexes of the entities/members to write.
  • values - The values to be set, serialized using the model layout format.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorld::set_entities

fn set_entities(
    ref self: T,
    model_selector: felt252,
    indexes: Span<ModelIndex>,
    values: Span<Span<felt252>>,
    layout: Layout,
)

delete_entity

Deletes a model value for the given entity/member. Deleting is setting all the values to 0 in the given layout.

Arguments

  • model_selector - The selector of the model to be deleted.
  • index - The index of the entity/member to delete.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorld::delete_entity

fn delete_entity(ref self: T, model_selector: felt252, index: ModelIndex, layout: Layout)

delete_entities

Deletes the model values for the given entities. The permissions are only checked once, then the deletes are batched.

Arguments

  • model_selector - The selector of the model to be deleted.
  • indexes - The indexes of the entities/members to delete.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorld::delete_entities

fn delete_entities(ref self: T, model_selector: felt252, indexes: Span<ModelIndex>, layout: Layout)

is_owner

Returns true if the provided account has owner permission for the resource, false otherwise.

Arguments

  • resource - The selector of the resource.
  • address - The address of the contract.

Fully qualified path: dojo::world::iworld::IWorld::is_owner

fn is_owner(self: @T, resource: felt252, address: ContractAddress) -> bool

grant_owner

Grants owner permission to the address. Can only be called by an existing owner or the world admin.

Note that this resource must have been registered to the world first.

Arguments

  • resource - The selector of the resource.
  • address - The address of the contract to grant owner permission to.

Fully qualified path: dojo::world::iworld::IWorld::grant_owner

fn grant_owner(ref self: T, resource: felt252, address: ContractAddress)

revoke_owner

Revokes owner permission to the contract for the resource. Can only be called by an existing owner or the world admin.

Note that this resource must have been registered to the world first.

Arguments

  • resource - The selector of the resource.
  • address - The address of the contract to revoke owner permission from.

Fully qualified path: dojo::world::iworld::IWorld::revoke_owner

fn revoke_owner(ref self: T, resource: felt252, address: ContractAddress)

owners_count

Get the number of owners for a resource.

Arguments

  • resource - The selector of the resource.

Fully qualified path: dojo::world::iworld::IWorld::owners_count

fn owners_count(self: @T, resource: felt252) -> u64

is_writer

Returns true if the provided contract has writer permission for the resource, false otherwise.

Arguments

  • resource - The selector of the resource.
  • contract - The address of the contract.

Fully qualified path: dojo::world::iworld::IWorld::is_writer

fn is_writer(self: @T, resource: felt252, contract: ContractAddress) -> bool

grant_writer

Grants writer permission to the contract for the resource. Can only be called by an existing resource owner or the world admin.

Note that this resource must have been registered to the world first.

Arguments

  • resource - The selector of the resource.
  • contract - The address of the contract to grant writer permission to.

Fully qualified path: dojo::world::iworld::IWorld::grant_writer

fn grant_writer(ref self: T, resource: felt252, contract: ContractAddress)

revoke_writer

Revokes writer permission to the contract for the resource. Can only be called by an existing resource owner or the world admin.

Note that this resource must have been registered to the world first.

Arguments

  • resource - The selector of the resource.
  • contract - The address of the contract to revoke writer permission from.

Fully qualified path: dojo::world::iworld::IWorld::revoke_writer

fn revoke_writer(ref self: T, resource: felt252, contract: ContractAddress)

resource

World’s resources.

Fully qualified path: dojo::world::resource

Enums

ResourceResource is the type of the resource that can be registered in the world. Caching the namespace hash of a contract and model in the world saves gas, instead…

Traits

Enums

Enums

ResourceResource is the type of the resource that can be registered in the world. Caching the namespace hash of a contract and model in the world saves gas, instead…

Resource

Resource is the type of the resource that can be registered in the world.

Caching the namespace hash of a contract and model in the world saves gas, instead of re-computing the descriptor each time, which involves several poseidon hash operations.

Namespaced resources: Those resources are scoped by a namespace, which defines a logical separation of resources. Namespaced resources are Model, Event and Contract.

  • World: The world itself, identified by the selector 0.

  • Namespace: ByteArray Namespace is a unique resource type, identified by a ByteArray, to scope models, events and contracts. The poseidon hash of the serialized ByteArray is used as the namespace hash.

  • Model: (ContractAddress, NamespaceHash) A model defines data that can be stored in the world’s storage.

  • Event: (ContractAddress, NamespaceHash) An event is never stored in the world’s storage, but it’s emitted by the world to be consumed by off-chain components.

  • Contract: (ContractAddress, NamespaceHash) A contract defines user logic to interact with the world’s data (models) and to emit events.

  • Library: (ClassHash, NamespaceHash) A library defines user logic.

  • Unregistered: The unregistered state, required to ensure the security of the world to not have operations done on non-existent resources.

WARNING: enum order must be preserved to ensure backward compatibility

Fully qualified path: dojo::world::resource::Resource

pub enum Resource {
    Model: (ContractAddress, felt252),
    Event: (ContractAddress, felt252),
    Contract: (ContractAddress, felt252),
    Namespace: ByteArray,
    World,
    Unregistered,
    Library: (ClassHash, felt252),
    ExternalContract: (ContractAddress, felt252),
}

Variants

Model

Fully qualified path: dojo::world::resource::Resource::Model

Model: (ContractAddress, felt252)

Event

Fully qualified path: dojo::world::resource::Resource::Event

Event: (ContractAddress, felt252)

Contract

Fully qualified path: dojo::world::resource::Resource::Contract

Contract: (ContractAddress, felt252)

Namespace

Fully qualified path: dojo::world::resource::Resource::Namespace

Namespace: ByteArray

World

Fully qualified path: dojo::world::resource::Resource::World

World

Unregistered

Fully qualified path: dojo::world::resource::Resource::Unregistered

Unregistered

Library

Fully qualified path: dojo::world::resource::Resource::Library

Library: (ClassHash, felt252)

ExternalContract

Fully qualified path: dojo::world::resource::Resource::ExternalContract

ExternalContract: (ContractAddress, felt252)

Traits

Traits

ResourceIsNoneTrait

Fully qualified path: dojo::world::resource::ResourceIsNoneTrait

pub trait ResourceIsNoneTrait

Trait functions

is_unregistered

Returns true if the resource is unregistered, false otherwise.

Fully qualified path: dojo::world::resource::ResourceIsNoneTrait::is_unregistered

fn is_unregistered(self: @Resource) -> bool

world_contract

Fully qualified path: dojo::world::world_contract

Modules

world

Modules

Modules

world

world

Fully qualified path: dojo::world::world_contract::world

Constants

Free functions

Structs

Enums

Event

Re-exports:

StorageMapReadAccessProvides direct read access to values in a storage Map ….
StorageMapWriteAccessProvides direct write access to values in a storage Map . Enables directly storing values in the contract’s storage at the address of the given key….
StoragePointerReadAccessTrait for accessing the values in storage using a StoragePointer ….
StoragePointerWriteAccessTrait for writing values to storage using a StoragePointer ….

Constants

Constants

WORLD

Fully qualified path: dojo::world::world_contract::world::WORLD

pub const WORLD: felt252 = 0;

DOJO_INIT_SELECTOR

Fully qualified path: dojo::world::world_contract::world::DOJO_INIT_SELECTOR

pub const DOJO_INIT_SELECTOR: felt252 =
    1128850483541916671768315581934581231420525468106385933221085263345722313923;

WORLD_VERSION

Fully qualified path: dojo::world::world_contract::world::WORLD_VERSION

pub const WORLD_VERSION: felt252 = 211228831280;

Free functions

Free functions

unsafe_new_contract_state

Fully qualified path: dojo::world::world_contract::world::unsafe_new_contract_state

pub fn unsafe_new_contract_state() -> ContractState

Structs

Structs

WorldSpawned

Fully qualified path: dojo::world::world_contract::world::WorldSpawned

[derive(Drop, starknet::Event)]
pub struct WorldSpawned {
    pub creator: ContractAddress,
    pub class_hash: ClassHash,
}

Members

creator

Fully qualified path: dojo::world::world_contract::world::WorldSpawned::creator

pub creator: ContractAddress

class_hash

Fully qualified path: dojo::world::world_contract::world::WorldSpawned::class_hash

pub class_hash: ClassHash

WorldUpgraded

Fully qualified path: dojo::world::world_contract::world::WorldUpgraded

[derive(Drop, starknet::Event)]
pub struct WorldUpgraded {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::world::world_contract::world::WorldUpgraded::class_hash

pub class_hash: ClassHash

ContractRegistered

Fully qualified path: dojo::world::world_contract::world::ContractRegistered

[derive(Drop, starknet::Event)]
pub struct ContractRegistered {
    pub name: ByteArray,
    pub namespace: ByteArray,
    pub address: ContractAddress,
    pub class_hash: ClassHash,
    pub salt: felt252,
}

Members

name

Fully qualified path: dojo::world::world_contract::world::ContractRegistered::name

pub name: ByteArray

namespace

Fully qualified path: dojo::world::world_contract::world::ContractRegistered::namespace

pub namespace: ByteArray

address

Fully qualified path: dojo::world::world_contract::world::ContractRegistered::address

pub address: ContractAddress

class_hash

Fully qualified path: dojo::world::world_contract::world::ContractRegistered::class_hash

pub class_hash: ClassHash

salt

Fully qualified path: dojo::world::world_contract::world::ContractRegistered::salt

pub salt: felt252

ContractUpgraded

Fully qualified path: dojo::world::world_contract::world::ContractUpgraded

[derive(Drop, starknet::Event)]
pub struct ContractUpgraded {
    pub selector: felt252,
    pub class_hash: ClassHash,
}

Members

selector

Fully qualified path: dojo::world::world_contract::world::ContractUpgraded::selector

pub selector: felt252

class_hash

Fully qualified path: dojo::world::world_contract::world::ContractUpgraded::class_hash

pub class_hash: ClassHash

ExternalContractRegistered

Fully qualified path: dojo::world::world_contract::world::ExternalContractRegistered

[derive(Drop, starknet::Event)]
pub struct ExternalContractRegistered {
    pub namespace: ByteArray,
    pub contract_name: ByteArray,
    pub instance_name: ByteArray,
    pub contract_selector: felt252,
    pub class_hash: ClassHash,
    pub contract_address: ContractAddress,
    pub block_number: u64,
}

Members

namespace

Fully qualified path: dojo::world::world_contract::world::ExternalContractRegistered::namespace

pub namespace: ByteArray

contract_name

Fully qualified path: dojo::world::world_contract::world::ExternalContractRegistered::contract_name

pub contract_name: ByteArray

instance_name

Fully qualified path: dojo::world::world_contract::world::ExternalContractRegistered::instance_name

pub instance_name: ByteArray

contract_selector

Fully qualified path: dojo::world::world_contract::world::ExternalContractRegistered::contract_selector

pub contract_selector: felt252

class_hash

Fully qualified path: dojo::world::world_contract::world::ExternalContractRegistered::class_hash

pub class_hash: ClassHash

contract_address

Fully qualified path: dojo::world::world_contract::world::ExternalContractRegistered::contract_address

pub contract_address: ContractAddress

block_number

Fully qualified path: dojo::world::world_contract::world::ExternalContractRegistered::block_number

pub block_number: u64

ExternalContractUpgraded

Fully qualified path: dojo::world::world_contract::world::ExternalContractUpgraded

[derive(Drop, starknet::Event)]
pub struct ExternalContractUpgraded {
    pub namespace: ByteArray,
    pub instance_name: ByteArray,
    pub contract_selector: felt252,
    pub class_hash: ClassHash,
    pub contract_address: ContractAddress,
    pub block_number: u64,
}

Members

namespace

Fully qualified path: dojo::world::world_contract::world::ExternalContractUpgraded::namespace

pub namespace: ByteArray

instance_name

Fully qualified path: dojo::world::world_contract::world::ExternalContractUpgraded::instance_name

pub instance_name: ByteArray

contract_selector

Fully qualified path: dojo::world::world_contract::world::ExternalContractUpgraded::contract_selector

pub contract_selector: felt252

class_hash

Fully qualified path: dojo::world::world_contract::world::ExternalContractUpgraded::class_hash

pub class_hash: ClassHash

contract_address

Fully qualified path: dojo::world::world_contract::world::ExternalContractUpgraded::contract_address

pub contract_address: ContractAddress

block_number

Fully qualified path: dojo::world::world_contract::world::ExternalContractUpgraded::block_number

pub block_number: u64

LibraryRegistered

Fully qualified path: dojo::world::world_contract::world::LibraryRegistered

[derive(Drop, starknet::Event)]
pub struct LibraryRegistered {
    pub name: ByteArray,
    pub namespace: ByteArray,
    pub class_hash: ClassHash,
}

Members

name

Fully qualified path: dojo::world::world_contract::world::LibraryRegistered::name

pub name: ByteArray

namespace

Fully qualified path: dojo::world::world_contract::world::LibraryRegistered::namespace

pub namespace: ByteArray

class_hash

Fully qualified path: dojo::world::world_contract::world::LibraryRegistered::class_hash

pub class_hash: ClassHash

MetadataUpdate

Fully qualified path: dojo::world::world_contract::world::MetadataUpdate

[derive(Drop, starknet::Event)]
pub struct MetadataUpdate {
    pub resource: felt252,
    pub uri: ByteArray,
    pub hash: felt252,
}

Members

resource

Fully qualified path: dojo::world::world_contract::world::MetadataUpdate::resource

pub resource: felt252

uri

Fully qualified path: dojo::world::world_contract::world::MetadataUpdate::uri

pub uri: ByteArray

hash

Fully qualified path: dojo::world::world_contract::world::MetadataUpdate::hash

pub hash: felt252

NamespaceRegistered

Fully qualified path: dojo::world::world_contract::world::NamespaceRegistered

[derive(Drop, starknet::Event)]
pub struct NamespaceRegistered {
    pub namespace: ByteArray,
    pub hash: felt252,
}

Members

namespace

Fully qualified path: dojo::world::world_contract::world::NamespaceRegistered::namespace

pub namespace: ByteArray

hash

Fully qualified path: dojo::world::world_contract::world::NamespaceRegistered::hash

pub hash: felt252

ModelRegistered

Fully qualified path: dojo::world::world_contract::world::ModelRegistered

[derive(Drop, starknet::Event)]
pub struct ModelRegistered {
    pub name: ByteArray,
    pub namespace: ByteArray,
    pub class_hash: ClassHash,
    pub address: ContractAddress,
}

Members

name

Fully qualified path: dojo::world::world_contract::world::ModelRegistered::name

pub name: ByteArray

namespace

Fully qualified path: dojo::world::world_contract::world::ModelRegistered::namespace

pub namespace: ByteArray

class_hash

Fully qualified path: dojo::world::world_contract::world::ModelRegistered::class_hash

pub class_hash: ClassHash

address

Fully qualified path: dojo::world::world_contract::world::ModelRegistered::address

pub address: ContractAddress

ModelUpgraded

Fully qualified path: dojo::world::world_contract::world::ModelUpgraded

[derive(Drop, starknet::Event)]
pub struct ModelUpgraded {
    pub selector: felt252,
    pub class_hash: ClassHash,
    pub address: ContractAddress,
    pub prev_address: ContractAddress,
}

Members

selector

Fully qualified path: dojo::world::world_contract::world::ModelUpgraded::selector

pub selector: felt252

class_hash

Fully qualified path: dojo::world::world_contract::world::ModelUpgraded::class_hash

pub class_hash: ClassHash

address

Fully qualified path: dojo::world::world_contract::world::ModelUpgraded::address

pub address: ContractAddress

prev_address

Fully qualified path: dojo::world::world_contract::world::ModelUpgraded::prev_address

pub prev_address: ContractAddress

EventRegistered

Fully qualified path: dojo::world::world_contract::world::EventRegistered

[derive(Drop, starknet::Event)]
pub struct EventRegistered {
    pub name: ByteArray,
    pub namespace: ByteArray,
    pub class_hash: ClassHash,
    pub address: ContractAddress,
}

Members

name

Fully qualified path: dojo::world::world_contract::world::EventRegistered::name

pub name: ByteArray

namespace

Fully qualified path: dojo::world::world_contract::world::EventRegistered::namespace

pub namespace: ByteArray

class_hash

Fully qualified path: dojo::world::world_contract::world::EventRegistered::class_hash

pub class_hash: ClassHash

address

Fully qualified path: dojo::world::world_contract::world::EventRegistered::address

pub address: ContractAddress

EventUpgraded

Fully qualified path: dojo::world::world_contract::world::EventUpgraded

[derive(Drop, starknet::Event)]
pub struct EventUpgraded {
    pub selector: felt252,
    pub class_hash: ClassHash,
    pub address: ContractAddress,
    pub prev_address: ContractAddress,
}

Members

selector

Fully qualified path: dojo::world::world_contract::world::EventUpgraded::selector

pub selector: felt252

class_hash

Fully qualified path: dojo::world::world_contract::world::EventUpgraded::class_hash

pub class_hash: ClassHash

address

Fully qualified path: dojo::world::world_contract::world::EventUpgraded::address

pub address: ContractAddress

prev_address

Fully qualified path: dojo::world::world_contract::world::EventUpgraded::prev_address

pub prev_address: ContractAddress

StoreSetRecord

Fully qualified path: dojo::world::world_contract::world::StoreSetRecord

[derive(Drop, starknet::Event)]
pub struct StoreSetRecord {
    pub selector: felt252,
    pub entity_id: felt252,
    pub keys: Span<felt252>,
    pub values: Span<felt252>,
}

Members

selector

Fully qualified path: dojo::world::world_contract::world::StoreSetRecord::selector

pub selector: felt252

entity_id

Fully qualified path: dojo::world::world_contract::world::StoreSetRecord::entity_id

pub entity_id: felt252

keys

Fully qualified path: dojo::world::world_contract::world::StoreSetRecord::keys

pub keys: Span<felt252>

values

Fully qualified path: dojo::world::world_contract::world::StoreSetRecord::values

pub values: Span<felt252>

StoreUpdateRecord

Fully qualified path: dojo::world::world_contract::world::StoreUpdateRecord

[derive(Drop, starknet::Event)]
pub struct StoreUpdateRecord {
    pub selector: felt252,
    pub entity_id: felt252,
    pub values: Span<felt252>,
}

Members

selector

Fully qualified path: dojo::world::world_contract::world::StoreUpdateRecord::selector

pub selector: felt252

entity_id

Fully qualified path: dojo::world::world_contract::world::StoreUpdateRecord::entity_id

pub entity_id: felt252

values

Fully qualified path: dojo::world::world_contract::world::StoreUpdateRecord::values

pub values: Span<felt252>

StoreUpdateMember

Fully qualified path: dojo::world::world_contract::world::StoreUpdateMember

[derive(Drop, starknet::Event)]
pub struct StoreUpdateMember {
    pub selector: felt252,
    pub entity_id: felt252,
    pub member_selector: felt252,
    pub values: Span<felt252>,
}

Members

selector

Fully qualified path: dojo::world::world_contract::world::StoreUpdateMember::selector

pub selector: felt252

entity_id

Fully qualified path: dojo::world::world_contract::world::StoreUpdateMember::entity_id

pub entity_id: felt252

member_selector

Fully qualified path: dojo::world::world_contract::world::StoreUpdateMember::member_selector

pub member_selector: felt252

values

Fully qualified path: dojo::world::world_contract::world::StoreUpdateMember::values

pub values: Span<felt252>

StoreDelRecord

Fully qualified path: dojo::world::world_contract::world::StoreDelRecord

[derive(Drop, starknet::Event)]
pub struct StoreDelRecord {
    pub selector: felt252,
    pub entity_id: felt252,
}

Members

selector

Fully qualified path: dojo::world::world_contract::world::StoreDelRecord::selector

pub selector: felt252

entity_id

Fully qualified path: dojo::world::world_contract::world::StoreDelRecord::entity_id

pub entity_id: felt252

WriterUpdated

Fully qualified path: dojo::world::world_contract::world::WriterUpdated

[derive(Drop, starknet::Event)]
pub struct WriterUpdated {
    pub resource: felt252,
    pub contract: ContractAddress,
    pub value: bool,
}

Members

resource

Fully qualified path: dojo::world::world_contract::world::WriterUpdated::resource

pub resource: felt252

contract

Fully qualified path: dojo::world::world_contract::world::WriterUpdated::contract

pub contract: ContractAddress

value

Fully qualified path: dojo::world::world_contract::world::WriterUpdated::value

pub value: bool

OwnerUpdated

Fully qualified path: dojo::world::world_contract::world::OwnerUpdated

[derive(Drop, starknet::Event)]
pub struct OwnerUpdated {
    pub resource: felt252,
    pub contract: ContractAddress,
    pub value: bool,
}

Members

resource

Fully qualified path: dojo::world::world_contract::world::OwnerUpdated::resource

pub resource: felt252

contract

Fully qualified path: dojo::world::world_contract::world::OwnerUpdated::contract

pub contract: ContractAddress

value

Fully qualified path: dojo::world::world_contract::world::OwnerUpdated::value

pub value: bool

ContractInitialized

Fully qualified path: dojo::world::world_contract::world::ContractInitialized

[derive(Drop, starknet::Event)]
pub struct ContractInitialized {
    pub selector: felt252,
    pub init_calldata: Span<felt252>,
}

Members

selector

Fully qualified path: dojo::world::world_contract::world::ContractInitialized::selector

pub selector: felt252

init_calldata

Fully qualified path: dojo::world::world_contract::world::ContractInitialized::init_calldata

pub init_calldata: Span<felt252>

EventEmitted

Fully qualified path: dojo::world::world_contract::world::EventEmitted

[derive(Drop, starknet::Event)]
pub struct EventEmitted {
    pub selector: felt252,
    pub system_address: ContractAddress,
    pub keys: Span<felt252>,
    pub values: Span<felt252>,
}

Members

selector

Fully qualified path: dojo::world::world_contract::world::EventEmitted::selector

pub selector: felt252

system_address

Fully qualified path: dojo::world::world_contract::world::EventEmitted::system_address

pub system_address: ContractAddress

keys

Fully qualified path: dojo::world::world_contract::world::EventEmitted::keys

pub keys: Span<felt252>

values

Fully qualified path: dojo::world::world_contract::world::EventEmitted::values

pub values: Span<felt252>

ContractState

Fully qualified path: dojo::world::world_contract::world::ContractState

pub struct ContractState {}

Enums

Enums

Event

Event

Fully qualified path: dojo::world::world_contract::world::Event

pub enum Event {
    WorldSpawned: WorldSpawned,
    WorldUpgraded: WorldUpgraded,
    NamespaceRegistered: NamespaceRegistered,
    ModelRegistered: ModelRegistered,
    EventRegistered: EventRegistered,
    ContractRegistered: ContractRegistered,
    ExternalContractRegistered: ExternalContractRegistered,
    ExternalContractUpgraded: ExternalContractUpgraded,
    ModelUpgraded: ModelUpgraded,
    EventUpgraded: EventUpgraded,
    ContractUpgraded: ContractUpgraded,
    ContractInitialized: ContractInitialized,
    LibraryRegistered: LibraryRegistered,
    EventEmitted: EventEmitted,
    MetadataUpdate: MetadataUpdate,
    StoreSetRecord: StoreSetRecord,
    StoreUpdateRecord: StoreUpdateRecord,
    StoreUpdateMember: StoreUpdateMember,
    StoreDelRecord: StoreDelRecord,
    WriterUpdated: WriterUpdated,
    OwnerUpdated: OwnerUpdated,
}

Variants

WorldSpawned

Fully qualified path: dojo::world::world_contract::world::Event::WorldSpawned

WorldSpawned: WorldSpawned

WorldUpgraded

Fully qualified path: dojo::world::world_contract::world::Event::WorldUpgraded

WorldUpgraded: WorldUpgraded

NamespaceRegistered

Fully qualified path: dojo::world::world_contract::world::Event::NamespaceRegistered

NamespaceRegistered: NamespaceRegistered

ModelRegistered

Fully qualified path: dojo::world::world_contract::world::Event::ModelRegistered

ModelRegistered: ModelRegistered

EventRegistered

Fully qualified path: dojo::world::world_contract::world::Event::EventRegistered

EventRegistered: EventRegistered

ContractRegistered

Fully qualified path: dojo::world::world_contract::world::Event::ContractRegistered

ContractRegistered: ContractRegistered

ExternalContractRegistered

Fully qualified path: dojo::world::world_contract::world::Event::ExternalContractRegistered

ExternalContractRegistered: ExternalContractRegistered

ExternalContractUpgraded

Fully qualified path: dojo::world::world_contract::world::Event::ExternalContractUpgraded

ExternalContractUpgraded: ExternalContractUpgraded

ModelUpgraded

Fully qualified path: dojo::world::world_contract::world::Event::ModelUpgraded

ModelUpgraded: ModelUpgraded

EventUpgraded

Fully qualified path: dojo::world::world_contract::world::Event::EventUpgraded

EventUpgraded: EventUpgraded

ContractUpgraded

Fully qualified path: dojo::world::world_contract::world::Event::ContractUpgraded

ContractUpgraded: ContractUpgraded

ContractInitialized

Fully qualified path: dojo::world::world_contract::world::Event::ContractInitialized

ContractInitialized: ContractInitialized

LibraryRegistered

Fully qualified path: dojo::world::world_contract::world::Event::LibraryRegistered

LibraryRegistered: LibraryRegistered

EventEmitted

Fully qualified path: dojo::world::world_contract::world::Event::EventEmitted

EventEmitted: EventEmitted

MetadataUpdate

Fully qualified path: dojo::world::world_contract::world::Event::MetadataUpdate

MetadataUpdate: MetadataUpdate

StoreSetRecord

Fully qualified path: dojo::world::world_contract::world::Event::StoreSetRecord

StoreSetRecord: StoreSetRecord

StoreUpdateRecord

Fully qualified path: dojo::world::world_contract::world::Event::StoreUpdateRecord

StoreUpdateRecord: StoreUpdateRecord

StoreUpdateMember

Fully qualified path: dojo::world::world_contract::world::Event::StoreUpdateMember

StoreUpdateMember: StoreUpdateMember

StoreDelRecord

Fully qualified path: dojo::world::world_contract::world::Event::StoreDelRecord

StoreDelRecord: StoreDelRecord

WriterUpdated

Fully qualified path: dojo::world::world_contract::world::Event::WriterUpdated

WriterUpdated: WriterUpdated

OwnerUpdated

Fully qualified path: dojo::world::world_contract::world::Event::OwnerUpdated

OwnerUpdated: OwnerUpdated

dispatchers

Structs

Structs

IContractDispatcher

Fully qualified path: dojo::contract::interface::IContractDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IContractDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::contract::interface::IContractDispatcher::contract_address

pub contract_address: ContractAddress

ILibraryDispatcher

Fully qualified path: dojo::contract::interface::ILibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct ILibraryDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::contract::interface::ILibraryDispatcher::contract_address

pub contract_address: ContractAddress

IContractLibraryDispatcher

Fully qualified path: dojo::contract::interface::IContractLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IContractLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::contract::interface::IContractLibraryDispatcher::class_hash

pub class_hash: ClassHash

IContractSafeLibraryDispatcher

Fully qualified path: dojo::contract::interface::IContractSafeLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IContractSafeLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::contract::interface::IContractSafeLibraryDispatcher::class_hash

pub class_hash: ClassHash

IContractSafeDispatcher

Fully qualified path: dojo::contract::interface::IContractSafeDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IContractSafeDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::contract::interface::IContractSafeDispatcher::contract_address

pub contract_address: ContractAddress

ILibraryLibraryDispatcher

Fully qualified path: dojo::contract::interface::ILibraryLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct ILibraryLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::contract::interface::ILibraryLibraryDispatcher::class_hash

pub class_hash: ClassHash

ILibrarySafeLibraryDispatcher

Fully qualified path: dojo::contract::interface::ILibrarySafeLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct ILibrarySafeLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::contract::interface::ILibrarySafeLibraryDispatcher::class_hash

pub class_hash: ClassHash

ILibrarySafeDispatcher

Fully qualified path: dojo::contract::interface::ILibrarySafeDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct ILibrarySafeDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::contract::interface::ILibrarySafeDispatcher::contract_address

pub contract_address: ContractAddress

IUpgradeableDispatcher

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IUpgradeableDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableDispatcher::contract_address

pub contract_address: ContractAddress

IUpgradeableLibraryDispatcher

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IUpgradeableLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableLibraryDispatcher::class_hash

pub class_hash: ClassHash

IUpgradeableSafeLibraryDispatcher

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableSafeLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IUpgradeableSafeLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableSafeLibraryDispatcher::class_hash

pub class_hash: ClassHash

IUpgradeableSafeDispatcher

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableSafeDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IUpgradeableSafeDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableSafeDispatcher::contract_address

pub contract_address: ContractAddress

IWorldProviderDispatcher

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IWorldProviderDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderDispatcher::contract_address

pub contract_address: ContractAddress

IWorldProviderLibraryDispatcher

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IWorldProviderLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderLibraryDispatcher::class_hash

pub class_hash: ClassHash

IWorldProviderSafeLibraryDispatcher

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderSafeLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IWorldProviderSafeLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderSafeLibraryDispatcher::class_hash

pub class_hash: ClassHash

IWorldProviderSafeDispatcher

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderSafeDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IWorldProviderSafeDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderSafeDispatcher::contract_address

pub contract_address: ContractAddress

IEventDispatcher

Fully qualified path: dojo::event::interface::IEventDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IEventDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::event::interface::IEventDispatcher::contract_address

pub contract_address: ContractAddress

IEventLibraryDispatcher

Fully qualified path: dojo::event::interface::IEventLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IEventLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::event::interface::IEventLibraryDispatcher::class_hash

pub class_hash: ClassHash

IEventSafeLibraryDispatcher

Fully qualified path: dojo::event::interface::IEventSafeLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IEventSafeLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::event::interface::IEventSafeLibraryDispatcher::class_hash

pub class_hash: ClassHash

IEventSafeDispatcher

Fully qualified path: dojo::event::interface::IEventSafeDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IEventSafeDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::event::interface::IEventSafeDispatcher::contract_address

pub contract_address: ContractAddress

IDeployedResourceDispatcher

Fully qualified path: dojo::meta::interface::IDeployedResourceDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IDeployedResourceDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::meta::interface::IDeployedResourceDispatcher::contract_address

pub contract_address: ContractAddress

IDeployedResourceLibraryDispatcher

Fully qualified path: dojo::meta::interface::IDeployedResourceLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IDeployedResourceLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::meta::interface::IDeployedResourceLibraryDispatcher::class_hash

pub class_hash: ClassHash

IStoredResourceDispatcher

Fully qualified path: dojo::meta::interface::IStoredResourceDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IStoredResourceDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::meta::interface::IStoredResourceDispatcher::contract_address

pub contract_address: ContractAddress

IDeployedResourceSafeLibraryDispatcher

Fully qualified path: dojo::meta::interface::IDeployedResourceSafeLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IDeployedResourceSafeLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::meta::interface::IDeployedResourceSafeLibraryDispatcher::class_hash

pub class_hash: ClassHash

IDeployedResourceSafeDispatcher

Fully qualified path: dojo::meta::interface::IDeployedResourceSafeDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IDeployedResourceSafeDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::meta::interface::IDeployedResourceSafeDispatcher::contract_address

pub contract_address: ContractAddress

IStoredResourceLibraryDispatcher

Fully qualified path: dojo::meta::interface::IStoredResourceLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IStoredResourceLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::meta::interface::IStoredResourceLibraryDispatcher::class_hash

pub class_hash: ClassHash

IStoredResourceSafeLibraryDispatcher

Fully qualified path: dojo::meta::interface::IStoredResourceSafeLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IStoredResourceSafeLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::meta::interface::IStoredResourceSafeLibraryDispatcher::class_hash

pub class_hash: ClassHash

IStoredResourceSafeDispatcher

Fully qualified path: dojo::meta::interface::IStoredResourceSafeDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IStoredResourceSafeDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::meta::interface::IStoredResourceSafeDispatcher::contract_address

pub contract_address: ContractAddress

IModelDispatcher

Fully qualified path: dojo::model::interface::IModelDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IModelDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::model::interface::IModelDispatcher::contract_address

pub contract_address: ContractAddress

IModelLibraryDispatcher

Fully qualified path: dojo::model::interface::IModelLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IModelLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::model::interface::IModelLibraryDispatcher::class_hash

pub class_hash: ClassHash

IModelSafeLibraryDispatcher

Fully qualified path: dojo::model::interface::IModelSafeLibraryDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IModelSafeLibraryDispatcher {
    pub class_hash: ClassHash,
}

Members

class_hash

Fully qualified path: dojo::model::interface::IModelSafeLibraryDispatcher::class_hash

pub class_hash: ClassHash

IModelSafeDispatcher

Fully qualified path: dojo::model::interface::IModelSafeDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IModelSafeDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::model::interface::IModelSafeDispatcher::contract_address

pub contract_address: ContractAddress

IUpgradeableWorldDispatcher

Fully qualified path: dojo::world::iworld::IUpgradeableWorldDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IUpgradeableWorldDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::world::iworld::IUpgradeableWorldDispatcher::contract_address

pub contract_address: ContractAddress

IWorldDispatcher

Fully qualified path: dojo::world::iworld::IWorldDispatcher

Part of the group: dispatchers

[doc(group: "dispatchers")]
[derive(Copy, Drop, starknet::Store, Serde)]
pub struct IWorldDispatcher {
    pub contract_address: ContractAddress,
}

Members

contract_address

Fully qualified path: dojo::world::iworld::IWorldDispatcher::contract_address

pub contract_address: ContractAddress

Traits

Traits

IContractDispatcherTrait

Fully qualified path: dojo::contract::interface::IContractDispatcherTrait

Part of the group: dispatchers

pub trait IContractDispatcherTrait<T>

ILibraryDispatcherTrait

Fully qualified path: dojo::contract::interface::ILibraryDispatcherTrait

Part of the group: dispatchers

pub trait ILibraryDispatcherTrait<T>

IContractSafeDispatcherTrait

Fully qualified path: dojo::contract::interface::IContractSafeDispatcherTrait

Part of the group: dispatchers

pub trait IContractSafeDispatcherTrait<T>

ILibrarySafeDispatcherTrait

Fully qualified path: dojo::contract::interface::ILibrarySafeDispatcherTrait

Part of the group: dispatchers

pub trait ILibrarySafeDispatcherTrait<T>

IUpgradeableDispatcherTrait

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableDispatcherTrait

Part of the group: dispatchers

pub trait IUpgradeableDispatcherTrait<T>

Trait functions

upgrade

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableDispatcherTrait::upgrade

fn upgrade(self: T, new_class_hash: ClassHash)

IUpgradeableSafeDispatcherTrait

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableSafeDispatcherTrait

Part of the group: dispatchers

pub trait IUpgradeableSafeDispatcherTrait<T>

Trait functions

upgrade

Fully qualified path: dojo::contract::components::upgradeable::IUpgradeableSafeDispatcherTrait::upgrade

fn upgrade(self: T, new_class_hash: ClassHash) -> Result<(), Array<felt252>>

IWorldProviderDispatcherTrait

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderDispatcherTrait

Part of the group: dispatchers

pub trait IWorldProviderDispatcherTrait<T>

Trait functions

world_dispatcher

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderDispatcherTrait::world_dispatcher

fn world_dispatcher(self: T) -> IWorldDispatcher

IWorldProviderSafeDispatcherTrait

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderSafeDispatcherTrait

Part of the group: dispatchers

pub trait IWorldProviderSafeDispatcherTrait<T>

Trait functions

world_dispatcher

Fully qualified path: dojo::contract::components::world_provider::IWorldProviderSafeDispatcherTrait::world_dispatcher

fn world_dispatcher(self: T) -> Result<IWorldDispatcher, Array<felt252>>

IEventDispatcherTrait

Fully qualified path: dojo::event::interface::IEventDispatcherTrait

Part of the group: dispatchers

pub trait IEventDispatcherTrait<T>

Trait functions

definition

Fully qualified path: dojo::event::interface::IEventDispatcherTrait::definition

fn definition(self: T) -> EventDef

IEventSafeDispatcherTrait

Fully qualified path: dojo::event::interface::IEventSafeDispatcherTrait

Part of the group: dispatchers

pub trait IEventSafeDispatcherTrait<T>

Trait functions

definition

Fully qualified path: dojo::event::interface::IEventSafeDispatcherTrait::definition

fn definition(self: T) -> Result<EventDef, Array<felt252>>

IDeployedResourceDispatcherTrait

Fully qualified path: dojo::meta::interface::IDeployedResourceDispatcherTrait

Part of the group: dispatchers

pub trait IDeployedResourceDispatcherTrait<T>

Trait functions

dojo_name

Fully qualified path: dojo::meta::interface::IDeployedResourceDispatcherTrait::dojo_name

fn dojo_name(self: T) -> ByteArray

IStoredResourceDispatcherTrait

Fully qualified path: dojo::meta::interface::IStoredResourceDispatcherTrait

Part of the group: dispatchers

pub trait IStoredResourceDispatcherTrait<T>

Trait functions

layout

Fully qualified path: dojo::meta::interface::IStoredResourceDispatcherTrait::layout

fn layout(self: T) -> Layout

schema

Fully qualified path: dojo::meta::interface::IStoredResourceDispatcherTrait::schema

fn schema(self: T) -> Struct

IDeployedResourceSafeDispatcherTrait

Fully qualified path: dojo::meta::interface::IDeployedResourceSafeDispatcherTrait

Part of the group: dispatchers

pub trait IDeployedResourceSafeDispatcherTrait<T>

Trait functions

dojo_name

Fully qualified path: dojo::meta::interface::IDeployedResourceSafeDispatcherTrait::dojo_name

fn dojo_name(self: T) -> Result<ByteArray, Array<felt252>>

IStoredResourceSafeDispatcherTrait

Fully qualified path: dojo::meta::interface::IStoredResourceSafeDispatcherTrait

Part of the group: dispatchers

pub trait IStoredResourceSafeDispatcherTrait<T>

Trait functions

layout

Fully qualified path: dojo::meta::interface::IStoredResourceSafeDispatcherTrait::layout

fn layout(self: T) -> Result<Layout, Array<felt252>>

schema

Fully qualified path: dojo::meta::interface::IStoredResourceSafeDispatcherTrait::schema

fn schema(self: T) -> Result<Struct, Array<felt252>>

IModelDispatcherTrait

Fully qualified path: dojo::model::interface::IModelDispatcherTrait

Part of the group: dispatchers

pub trait IModelDispatcherTrait<T>

Trait functions

unpacked_size

Fully qualified path: dojo::model::interface::IModelDispatcherTrait::unpacked_size

fn unpacked_size(self: T) -> Option<u32>

packed_size

Fully qualified path: dojo::model::interface::IModelDispatcherTrait::packed_size

fn packed_size(self: T) -> Option<u32>

definition

Fully qualified path: dojo::model::interface::IModelDispatcherTrait::definition

fn definition(self: T) -> ModelDef

use_legacy_storage

Fully qualified path: dojo::model::interface::IModelDispatcherTrait::use_legacy_storage

fn use_legacy_storage(self: T) -> bool

IModelSafeDispatcherTrait

Fully qualified path: dojo::model::interface::IModelSafeDispatcherTrait

Part of the group: dispatchers

pub trait IModelSafeDispatcherTrait<T>

Trait functions

unpacked_size

Fully qualified path: dojo::model::interface::IModelSafeDispatcherTrait::unpacked_size

fn unpacked_size(self: T) -> Result<Option<u32>, Array<felt252>>

packed_size

Fully qualified path: dojo::model::interface::IModelSafeDispatcherTrait::packed_size

fn packed_size(self: T) -> Result<Option<u32>, Array<felt252>>

definition

Fully qualified path: dojo::model::interface::IModelSafeDispatcherTrait::definition

fn definition(self: T) -> Result<ModelDef, Array<felt252>>

use_legacy_storage

Fully qualified path: dojo::model::interface::IModelSafeDispatcherTrait::use_legacy_storage

fn use_legacy_storage(self: T) -> Result<bool, Array<felt252>>

IUpgradeableWorldDispatcherTrait

Fully qualified path: dojo::world::iworld::IUpgradeableWorldDispatcherTrait

Part of the group: dispatchers

pub trait IUpgradeableWorldDispatcherTrait<T>

Trait functions

upgrade

Upgrades the world with new_class_hash.

Arguments

  • new_class_hash - The new world class hash.

Fully qualified path: dojo::world::iworld::IUpgradeableWorldDispatcherTrait::upgrade

fn upgrade(self: T, new_class_hash: ClassHash)

IWorldDispatcherTrait

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait

Part of the group: dispatchers

pub trait IWorldDispatcherTrait<T>

Trait functions

resource

Returns the resource from its selector.

Arguments

  • selector - the resource selector

Returns

  • Resource - the resource data associated with the selector.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::resource

fn resource(self: T, selector: felt252) -> Resource

world_version

Returns the version of the world contract as a short string.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::world_version

fn world_version(self: T) -> felt252

uuid

Issues an autoincremented id to the caller. This functionalities is useful to generate unique, but sequential ids.

Note: This functionalities may impact performances since transaction parallelisation can’t be achieved since the same storage slot is being written.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::uuid

fn uuid(self: T) -> u32

metadata

Returns the metadata of the resource.

Arguments

resource_selector - The resource selector.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::metadata

fn metadata(self: T, resource_selector: felt252) -> ResourceMetadata

set_metadata

Sets the metadata of the resource.

Arguments

metadata - The metadata content for the resource.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::set_metadata

fn set_metadata(self: T, metadata: ResourceMetadata)

register_namespace

Registers a namespace in the world.

Arguments

  • namespace - The name of the namespace to be registered.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::register_namespace

fn register_namespace(self: T, namespace: ByteArray)

register_event

Registers an event in the world.

Arguments

  • namespace - The namespace of the event to be registered.
  • class_hash - The class hash of the event to be registered.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::register_event

fn register_event(self: T, namespace: ByteArray, class_hash: ClassHash)

register_model

Registers a model in the world.

Arguments

  • namespace - The namespace of the model to be registered.
  • class_hash - The class hash of the model to be registered.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::register_model

fn register_model(self: T, namespace: ByteArray, class_hash: ClassHash)

register_contract

Registers and deploys a contract associated with the world and returns the address of newly deployed contract.

Arguments

  • salt - The salt use for contract deployment.
  • namespace - The namespace of the contract to be registered.
  • class_hash - The class hash of the contract.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::register_contract

fn register_contract(
    self: T, salt: felt252, namespace: ByteArray, class_hash: ClassHash,
) -> ContractAddress

register_external_contract

Registers an already deployed external contract.

Arguments

  • namespace - The namespace of the external contract.
  • contract_name - The Starknet contract name.
  • instance_name - A name given to this instance of contract_name.
  • contract_address - The address of the deployed contract.
  • block_number - The block number to use to start contract indexing.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::register_external_contract

fn register_external_contract(
    self: T,
    namespace: ByteArray,
    contract_name: ByteArray,
    instance_name: ByteArray,
    contract_address: ContractAddress,
    block_number: u64,
)

register_library

Registers and declare a library associated with the world and returns the class_hash of newly declared library.

Arguments

  • namespace - The namespace of the contract to be registered.
  • class_hash - The class hash of the library.
  • name - The name of the library.
  • version - The version of the library.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::register_library

fn register_library(
    self: T, namespace: ByteArray, class_hash: ClassHash, name: ByteArray, version: ByteArray,
) -> ClassHash

init_contract

Initializes a contract associated registered in the world.

As a constructor call, the initialization function can be called only once, and only callable by the world itself.

Also, the caller of this function must have the writer owner permission for the contract resource.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::init_contract

fn init_contract(self: T, selector: felt252, init_calldata: Span<felt252>)

upgrade_event

Upgrades an event in the world.

Arguments

  • namespace - The namespace of the event to be upgraded.
  • class_hash - The class hash of the event to be upgraded.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::upgrade_event

fn upgrade_event(self: T, namespace: ByteArray, class_hash: ClassHash)

upgrade_model

Upgrades a model in the world.

Arguments

  • namespace - The namespace of the model to be upgraded.
  • class_hash - The class hash of the model to be upgraded.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::upgrade_model

fn upgrade_model(self: T, namespace: ByteArray, class_hash: ClassHash)

upgrade_contract

Upgrades an already deployed contract associated with the world and returns the new class hash.

Arguments

  • namespace - The namespace of the contract to be upgraded.
  • class_hash - The class hash of the contract.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::upgrade_contract

fn upgrade_contract(self: T, namespace: ByteArray, class_hash: ClassHash) -> ClassHash

upgrade_external_contract

Upgrades an already registered external contract with a new address.

Arguments

  • namespace - The namespace of the external contract.
  • instance_name - The contract instance name.
  • contract_address - The new address of the deployed contract.
  • block_number - The block number to use to start contract indexing.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::upgrade_external_contract

fn upgrade_external_contract(
    self: T,
    namespace: ByteArray,
    instance_name: ByteArray,
    contract_address: ContractAddress,
    block_number: u64,
)

emit_event

Emits a custom event that was previously registered in the world. The dojo event emission is permissioned, since data are collected by Torii and served to clients.

Arguments

  • event_selector - The selector of the event.
  • keys - The keys of the event.
  • values - The data to be logged by the event.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::emit_event

fn emit_event(self: T, event_selector: felt252, keys: Span<felt252>, values: Span<felt252>)

emit_events

Emits multiple events. Permissions are only checked once, then the events are batched.

Arguments

  • event_selector - The selector of the event.
  • keys - The keys of the event.
  • values - The data to be logged by the event.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::emit_events

fn emit_events(
    self: T, event_selector: felt252, keys: Span<Span<felt252>>, values: Span<Span<felt252>>,
)

entity

Gets the values of a model entity/member. Returns a zero initialized model value if the entity/member has not been set.

Arguments

  • model_selector - The selector of the model to be retrieved.
  • index - The index of the entity/member to read.
  • layout - The memory layout of the model.

Returns

  • Span<felt252> - The serialized value of the model, zero initialized if not set.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::entity

fn entity(self: T, model_selector: felt252, index: ModelIndex, layout: Layout) -> Span<felt252>

entities

Gets the model values for the given entities.

Arguments

  • model_selector - The selector of the model to be retrieved.
  • indices - The indexes of the entities/members to read.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::entities

fn entities(
    self: T, model_selector: felt252, indexes: Span<ModelIndex>, layout: Layout,
) -> Span<Span<felt252>>

set_entity

Sets the model value for the given entity/member.

Arguments

  • model_selector - The selector of the model to be set.
  • index - The index of the entity/member to write.
  • values - The value to be set, serialized using the model layout format.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::set_entity

fn set_entity(
    self: T, model_selector: felt252, index: ModelIndex, values: Span<felt252>, layout: Layout,
)

set_entities

Sets the model values for the given entities. The permissions are only checked once, then the writes are batched.

Arguments

  • model_selector - The selector of the model to be set.
  • indexes - The indexes of the entities/members to write.
  • values - The values to be set, serialized using the model layout format.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::set_entities

fn set_entities(
    self: T,
    model_selector: felt252,
    indexes: Span<ModelIndex>,
    values: Span<Span<felt252>>,
    layout: Layout,
)

delete_entity

Deletes a model value for the given entity/member. Deleting is setting all the values to 0 in the given layout.

Arguments

  • model_selector - The selector of the model to be deleted.
  • index - The index of the entity/member to delete.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::delete_entity

fn delete_entity(self: T, model_selector: felt252, index: ModelIndex, layout: Layout)

delete_entities

Deletes the model values for the given entities. The permissions are only checked once, then the deletes are batched.

Arguments

  • model_selector - The selector of the model to be deleted.
  • indexes - The indexes of the entities/members to delete.
  • layout - The memory layout of the model.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::delete_entities

fn delete_entities(self: T, model_selector: felt252, indexes: Span<ModelIndex>, layout: Layout)

is_owner

Returns true if the provided account has owner permission for the resource, false otherwise.

Arguments

  • resource - The selector of the resource.
  • address - The address of the contract.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::is_owner

fn is_owner(self: T, resource: felt252, address: ContractAddress) -> bool

grant_owner

Grants owner permission to the address. Can only be called by an existing owner or the world admin.

Note that this resource must have been registered to the world first.

Arguments

  • resource - The selector of the resource.
  • address - The address of the contract to grant owner permission to.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::grant_owner

fn grant_owner(self: T, resource: felt252, address: ContractAddress)

revoke_owner

Revokes owner permission to the contract for the resource. Can only be called by an existing owner or the world admin.

Note that this resource must have been registered to the world first.

Arguments

  • resource - The selector of the resource.
  • address - The address of the contract to revoke owner permission from.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::revoke_owner

fn revoke_owner(self: T, resource: felt252, address: ContractAddress)

owners_count

Get the number of owners for a resource.

Arguments

  • resource - The selector of the resource.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::owners_count

fn owners_count(self: T, resource: felt252) -> u64

is_writer

Returns true if the provided contract has writer permission for the resource, false otherwise.

Arguments

  • resource - The selector of the resource.
  • contract - The address of the contract.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::is_writer

fn is_writer(self: T, resource: felt252, contract: ContractAddress) -> bool

grant_writer

Grants writer permission to the contract for the resource. Can only be called by an existing resource owner or the world admin.

Note that this resource must have been registered to the world first.

Arguments

  • resource - The selector of the resource.
  • contract - The address of the contract to grant writer permission to.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::grant_writer

fn grant_writer(self: T, resource: felt252, contract: ContractAddress)

revoke_writer

Revokes writer permission to the contract for the resource. Can only be called by an existing resource owner or the world admin.

Note that this resource must have been registered to the world first.

Arguments

  • resource - The selector of the resource.
  • contract - The address of the contract to revoke writer permission from.

Fully qualified path: dojo::world::iworld::IWorldDispatcherTrait::revoke_writer

fn revoke_writer(self: T, resource: felt252, contract: ContractAddress)