-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
102 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
use anchor_lang::prelude::Pubkey; | ||
|
||
pub const DEPHY_ID_PROGRAM: Pubkey = Pubkey::new_from_array([10u8, 104u8, 87u8, 71u8, 135u8, 225u8, 232u8, 69u8, 21u8, 185u8, 195u8, 236u8, 216u8, 23u8, 119u8, 79u8, 176u8, 27u8, 100u8, 193u8, 237u8, 38u8, 213u8, 50u8, 121u8, 184u8, 103u8, 109u8, 227u8, 77u8, 99u8, 44u8]); | ||
pub const SPL_2022_PROGRAM: Pubkey = Pubkey::new_from_array([6u8, 221u8, 246u8, 225u8, 238u8, 117u8, 143u8, 222u8, 24u8, 66u8, 93u8, 188u8, 228u8, 108u8, 205u8, 218u8, 182u8, 26u8, 252u8, 77u8, 131u8, 185u8, 13u8, 39u8, 254u8, 189u8, 249u8, 40u8, 216u8, 161u8, 139u8, 252u8]); | ||
pub const PRODUCT_MINT_SEED_PREFIX: &[u8; 16] = b"DePHY_ID-PRODUCT"; | ||
pub const DEVICE_MINT_SEED_PREFIX: &[u8; 15] = b"DePHY_ID-DEVICE"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
extensions/puppet/programs/puppet/src/instructions/initialize.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::state::Global; | ||
use anchor_lang::prelude::*; | ||
|
||
#[derive(AnchorSerialize, AnchorDeserialize, Debug, Clone)] | ||
pub struct InitializeParams { | ||
pub dephy_id_program: Pubkey, | ||
} | ||
|
||
#[derive(Accounts)] | ||
#[instruction(params: InitializeParams)] | ||
pub struct Initialize<'info> { | ||
#[account( | ||
init, | ||
payer = payer, | ||
space = 8 + 32 + 1, | ||
seeds = [b"global", payer.key().as_ref()], | ||
bump, | ||
)] | ||
pub global: Account<'info, Global>, | ||
#[account(mut)] | ||
pub payer: Signer<'info>, | ||
pub rent: Sysvar<'info, Rent>, | ||
pub system_program: Program<'info, System>, | ||
} | ||
|
||
pub fn initialize(ctx: Context<Initialize>, params: InitializeParams) -> Result<()> { | ||
let global = &mut ctx.accounts.global; | ||
global.dephy_id_program = params.dephy_id_program; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use anchor_lang::prelude::*; | ||
|
||
#[account] | ||
pub struct Global { | ||
pub dephy_id_program: Pubkey, | ||
pub bump: u8, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters