Need to use Token-2022 #444
pfleeter
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Well, this kind of worked. I ran into problems because the "Key" member of ProgramIdKey doesn't update when you update KeyBytes, so the bytes are Token 2022 but the Key is the legacy program. This causes problems in things like ATA creating where the Key is added to an account and then you get a cryptic "AccountLoadedTwice" error as a result. My fix for that was to write a Instruction upgrader method which can find the legacy token key in the accounts list and swap them for the new token program. This is all just hackery to work around lack of support without needing to fork things etc.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Might be simple, but even though the TokenProgram.ProgramIdKey is static and readonly, you can still set the KeyBytes on it in a static constructor to swap the library over to Token-2022, like this:
Maybe others will find that helpful.
Beta Was this translation helpful? Give feedback.
All reactions