Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nope-finance committed Oct 18, 2024
1 parent 6f5a427 commit 973787d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions token-lending/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ use oracles::pyth::validate_pyth_keys;
use oracles::switchboard::validate_sb_on_demand_keys;
use oracles::switchboard::validate_switchboard_keys;
use oracles::{get_oracle_type, pyth::validate_pyth_price_account_info, OracleType};
#[cfg(not(feature = "test-bpf"))]
use solana_program::pubkey;
use solana_program::{
account_info::{next_account_info, AccountInfo},
entrypoint::ProgramResult,
Expand Down Expand Up @@ -3232,6 +3234,17 @@ pub fn process_donate_to_reserve(
return Err(LendingError::InvalidAccountInput.into());
}

if &reserve.liquidity.supply_pubkey == source_liquidity_info.key {
msg!("Reserve liquidity supply cannot be used as the source liquidity provided");
return Err(LendingError::InvalidAccountInput.into());
}

#[cfg(not(feature = "test-bpf"))]
if *reserve_info.key != pubkey!("6LRNkS4Aq6VZ9Np36o7RDZ9aztWCePekMgiFgUNDhXXN") {
msg!("Donate function is currently limited to JUP pool usdc");
return Err(LendingError::InvalidAccountInput.into());
}

_refresh_reserve_interest(program_id, reserve_info, clock)?;

reserve.liquidity.donate(liquidity_amount)?;
Expand Down

0 comments on commit 973787d

Please sign in to comment.