Skip to content

Instantly share code, notes, and snippets.

@ethers
ethers / itmap.sol
Last active May 19, 2022 02:29 — forked from Arachnid/itmap.sol
Solidity iterable map
library itmap {
struct entry {
// Equal to the index of the key of this item in keys, plus 1.
uint keyIndex;
uint value;
}
struct itmap {
mapping(uint => entry) data;
uint[] keys;