`view` promises not to modify state, `pure` promises not to read or modify it, and `payable` allows the function to receive ETH.
A `view` or `pure` call made off chain through `eth_call` costs the caller no gas, because no transaction is mined.
function balanceOf(address a) external view returns (uint256) { return bal[a]; }
function add(uint256 a, uint256 b) external pure returns (uint256) { return a + b; }
function deposit() external payable { bal[msg.sender] += msg.value; }Without `payable`, sending ETH to a function reverts.