MCPcopy Create free account
hub / github.com/JumpCrypto/sol-arc / InitEntity

Class InitEntity

programs/core-ds/src/context.rs:38–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36#[derive(Accounts)]
37#[instruction(entity_id:u64, components: BTreeMap<Pubkey,SerializedComponent>)]
38pub struct InitEntity<'info>{
39 #[account(mut)]
40 pub payer: Signer<'info>,
41 pub system_program: Program<'info, System>,
42
43 pub registry_instance: Account<'info, RegistryInstance>,
44
45 #[account(
46 init,
47 payer=payer,
48 space=8+Entity::get_max_size() as usize+compute_comp_arr_max_size(&components.values().cloned().collect()), //It is expected this will get Realloc'd every time a component is added
49 seeds = [
50 SEEDS_ENTITY_PREFIX,
51 entity_id.to_be_bytes().as_ref(),
52 registry_instance.key().as_ref()
53 ],
54 bump,
55 )]
56 pub entity: Box<Account<'info, Entity>>,
57
58 // Only the Entity's Registry can make changes to the Entity
59 #[account(
60 owner = registry_instance.registry.key()
61 )]
62 pub registry_signer: Signer<'info>
63}
64
65#[derive(Accounts)]
66pub struct MintARCNFT<'info>{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected