Skip to content

Commit

Permalink
add token_program constraints; remove debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Vanderwaal committed Feb 5, 2024
1 parent 7fe4f4a commit eb4bbbd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<InterfaceAccount<'info, TokenAccount>>,
Expand Down
1 change: 1 addition & 0 deletions programs/mmm/src/instructions/ocp/sol_ocp_fulfill_buy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 0 additions & 3 deletions programs/mmm/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit eb4bbbd

Please sign in to comment.