Value Types
uint, address, bool, bytes.
What Are Value Types?
Value types in Solidity hold their data directly and are copied whenever they are assigned to a variable or passed to a function.
This is different from reference types (arrays, structs, mappings) which point to a shared location. Value types include bool, integers, address, and fixed-size bytes.
- Always copied on assignment
- Stored compactly
- Predictable gas cost
Booleans
The bool type holds either true or false. It is the result of comparison and logical operators.
Solidity supports ! (not), && (and), || (or). Logical operators short-circuit, just like in most languages.
<code>bool isActive = true;
bool hasPaid = false;
bool ready = isActive && !hasPaid;</code>