Smart contracts
Smart contracts are programs (bytecode) deployed and executed in the Ethereum Virtual Machine (EVM). A contract is a term generally used in the legal world and has little relevance in the programming world. But writing a smart contract in Solidity does not mean writing a legal contract. Instead, contracts are like any other programming code, containing Solidity code, and are executed when someone invokes them.
There is nothing smart about smart contracts. It is a blockchain term; a piece of jargon used to refer to programming logic and code that executes within a blockchain virtual machine. A blockchain virtual machine is an interpreter that understands programming constructs related to smart contracts.
A smart contract is very similar to a C++, Java, or C# class. Just as a class is composed of state (variables) and behaviors (methods), contracts contain state variables and functions. The purpose of state variables is to store data within a contract. Functions...