1

The token was created using the Token22 program and the metadata was added directly to the mint account as described in the documentation:

https://spl.solana.com/token-2022/extensions#metadata

Because the token name and icon are not showing on Solana explorers we are trying to create/update its metadata using Metaplex.

Create metadata code part:

    const onChainData = {
        ...ourMetadata,
        sellerFeeBasisPoints: percentAmount(0,2),
        creators: none<Creator[]>(),
        collection: none<Collection>(),
        uses: none<Uses>(),
    }
    const accounts: CreateV1InstructionAccounts = {
        mint: fromWeb3JsPublicKey(mint),
        splTokenProgram: SPL_TOKEN_2022_PROGRAM_ID
    }
    const data: CreateV1InstructionData = {
        ...onChainData,
        isMutable: true,
        discriminator: 0,
        tokenStandard: TokenStandard.Fungible,
        collectionDetails: none<CollectionDetails>(),
        ruleSet: none<PublicKey>(),
        createV1Discriminator: 0,
        primarySaleHappened: true,
        decimals: none<number>(),
        printSupply: none<PrintSupply>(),
    }
    const txid = await createV1(umi, {...accounts, ...data}).sendAndConfirm(umi);
    console.log(bs58.encode(txid.signature))

The full code is available on Github

The error we are getting is the following:

'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [1]',
'Program log: IX: Create',
'Program 11111111111111111111111111111111 invoke [2]',
'Program 11111111111111111111111111111111 success',
'Program log: Metadata pointer extension: authority must be None',
'Program log: Invalid metadata pointer',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 14738 of 200000 compute units',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: custom program error: 0xc4'

If we try to update the token metadata we are getting the following error:

'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [1]',
'Program log: IX: Update',
'Program log: Incorrect account owner',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 8849 of 200000 compute units',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: custom program error: 0x39'

Adding metadata and authority options under the UpdateV1InstructionAccounts does not make any difference

        const onChainData = {
        ...ourMetadata,
        sellerFeeBasisPoints: 0,
        creators: none<Creator[]>(),
        collection: none<Collection>(),
        uses: none<Uses>(),
    }
    const accounts: UpdateV1InstructionAccounts = {
        mint: fromWeb3JsPublicKey(mint),
        metadata:fromWeb3JsPublicKey(metadata),
        authority:signer
    }
    const data : UpdateV1InstructionDataArgs = {
        data: some<Data>(onChainData),
    }
    const txid = await updateV1(umi, {...accounts, ...data}).sendAndConfirm(umi);
    console.log(bs58.encode(txid.signature))

1 Answer 1

3

Unfortunately you cannot create a metadata account using Metaplex Token Metadata if your Token 2022 mint has the metadata extension enabled.

You can find the list of supported Token 2022 extensions on Token Metadata here: https://developers.metaplex.com/token-metadata/token-2022

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.