anchor icon indicating copy to clipboard operation
anchor copied to clipboard

Update spl-token-2022 to v1.0.0 on anchor-spl

Open febo opened this issue 1 year ago • 3 comments

spl-token-2022 1.0.0 introduces new ExtensionTypes, such as GroupPointer, GroupMemberPointer, TokenGroup, TokenGroupMember. These extensions are already being used in mints. Currently, anchor-spl cannot deserialize these extensions since it is pinned to v0.9. The solution here would be to bump spl-token-2022 dependency to 1.0.0 on anchor-spl.

febo avatar Feb 01 '24 04:02 febo

Yes, will do. Does the accounts not deserialize e.g. when using TokenAccount or is it the exported spl_token_2022 module that doesn't have the functionality to deserialize the new extensions? If it's the latter, you should be able to specify

spl-token-2022 = "1"

in your Cargo.toml to use the latest version.

acheroncrypto avatar Feb 01 '24 04:02 acheroncrypto

It is the former case. It happens when checking the extensions on the mint account before initializing the token account:

 let mint_extensions = mint_state.get_extension_types()?;

This uses the import from:

use ::anchor_spl::token_2022::spl_token_2022::extension::{
  BaseStateWithExtensions, ExtensionType, StateWithExtensions,
};

So it will require a version bump.

febo avatar Feb 01 '24 05:02 febo

FYI, there is a problem with the 1.18 release which I believe is currently being worked on. The upgrade is blocked until that problem has some sort of a resolution.

acheroncrypto avatar Feb 18 '24 08:02 acheroncrypto