Enforce CPI Guard for WithdrawExcessLamports on token accounts#1196
Open
bit2swaz wants to merge 2 commits into
Open
Enforce CPI Guard for WithdrawExcessLamports on token accounts#1196bit2swaz wants to merge 2 commits into
bit2swaz wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1033
Summary
Add the missing CPI Guard check for token-account
WithdrawExcessLamportsso CPI execution is blocked consistently with the existing token-account CPI Guard behavior.What changed
process_withdraw_excess_lamportsTokenError::CpiGuardTransferBlockedwhenWithdrawExcessLamportsis invoked via CPI on a CPI-guarded token accountWithdrawExcessLamportsvia CPI on a CPI-guarded token accountWhy
WithdrawExcessLamportswas missing the standard CPI Guard checkUnwrapLamportsalready blocks CPI withTokenError::CpiGuardTransferBlockedWithdrawExcessLamportswith the existing token-account CPI Guard behavior without changing broader CPI Guard semanticsScope
process_withdraw_excess_lamportschangedTests
test_cpi_guard_withdraw_excess_lamportstest_cpi_guard_withdraw_excess_lamportstest_cpi_guard_unwrap_lamportstest_withdraw_excess_lamports_from_accounttest_withdraw_excess_lamports_from_minttest_withdraw_excess_lamports_from_mint_with_no_mint_authoritytest_withdraw_excess_lamports_from_multisig