@@ -19,6 +19,7 @@ use crate::validate;
1919use crate :: { controller, load_mut} ;
2020use anchor_lang:: prelude:: * ;
2121use anchor_lang:: Discriminator ;
22+ use anchor_spl:: associated_token:: AssociatedToken ;
2223use anchor_spl:: token:: Token ;
2324use anchor_spl:: token_2022:: Token2022 ;
2425use anchor_spl:: token_interface:: { Mint , TokenAccount , TokenInterface } ;
@@ -639,12 +640,6 @@ pub fn handle_begin_lp_swap<'c: 'info, 'info>(
639640
640641 // Make sure we have enough balance to do the swap
641642 let constituent_in_token_account = & ctx. accounts . constituent_in_token_account ;
642-
643- msg ! ( "amount_in: {}" , amount_in) ;
644- msg ! (
645- "constituent_in_token_account.amount: {}" ,
646- constituent_in_token_account. amount
647- ) ;
648643 validate ! (
649644 amount_in <= constituent_in_token_account. amount,
650645 ErrorCode :: InvalidSwap ,
@@ -761,6 +756,7 @@ pub fn handle_begin_lp_swap<'c: 'info, 'info>(
761756 }
762757 } else {
763758 let mut whitelisted_programs = WHITELISTED_SWAP_PROGRAMS . to_vec ( ) ;
759+ whitelisted_programs. push ( AssociatedToken :: id ( ) ) ;
764760 whitelisted_programs. push ( Token :: id ( ) ) ;
765761 whitelisted_programs. push ( Token2022 :: id ( ) ) ;
766762 whitelisted_programs. push ( marinade_mainnet:: ID ) ;
@@ -1079,7 +1075,7 @@ pub struct InitializeConstituent<'info> {
10791075 mut ,
10801076 seeds = [ CONSTITUENT_TARGET_BASE_PDA_SEED . as_ref( ) , lp_pool. key( ) . as_ref( ) ] ,
10811077 bump = constituent_target_base. bump,
1082- realloc = ConstituentTargetBase :: space( constituent_target_base. targets. len( ) + 1 as usize ) ,
1078+ realloc = ConstituentTargetBase :: space( constituent_target_base. targets. len( ) + 1_usize ) ,
10831079 realloc:: payer = admin,
10841080 realloc:: zero = false ,
10851081 ) ]
@@ -1089,7 +1085,7 @@ pub struct InitializeConstituent<'info> {
10891085 mut ,
10901086 seeds = [ CONSTITUENT_CORRELATIONS_PDA_SEED . as_ref( ) , lp_pool. key( ) . as_ref( ) ] ,
10911087 bump = constituent_correlations. bump,
1092- realloc = ConstituentCorrelations :: space( constituent_target_base. targets. len( ) + 1 as usize ) ,
1088+ realloc = ConstituentCorrelations :: space( constituent_target_base. targets. len( ) + 1_usize ) ,
10931089 realloc:: payer = admin,
10941090 realloc:: zero = false ,
10951091 ) ]
@@ -1214,7 +1210,7 @@ pub struct AddAmmConstituentMappingData<'info> {
12141210 mut ,
12151211 seeds = [ CONSTITUENT_TARGET_BASE_PDA_SEED . as_ref( ) , lp_pool. key( ) . as_ref( ) ] ,
12161212 bump,
1217- realloc = ConstituentTargetBase :: space( constituent_target_base. targets. len( ) + 1 as usize ) ,
1213+ realloc = ConstituentTargetBase :: space( constituent_target_base. targets. len( ) + 1_usize ) ,
12181214 realloc:: payer = admin,
12191215 realloc:: zero = false ,
12201216 ) ]
0 commit comments