Solidity size of mapping type

Viewed 4674

In Solidity, is there a maximum number of keys or key-value pairs that a mapping can store? If so, what is the maximum? Furthermore, does the maximum number differ depending on the variable types of the keys and the values of that mapping?

For example, how many address-uint pairs can the following mapping store?

mapping (address => uint) internal _balanceOf;
1 Answers

Each account has a data area called storage, which is persistent between function calls and transactions. Storage is a key-value store that maps 256-bit words to 256-bit words. (see)

mapping key in solidity is encoded on 32 bytes, so there is 2**(32*8) possible keys. which is a huge number;

Related