1
async def get_metadata(self, address):
    metadata_account_info = await self.get_pda(address)

    if metadata_account_info.value:

        self.metadata_layout = CStruct(
            "updateAuthority" / Bytes(32),
            "mint" / Bytes(32),
            "data" / CStruct(
                "name" / Bytes(32),
                "symbol" / Bytes(10),
                "uri" / Bytes(200),
                
            ),
            "isMutable" / Bool
            
        )

Anyone knows what's wrong with this script why the value of isMutable is always returning False? I also tried using Struct from construct instead of borsh construct to struct the bytes but the result is still the same.

2 Answers 2

1

isMutable defines whether you can update the metadata account of an SPL token.

Read more https://developers.metaplex.com/token-metadata/update

You're probably reading from tokens that cannot have their metadata updated.

3
  • The function is designed to retrieve the metadata of a token address, I have already retrieved the data that I need, like name, symbol, uri, but the isMutable part is always returning False even if the token is Mutable when I checked it on telegram bot scanners or rugcheck.xyz.
    – SoldierBoy
    Commented Sep 22 at 8:26
  • Have you cross-checked with other APIs?
    – Jimii
    Commented Sep 22 at 8:42
  • I already verified a specific token address that returned False but on Solscan, Helius, Rugcheck and telegram scanners, they returned True, but at this moment, I am currently using rugcheck api just to fetch the appropriate value for isMutable and sometimes it is having an issue because it has limit so I want to retrieve it without the use of third party API.
    – SoldierBoy
    Commented Sep 22 at 8:58
1

You'll need to preface the name / symbol / uri with 4 bytes for the length. Try this:

        self.metadata_layout = CStruct(
            "updateAuthority" / Bytes(32),
            "mint" / Bytes(32),
            "data" / CStruct(
                "name_length" / Bytes(4),
                "name" / Bytes(32),
                "symbol_length" / Bytes(4),
                "symbol" / Bytes(10),
                "uri_length" / Bytes(4),
                "uri" / Bytes(200),
            ),
            "isMutable" / Bool
            
        )
1

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.