Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rainlanguage/rain.lib.memkv
An in-memory KV store (hashmap) implemented in Solidity.
https://github.com/rainlanguage/rain.lib.memkv
Last synced: 17 days ago
JSON representation
An in-memory KV store (hashmap) implemented in Solidity.
- Host: GitHub
- URL: https://github.com/rainlanguage/rain.lib.memkv
- Owner: rainlanguage
- License: other
- Created: 2023-04-19T08:38:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-07T12:35:40.000Z (about 2 months ago)
- Last Synced: 2024-12-07T13:26:39.039Z (about 2 months ago)
- Language: Solidity
- Size: 1.11 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# raim.lib.memkv
Docs at https://rainprotocol.github.io/rain.lib.memkv
## Key/Value store
Implements an in-memory key/value store that can be snapshotted/exported to an
`uint256[]` of pairwise keys/values as its items.Roughly O(1) for gets and sets for the amounts of data commonly handled in
Solidity. Gets cost ~350 gas and sets are ~400 gas.Internally represented as 15 linked lists and 1x 16bit overall word count that
facilitates O(1) allocation (excluding memory expansion costs) of an export
`uint256[]`.The key/value store can differentiate between a key that is set to `0` and a key
that is unset for gets. However it is NOT possible to unset a key once it is set.