Skip to content

[feat]: Capture PDA knowledge #23

@lorisleiva

Description

@lorisleiva

It would be great if Shank could capture all the PDAs of a program in the IRL so they can be auto-generated by Solita (See metaplex-foundation/metaplex-program-library#420).

I'm not sure if something like this is feasible with Rust macro, but this is what I have in mind.

  #[repr(C)]
- #[derive(Clone, Debug, PartialEq, BorshSerialize, BorshDeserialize, ShankAccount)]
+ #[derive(Clone, Debug, PartialEq, BorshSerialize, BorshDeserialize, ShankPda)]
+ #[seed(0, literal="metadata")]
+ #[seed(1, programId)]
+ #[seed(2, name="mint", desc="The public key of the mint account")]
+ #[seed(3, literal="edition")]
  pub struct MasterEditionV2 {
      pub key: Key,
  
      pub supply: u64,
  
      pub max_supply: Option<u64>,
  }

Where a seed can be one of three types:

  • literal="something": The seed is literally the string "something".
  • programId: The seed is the ID of the program.
  • name="something", desc="some description": The seed is a custom parameter that needs to be provided.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions