Repository navigation
feat(buy-sol) PR 7: reject a native SOL buy to a wallet the System Program does not own - #4995
Closed
squadgazzz wants to merge 1 commit into
Conversation
|
Reminder: Please consider backward compatibility when modifying the API specification.
Caused by: |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Stacked on #4990.
A token buy proves its payout account can receive through the mandatory buy token account creation in the bundle. A native SOL buy has no such step, so #4990 accepts a native buy to any address. The autopilot (#4989) only lets native buys whose wallet is missing or owned by the System Program into a cut. Lamports paid to a program or a sysvar revert the settlement, and a program-owned account strands them. So an order paying a token account or a PDA passes placement, then gets dropped from every cut. It reads open until it expires, and the user never sees an error.
Placement now looks the wallet up once through the sponsoring RPC and applies the autopilot's rule. A failed lookup answers 500, like the blockhash check next to it.
Changes
InvalidNativeBuyHow to test
New API test.