StateChangeDenied

Error v334 → current 29.23

A contract attempted to modify state while in read-only mode.

Encountered by: developers

Why This Error Exists

Read-only calls cannot modify state. Use proper transactions for state changes.

From Chain Metadata

A contract attempted to invoke a state modifying API while being in read-only mode.

What This Means

A contract attempted to modify state while in read-only mode.

Common Causes

  • Calling a state-modifying API during a dry-run/simulation
  • View function trying to write state

How to Fix

  • Use read-only operations in view contexts
  • Separate read and write operations
  • Execute state changes in a proper transaction

Runtime Info

Pallet Index
29
Error Index
23
Error Code
29.23
Runtime Version
v393