Putting `view` on a contract function signals that the function will only read data from the blockchain's saved state but will not change it. This keyword is a promise by the developer that the function will not alter any stored variable, emit events, deploy new contracts, or send Ether. The Ethereum Virtual Machine (EVM), which is the runtime environment for smart contracts, ensures this promise is kept through a strict enforcement mechanism primarily by distinguishing between how function calls are executed: as a read-only local execution (a "call") or as a state-changing global update (a "transaction").
When an external entity, such as a user interface or another contract, ....
Log in to view the answer