mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-18 23:16:48 +00:00
motherlode
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use ore_api::prelude::*;
|
||||
use solana_program::rent::Rent;
|
||||
use steel::*;
|
||||
|
||||
/// Send SOL from the treasury to the WSOL account.
|
||||
@@ -21,6 +22,13 @@ pub fn process_wrap(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult
|
||||
// Send SOL to the WSOL account.
|
||||
treasury_info.send(treasury.balance, treasury_sol_info);
|
||||
|
||||
// Check min balance.
|
||||
let min_balance = Rent::get()?.minimum_balance(std::mem::size_of::<Treasury>());
|
||||
assert!(
|
||||
treasury_sol_info.lamports() >= min_balance,
|
||||
"Insufficient SOL balance"
|
||||
);
|
||||
|
||||
// Update treasury.
|
||||
treasury.balance = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user