motherlode

This commit is contained in:
Hardhat Chad
2025-09-25 17:47:25 -07:00
parent 6912c264b7
commit 6335416d52
5 changed files with 99 additions and 19 deletions

View File

@@ -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;