1

While deploying app to Devnet it returned a different program Id than declared in the macro declare_id!. Then when I try to do transaction on the app, I have an error 'Error Code: DeclaredProgramIdMismatch. Error Number: 4100. Error Message: The declared'

In that case should I deploy program to the same id that was declared in the declare_id ?

like: anchor deploy --provider.cluster devnet --program-id <PROGRAM_ID>

when I run anchor keys list I have response with the ID deployed to devnet and that create that error on the frontend

1
  • Also make sure you're using the updated IDL
    – Jimii
    Commented Oct 14 at 11:14

1 Answer 1

1

Your generated program I'd when deploying should match the one in the declare_id macro

You can get this after building your program using the anchor CLI command

anchor keys list

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.