Skip to content

program: Deposit / withdraw must be atomic with authorize - #797

Merged
joncinque merged 1 commit into
solana-program:mainfrom
joncinque:ix-comment
Sep 9, 2026
Merged

program: Deposit / withdraw must be atomic with authorize#797
joncinque merged 1 commit into
solana-program:mainfrom
joncinque:ix-comment

Conversation

@joncinque

Copy link
Copy Markdown
Contributor

Problem

The DepositStake and WithdrawStake instructions expect the user to set the authority / approve tokens in the same transaction as the deposit / withdrawal, but it's not explicitly stated.

Summary of changes

Add a comment to both instructions specifying that the authority change / approve instruction must happen in the same transaction, otherwise funds are at risk.

#### Problem

The `DepositStake` and `WithdrawStake` instructions expect the user to
set the authority / approve tokens in the same transaction as the
deposit / withdrawal, but it's not explicitly stated.

#### Summary of changes

Add a comment to both instructions specifying that the authority change
/ approve instruction must happen in the same transaction, otherwise
funds are at risk.
@joncinque
joncinque requested a review from 2501babe September 8, 2026 18:21
@joncinque
joncinque merged commit e9aeda0 into solana-program:main Sep 9, 2026
24 checks passed
@joncinque
joncinque deleted the ix-comment branch September 9, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants