0

I am trying to derive multiple PDAs with a generated seed and get the error shown in the screenshot. If i don't use the uuid and only the seed and the public key for the PDA it works fine.

create_planet

planet_struct

rpc_call

error

Chayim Friedman
  • 47,971
  • 5
  • 48
  • 77
AUTr3ch
  • 3
  • 3
  • 2
    [Do not post text as images](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors-when-asking-a-question). – Chayim Friedman May 19 '22 at 13:36

1 Answers1

0

In your lib.rs in the planet struct the seeds are not in the correct format

it should be like this seeds=[b"planet",payer.key.as_ref(),&[uuid as u8]]

and in your rpc call file

[anchor.utils.bytes.utf8.encode("planet"),
          wallet.publicKey.toBuffer(),
          new anchor.BN(80).toArrayLike(Buffer)]
Anoushk
  • 551
  • 7
  • 20
  • I saw you commenting this on this post. [link](https://stackoverflow.com/questions/71807112/how-to-derive-pdas-with-multiple-seeds-in-anchor-rust) I tried it and i get the same error. – AUTr3ch May 24 '22 at 10:41
  • i have tried it in playground check it out https://beta.solpg.io/628cc3fd0e6ab1eb92d947f2 – Anoushk May 24 '22 at 11:40
  • wow thank you very much. I will try it this way. – AUTr3ch May 24 '22 at 13:03