Skip to content

Commit

Permalink
When paying with SOL, check that PDAs with data will not get garbage …
Browse files Browse the repository at this point in the history
…collected (#390)
  • Loading branch information
toblich authored Dec 20, 2024
1 parent d015a11 commit 4e2de67
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ pub fn wrap_native_sol<'info>(
signer_bump: u8,
) -> Result<()> {
require!(
// guarantee that if caller is a PDA it won't get garbage-collected
*from.owner == System::id() || from.get_lamports() > amount,
// guarantee that if caller is a PDA with data it won't get garbage-collected
from.data_is_empty() || from.get_lamports() > amount,
CcipRouterError::InsufficientLamports
);

Expand Down

0 comments on commit 4e2de67

Please sign in to comment.