Skip to main content

What Is a ‘State Change’ in the Context of a Smart Contract?

A state change refers to any modification to the data or variables stored within a smart contract on the blockchain. When a transaction interacts with a smart contract (e.g. sending tokens, calling a function), the contract's internal state is updated.

For example, if a decentralized exchange contract processes a trade, the balances of the two users involved are updated, which is a state change. These changes are recorded immutably in the new block.

What Is the Primary Difference between a ‘View’ Function and a ‘State-Changing’ Function?
What Happens to a Contract’s State Variables during a Mutable Upgrade?
Where Is the Merkle Root Stored in a Blockchain Block?
How Do State Changes in a Smart Contract Get Recorded on the Blockchain?