Skip to content

Commit

Permalink
compute units required to mint
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSackerberg committed Mar 15, 2024
1 parent d73bee2 commit 6ee615f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,6 @@ pub const UNWRAP_EMOJI: Emoji<'_, '_> = Emoji("🔩 ", "");

pub const MAX_FREEZE_DAYS: u8 = 31;

pub const COMPUTE_UNITS: u32 = 400_000;

pub const DEFAULT_PRIORITY_FEE: u64 = 500;
2 changes: 2 additions & 0 deletions src/mint/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,12 @@ pub async fn mint(
}

// need to increase the number of compute units
let compute_ix = ComputeBudgetInstruction::set_compute_unit_limit(COMPUTE_UNITS);
let priority_fee_ix = ComputeBudgetInstruction::set_compute_unit_price(priority_fee);

let builder = program
.request()
.instruction(compute_ix)
.instruction(priority_fee_ix)
.instruction(mint_ix[0].clone())
.signer(&nft_mint);
Expand Down

0 comments on commit 6ee615f

Please sign in to comment.