Skip to content

dl-solarity/solidity-lib

Repository files navigation

npm Coverage Status License: MIT GitPOAP Badge

Solidity Library for Savvies

Solidity modules and utilities that go far beyond mediocre solidity.

  • Implementation of the Contracts Registry pattern
  • State-of-the-art cryptography primitives (ECDSA over 256-bit and 384-bit curves, RSASSA-PSS)
  • Advanced data structures (Vector, DynamicSet, PriorityQueue, AVLTree)
  • ZK-friendly Sparse Merkle Tree and Incremental Merkle Tree implementations
  • Versatile access control smart contracts (Merkle whitelists, RBAC)
  • Enhanced and simplified Diamond pattern
  • Flexible finance instruments (Staking, Vesting)
  • Robust UniswapV2 and UniswapV3 oracles
  • Lightweight SBT implementation
  • Utilities to ease work with memory, types, ERC20 decimals, arrays, sets, and ZK proofs

Built leveraging OpenZeppelin Contracts (4.9.6).

Overview

Installation

$ npm install @solarity/solidity-lib

The latest stable version is always in the master branch.

Documentation

Check out the project's documentation with broad explanations and usage examples of every module. Full natspec guides are also available in the source code.

Usage

You will find the smart contracts in the /contracts directory. Feel free to play around and check the project's structure.

Once the npm package is installed, one can use the library just like that:

pragma solidity ^0.8.4;

import {OwnableContractsRegistry} from "@solarity/solidity-lib/contracts-registry/presets/OwnableContractsRegistry.sol";

contract ContractsRegistry is OwnableContractsRegistry {
    . . .
}

Important

It is important to use the library as it is shipped and not copy-paste the code from untrusted sources.

Contribution

We are open to any mind-blowing ideas! Please take a look at our contribution guidelines to get involved.

License

The library is released under the MIT License.