This repository was archived by the owner on Mar 11, 2025. It is now read-only.
token-2022: Add MemoTransfer extension#2822
Merged
CriesofCarrots merged 8 commits intosolana-labs:masterfrom Feb 5, 2022
Merged
token-2022: Add MemoTransfer extension#2822CriesofCarrots merged 8 commits intosolana-labs:masterfrom
CriesofCarrots merged 8 commits intosolana-labs:masterfrom
Conversation
a77df16 to
63d507a
Compare
Contributor
Author
|
|
63d507a to
2e07377
Compare
22025a4 to
7ec723a
Compare
CriesofCarrots
commented
Feb 2, 2022
CriesofCarrots
commented
Feb 2, 2022
Contributor
Author
|
Not fully functional, due to syscall, but everything else ready for a look! |
CriesofCarrots
commented
Feb 2, 2022
joncinque
reviewed
Feb 3, 2022
Contributor
joncinque
left a comment
There was a problem hiding this comment.
Looks great for the most part! The realloc part is a bit tough, so we might need to refactor StateWithExtensionsMut
a6e0486 to
bc0dbae
Compare
91340df to
60a97dc
Compare
60a97dc to
197ab3e
Compare
joncinque
previously approved these changes
Feb 4, 2022
Contributor
joncinque
left a comment
There was a problem hiding this comment.
Looks great! Just two nittiest of comment nits
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
Pull request has been modified.
Contributor
Author
|
Woot! Excited to get this one in |
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.
Some users would like to require all transfers into particular accounts be accompanied by a memo.
This PR implements a MemoTransfer extension, which stores a byte indicating whether memo-transfers are or are not required. The extension can be initialized on any existing token Account, assuming the account has space for the extension. Callers should call Reallocate to make space, if the account is too small.
Currently, there is only a placeholder where the memo-requirement would be in
_process_transfer(), pending the syscall that will expose previous sibling instructions to be checked for the memo. Bumping the solana crates and using the syscall will be done in a subsequent PR.Needs:
Closes #2729