How Do State Changes in a Smart Contract Get Recorded on the Blockchain?
When a smart contract function is executed, it often modifies the contract's internal state variables. This modification is treated as a transaction.
The resulting state change is bundled into a block, validated by the network, and permanently recorded on the blockchain's distributed ledger, ensuring the new state is immutable.