Mappings

Learn about mappings in Solidity.

In Solidity, we use mappings much like dictionaries or hash tables in other languages. We can employ various built-in data types for keys, but it’s important to note that reference types aren’t allowed. For values, we have the freedom to use any data type. We typically use mappings to associate a particular Ethereum address with its corresponding value. Most often, these key-value pairs help us efficiently manage and retrieve data.

Get hands-on with 1200+ tech skills courses.