Skip to content

Commit

Permalink
add check for in_use_by on close_mint_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Giannis Chatziveroglou committed Feb 9, 2023
1 parent 01e4d71 commit e6ccb41
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::errors::ErrorCode;
use crate::state::assert_mint_manager_seeds;
use crate::state::CreatorStandardAccount;
use crate::state::MintManager;
Expand Down Expand Up @@ -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")?;
Expand Down

0 comments on commit e6ccb41

Please sign in to comment.