Associative

In-memory or Storage Associative containers

In Solidity, in-memory mappings are not directly supported. Mappings are always stored in the contract's storage, which can be costly and inflexible.

Developers can build their own HashMap of custom types using the base container provided by Arcology. Unlike mappings, these Hash Maps can be either in-memory or in-storage, providing more versatility in managing data efficiently.

It provides functions to check for key existence, set new key-value pairs, retrieve values based on keys, retrieve keys based on their index, and delete key-value pairs. The contract leverages the Base contract's container functionalities for underlying key-value storage.

The map is a data structure that serves as both an ordered map and an array. It allows key-based access to its elements, and it also enables accessing all its elements by their index in the order they were added.

Features: The maps add extra features including key retrieval by index and explicit checks for key existence. Native solidity mappings lack these functionalities.

Other types: you can always derive maps of custom other types based on Base contract.

Last updated