From e6ccb4117a96ed91d0aafa6b8cb3f42a3c8c0a76 Mon Sep 17 00:00:00 2001 From: Giannis Chatziveroglou Date: Thu, 9 Feb 2023 14:17:57 -0800 Subject: [PATCH] add check for in_use_by on close_mint_manager --- .../src/instructions/mint_manager/close_mint_manager.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/programs/cardinal-creator-standard/src/instructions/mint_manager/close_mint_manager.rs b/programs/cardinal-creator-standard/src/instructions/mint_manager/close_mint_manager.rs index 7ce3d6bc..b68dcc46 100644 --- a/programs/cardinal-creator-standard/src/instructions/mint_manager/close_mint_manager.rs +++ b/programs/cardinal-creator-standard/src/instructions/mint_manager/close_mint_manager.rs @@ -1,3 +1,4 @@ +use crate::errors::ErrorCode; use crate::state::assert_mint_manager_seeds; use crate::state::CreatorStandardAccount; use crate::state::MintManager; @@ -69,6 +70,9 @@ impl<'a, 'info> CloseMintManagerCtx<'a, 'info> { }; // deserializations let mint_manager: MintManager = MintManager::from_account_info(ctx.mint_manager)?; + if mint_manager.in_use_by.is_some() { + return Err(ProgramError::from(ErrorCode::TokenCurentlyInUse)); + } // mint_manager assert_mut(ctx.mint_manager, "mint_manager")?;