1

I want only the upgrade authority (the public key which deployed the program) to create instructions to the program. Is it possible to fetch the public key of the upgrade authority within the program after deployment or do I have to hard-code the public key in the program and use it for validation?

1
  • Hey, can you please tell me how to hardcode the ID in the program and then compare it? Mar 1, 2023 at 8:37

1 Answer 1

1

You don't have access to the upgrade authority from within the program, so your best bet is to hardcode the upgrade id in the program and check against that.

Alternatively, you can require that the program data account is passed to the program explicitly, but this is not a good idea since validation could be error-prone.

1
  • Hello @Jon C, I had the same doubt actually, how can I hardcode the ID in the program and compare it? Mar 1, 2023 at 8:36

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.