Write Function

Protocol

Contract method that changes state and costs gas.

A write function is a state‑changing method on a smart contract that must be executed via a transaction. It contrasts with read (view/pure) functions that are free to call locally.

Frequently asked questions

  • How do I call a write function?
    By submitting a transaction from your wallet and paying gas. The contract then updates state.
  • Why is a write call failing?
    Insufficient gas, failed require checks, or wrong inputs. Check error messages and logs.
  • Can I simulate first?
    Yes. Use callStatic or dry run tools to preview execution without sending a transaction.