This commit is contained in:
Hardhat Chad
2025-05-26 10:13:58 -07:00
parent 3049c1b390
commit 2196978c66
10 changed files with 43 additions and 42 deletions

View File

@@ -2,7 +2,7 @@ use meteora_pools_sdk::instructions::{SwapCpi, SwapCpiAccounts, SwapInstructionA
use ore_api::prelude::*;
use steel::*;
/// Swaps bets into ORE and buries the ORE.
/// Swap wagers into ORE and bury the ORE.
pub fn process_bury(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
// Load accounts.
let clock = Clock::get()?;
@@ -61,19 +61,20 @@ pub fn process_bury(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult
// Burn (bury) the purchased ORE.
let block_ore = block_ore_info.as_associated_token_account(block_info.key, &MINT_ADDRESS)?;
let burn_amount = block_ore.amount();
burn_signed_with_bump(
block_ore_info,
ore_mint_info,
block_info,
token_program_info,
block_ore.amount(),
burn_amount,
&[BLOCK],
block_bump,
)?;
// Emit an event.
BuryEvent {
amount: block_ore.amount(),
amount: burn_amount,
ts: clock.unix_timestamp as u64,
}
.log();