mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-16 23:16:47 +00:00
reward event
This commit is contained in:
@@ -57,7 +57,10 @@ pub fn process_close(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
|
||||
|
||||
// Payout block reward.
|
||||
if block.reward.lode_reward > 0 && block.reward.lode_authority != Pubkey::default() {
|
||||
// Load recipient.
|
||||
recipient_info.as_associated_token_account(&block.reward.lode_authority, &MINT_ADDRESS)?;
|
||||
|
||||
// Mint reward to recipient.
|
||||
mint_to_signed(
|
||||
mint_quote_info,
|
||||
recipient_info,
|
||||
@@ -66,6 +69,15 @@ pub fn process_close(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
|
||||
block.reward.lode_reward,
|
||||
&[TREASURY],
|
||||
)?;
|
||||
|
||||
// Emit event.
|
||||
RewardEvent {
|
||||
amount: block.reward.lode_reward,
|
||||
authority: block.reward.lode_authority,
|
||||
block_id: block.id,
|
||||
rewards_type: RewardsType::Lode as u64,
|
||||
}
|
||||
.log();
|
||||
}
|
||||
|
||||
// Burn base liquidity.
|
||||
|
||||
Reference in New Issue
Block a user