Anchor
DeclaredProgramIdMismatch
“The declared program id does not match the actual program id”
The declare_id! in the program source does not match the id of the deployed program executing the instruction.
Common causes
- Deploying to a new program keypair without updating
declare_id!andAnchor.toml. - Running tests against a program built with a different id.
How to fix it
- Run
anchor keys sync, rebuild and redeploy.