Anchor
ConstraintMut
“A mut constraint was violated”
An account marked #[account(mut)] was passed as read-only in the transaction.
Common causes
- The client marked the account
isWritable: false, which happens when the IDL is stale or when building instructions manually. - A CPI passed the account without
mutto the callee.
How to fix it
- Regenerate the client from the current IDL so writable flags match.
- For CPIs, pass
AccountMeta::new(key, false)(writable) rather thannew_readonly.