Implementation of Clober library contracts: SegmentedSegmentTree, OctopusHeap, and more.
- SegmentedSegmentTree: A gas-efficient segment tree with a fixed size to support 32768 leaf nodes.
- OctopusHeap: A heap data structure that can store up to 256
uint16values. Optimized for popping values in close proximity to each other. - PackedUint256: Treats a
uint256as a group ofuint8,uint16, oruint32and adds, subtracts, or updates the elements of the group by indexing them. - Create1: Utility functions regarding the vanilla
CREATEoperation. - DirtyUint64: Adds, subtracts, and converts clean (original) and dirty (a non-zero representation of the original)
uint64values.
npm install @clober/libraryWe use hardhat for code coverage and foundry for fuzzing tests.
npm run hardhat:coverage
open coverage/index.htmlnpm run forge:testVisual aid for OctopusHeap.
cd utils/visualization
pip install -r requirements.txt
python octopus_heap.pyAudited by Spearbit from January to February 2023. All security risks are fixed. Full report is available here.
The primary license for Clober Library is the Time-delayed Open Source Software Licence, see License file.