Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

ContractDef

Definition of a contract to register in the world.

You can use this struct for a dojo contract, but also for an external contract. The only difference is the init_calldata, which is only used for dojo contracts. If the contract is an external contract (hence an address), then init_calldata is ignored.

Fully qualified path: dojo_snf_test::world::ContractDef

#[derive(Drop, Copy, Debug)]
pub struct ContractDef {
    pub contract: ContractDescriptor,
    pub writer_of: Span<felt252>,
    pub owner_of: Span<felt252>,
    pub init_calldata: Span<felt252>,
}

Members

contract

The contract to grant permission to.

Fully qualified path: dojo_snf_test::world::ContractDef::contract

pub contract: ContractDescriptor

writer_of

Selectors of the resources that the contract is granted writer access to.

Fully qualified path: dojo_snf_test::world::ContractDef::writer_of

pub writer_of: Span<felt252>

owner_of

Selector of the resource that the contract is the owner of.

Fully qualified path: dojo_snf_test::world::ContractDef::owner_of

pub owner_of: Span<felt252>

init_calldata

Calldata for dojo_init.

Fully qualified path: dojo_snf_test::world::ContractDef::init_calldata

pub init_calldata: Span<felt252>