Solidity Terms

« Back to Glossary Index

Mapping: Solidity mapping is code in smart contracts that stores information based on a “key value”. In Solidity a “key” is a unique wallet address that returns a “value”. This value is the number of tokens associated w/ that wallet address.

Example:

contract TokenXYZ {
uint256 public decimals;                                            // “public” allows the value to be seen anywhere
mapping(address => unit256) public balanceOf; // this maps the key value expressed in decimals

So in a nutshell, Solidity mapping is simply matching balance information (a key value) on the Ethereum blockchain (a database) with objects in code (a smart contract using Solidity).

« Back to Glossary Index