What are the data types in Solidity?

Answer

Solidity data types: Value types (copied on assignment): (1) Integersuint/int with sizes 8-256 bits in 8-bit steps (e.g., uint256, int128). uint = unsigned (0 to 2^N-1); int = signed; (2) Booleanbool (true/false); (3) Addressaddress (20 bytes, Ethereum address); address payable (can receive ETH); (4) Bytes — fixed-size byte arrays: bytes1...bytes32; (5) Enums — user-defined enumeration types. Reference types (stored by reference, must specify data location): (6) Arraysuint[] memory dynamic or uint[10] storage fixed; (7) Structs — custom data structure grouping multiple variables; (8) Mappings — hash tables: mapping(address => uint256) public balances (only in storage). Special types: (9) String — dynamic UTF-8 string (reference type); (10) Bytes (dynamic)bytes for arbitrary byte arrays. Post-0.8.0, integer overflow/underflow is checked by default (reverts instead of wrapping).