I want to use an EnumerableMap from OpenZeppelin to map addresses to uin256s. Is there a maximum size of this mapping that I need to keep in mind? If I plan on storing a maxing of 2500 values in the mapping, do I have anything to worry about?
No, you can map every possible key to some value.
In fact, every possible key IS already mapped to the zero value by default.
Yes, but it is more of a theoretical issue than a practical one:
EnumerableMapusesEnumerableSetEnumerableSetuses an array- The length of an array is limited to 64 bits
- Hence an array can store at most 2^64-1 items
- Hence
EnumerableSetcan manage at most 2^64-1 items - Hence
EnumerableMapcan manage at most 2^64-1 items
Thank you so much, @barakman !