From eb4bbbd25e8c6d353fe2cf9df30206c55a0d46a5 Mon Sep 17 00:00:00 2001 From: Samuel Vanderwaal Date: Mon, 5 Feb 2024 12:06:32 -0900 Subject: [PATCH] add token_program constraints; remove debug logging --- programs/mmm/src/instructions/mip1/sol_mip1_fulfill_sell.rs | 1 + programs/mmm/src/instructions/ocp/sol_ocp_fulfill_buy.rs | 1 + programs/mmm/src/util.rs | 3 --- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/programs/mmm/src/instructions/mip1/sol_mip1_fulfill_sell.rs b/programs/mmm/src/instructions/mip1/sol_mip1_fulfill_sell.rs index f56c746..ad38b4e 100644 --- a/programs/mmm/src/instructions/mip1/sol_mip1_fulfill_sell.rs +++ b/programs/mmm/src/instructions/mip1/sol_mip1_fulfill_sell.rs @@ -94,6 +94,7 @@ pub struct SolMip1FulfillSell<'info> { init_if_needed, associated_token::mint = asset_mint, associated_token::authority = payer, + associated_token::token_program = token_program, payer = payer )] pub payer_asset_account: Box>, diff --git a/programs/mmm/src/instructions/ocp/sol_ocp_fulfill_buy.rs b/programs/mmm/src/instructions/ocp/sol_ocp_fulfill_buy.rs index bb71e69..ddcb2d1 100644 --- a/programs/mmm/src/instructions/ocp/sol_ocp_fulfill_buy.rs +++ b/programs/mmm/src/instructions/ocp/sol_ocp_fulfill_buy.rs @@ -67,6 +67,7 @@ pub struct SolOcpFulfillBuy<'info> { pub asset_metadata: UncheckedAccount<'info>, #[account( constraint = asset_mint.supply == 1 && asset_mint.decimals == 0 @ MMMErrorCode::InvalidOcpAssetParams, + mint::token_program = token_program, )] pub asset_mint: InterfaceAccount<'info, Mint>, #[account( diff --git a/programs/mmm/src/util.rs b/programs/mmm/src/util.rs index 7b2092e..50fffd8 100644 --- a/programs/mmm/src/util.rs +++ b/programs/mmm/src/util.rs @@ -213,8 +213,6 @@ pub fn get_sol_total_price_and_next_price( // the price needs to go down let p = pool.spot_price; let delta = pool.curve_delta; - msg!("spot price: {}, delta: {}, asset amount: {}", p, delta, n); - msg!("curve type: {}", pool.curve_type); let ret = match fulfill_buy { true => { match pool.curve_type { @@ -245,7 +243,6 @@ pub fn get_sol_total_price_and_next_price( // for loop to prevent overflow let mut total_price: u64 = 0; let mut curr_price: u128 = p as u128; - msg!("current price: {}", curr_price); for _ in 0..n { total_price = total_price .checked_add(curr_price as u64)