Skip to content

Commit ca6b065

Browse files
committed
fix: restore derived mint ix data mint comparison
1 parent 82470c4 commit ca6b065

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • programs/compressed-token/program/src/mint_action/actions

programs/compressed-token/program/src/mint_action/actions/create_mint.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ pub fn process_create_mint_action(
3131
.create_mint
3232
.as_ref()
3333
.ok_or(ProgramError::InvalidInstructionData)?;
34+
35+
if !pubkey_eq(
36+
&spl_mint_pda,
37+
parsed_instruction_data.mint.metadata.mint.array_ref(),
38+
) {
39+
msg!("Invalid mint PDA derivation");
40+
return Err(ErrorCode::MintActionInvalidMintPda.into());
41+
}
42+
3443
// With cpi context this program does not have access
3544
// to the address Merkle tree account that is used in the cpi to the light system program.
3645
// This breaks the implicit check of new_address_params_assigned.

0 commit comments

Comments
 (0)