From 3c16589838620e3260424836b3d19b30b1b44182 Mon Sep 17 00:00:00 2001 From: Jon C Date: Mon, 31 Aug 2026 20:49:00 +0200 Subject: [PATCH] program: Allow mints with a freeze authority #### Problem The stake pool program does not allow pool creators to provide a mint with a freeze authority. The logic was that we always wanted to allow users to get their tokens out of the pool. However, this limitation is a bit too harsh. DeFi protocols, for example, don't restrict trading based on freeze authorities present in the mint. #### Summary of changes Allow mints with a freeze authority during pool creation. --- program/src/processor.rs | 4 ---- program/tests/initialize.rs | 14 ++------------ 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/program/src/processor.rs b/program/src/processor.rs index 231961b8..c7d2d8cc 100644 --- a/program/src/processor.rs +++ b/program/src/processor.rs @@ -784,10 +784,6 @@ impl Processor { return Err(StakePoolError::WrongMintingAuthority.into()); } - if pool_mint.base.freeze_authority.is_some() { - return Err(StakePoolError::InvalidMintFreezeAuthority.into()); - } - let extensions = pool_mint.get_extension_types()?; if extensions .iter() diff --git a/program/tests/initialize.rs b/program/tests/initialize.rs index 745fb4dd..b700ecdc 100644 --- a/program/tests/initialize.rs +++ b/program/tests/initialize.rs @@ -418,7 +418,7 @@ async fn fail_with_wrong_mint_authority() { } #[tokio::test] -async fn fail_with_freeze_authority() { +async fn succeed_with_freeze_authority() { let (mut banks_client, payer, recent_blockhash) = program_test().start().await; let stake_pool_accounts = StakePoolAccounts::default(); @@ -474,7 +474,7 @@ async fn fail_with_freeze_authority() { .await .unwrap(); - let error = create_stake_pool( + create_stake_pool( &mut banks_client, &payer, &recent_blockhash, @@ -497,17 +497,7 @@ async fn fail_with_freeze_authority() { stake_pool_accounts.max_validators, ) .await - .err() - .unwrap() .unwrap(); - - assert_eq!( - error, - TransactionError::InstructionError( - 2, - InstructionError::Custom(error::StakePoolError::InvalidMintFreezeAuthority as u32), - ) - ); } #[tokio::test]