-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds a new offchain helper for creating a `TransferChecked` instruction with the necessary accounts metas for a transfer hook `ExecuteInstruction` to Token2022, deprecating the old one. As described in #6064, the original offchain helper in Token2022 was being used incorrectly to resolve extra account metas. Rather than providing the SPL Transfer Hook interface helper with a valid `ExecuteInstruction`, the original Token2022 helper was actually providing it with a transfer instruction, causing erroneous account resolution. Taking advantage of the more secure SPL Transfer Hook interface offchain helper provided in #6099, this new offchain helper creates a `TransferChecked` instruction and calls `add_extra_account_metas_for_execute(..)`, providing the keys used to build the transfer instruction. Note: unlike the deprecated helper in #6099, the deprecated offchain helper in Token2022 *is* in fact inaccurately resolving account metas for certain use cases, thus it should be vigilantly avoided.
- Loading branch information
Joe C
authored
Jan 11, 2024
1 parent
8076018
commit 3e6a9b8
Showing
5 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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