2

This is the code snippet from the anchor program I am working on to freeze token account

I have been trying to freeze the token account by using freeze delegated account in an anchor program, but no matter what I try its not working. The latest update in my trial gives me 0x39. I can't figure out how to resolve this issue and run this function successfully.

3
  • please replace this screenshot with a code block
    – trent.sol
    Commented Jul 26, 2022 at 18:06
  • please post the full error message with transaction logs
    – trent.sol
    Commented Jul 26, 2022 at 18:07
  • Also, please provide more context, including the program and library that you're using.
    – Jon C
    Commented Jul 27, 2022 at 15:29

1 Answer 1

3

First there is a conceptual issue, why do you need to freeze the token in the holder wallet while he would be able to unfreeze it as being the one with the delegated_amount?

This is because the approved authority is owner.

The second issue is that you are providing the token program in place of the NFT edition (master edition or edition in there) in the call to freeze_delegated_account

This is the line that is incorrect edition: ctx.accounts.token_program.key(), it should be the edition PDA as

https://github.com/metaplex-foundation/metaplex-program-library/blob/3a9c68ab8c48318f96379a136feaa9b66c322752/token-metadata/program/src/pda.rs#L5-L16

2
  • Hey, thanks for the response. What is the NFT Edition? and I am freezing the token in holder wallet just to make it work somehow, if I pass this case I ll move to the next case. Commented Aug 1, 2022 at 8:25
  • I edited my answer to accuratly describe why the line is wrong
    – Arowana
    Commented Aug 1, 2022 at 21:48

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.