@gnosis.pm/solidity-data-structures

A collection of basic data structures implemented in solidity

Usage no npm install needed!

<script type="module">
  import gnosisPmSolidityDataStructures from 'https://cdn.skypack.dev/@gnosis.pm/solidity-data-structures';
</script>

README

Build Status Coverage Status

solidity-data-structures

A collection of basic data structures implemented in solidity

IterableAppendOnlySet

A set which allows to iterate over its contents. It does not allow containing 0 as an element and only supports insertions (no removals).

IdToAddressBiMap

A library implementing a bijective mapping between integers (uint16) and addresses exposing a simple inteface for standard interactions (insert, hasId, hasAddress, getId, getAddress). This library eliminates the unpleasant case checking and index fiddling inherent to default values of a mapping.

Merkle

Membership verificaiton for a leaf node is in a given Merkle tree given the index, root hash, and a proof.