The library consists of modules and utilities that are built with a help of Openzeppelin Contracts (4.9.5) and go far beyond mediocre solidity.
- Implementation of Contracts Registry pattern
- Versatile RBAC and MultiOwnable smart contracts
- Enhanced and simplified Diamond pattern
- Heap based priority queue library
- Memory data structures (Vector)
- Optimized Incremental Merkle Tree data structure
- Novel ReturnDataProxy contract
- Lightweight SBT implementation
- Flexible UniswapV2 and UniswapV3 oracles
- Utilities to ease work with ERC20 decimals, arrays, sets and ZK proofs
$ npm install @solarity/solidity-lib
The latest stable version is always in the master
branch.
You will find the smart contracts in the /contracts
directory. Feel free to play around and check the source code, it is rather descriptive.
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.
The library is released under the MIT License.