Structs and Enums
Model complex data in Solidity using custom struct types and represent fixed sets of states with enums.
Why Custom Types?
Beyond primitives like uint and address, Solidity lets you define your own types. Structs group related fields, and enums represent a fixed set of named states.
Declaring a Struct
A struct bundles several variables under one name, perfect for modeling real-world entities like a user or an order.
struct User {
string name;
uint age;
address wallet;
}