π Overview

Solarity Solidity Libraryβ
Solidity contracts and utilities that go far beyond mediocre solidity.
Contractsβ
contracts
βββ access
β βββ AMerkleWhitelisted β "Whitelists via Merkle proofs"
β βββ AMultiOwnable β "Multiple owners with the equal access level"
β βββ ARBAC β "A powerful implementation of a true RBAC"
β βββ extensions
β βββ ARBACGroupable β "Groupable extension of ARBAC"
βββ contractsβregistry
β βββ AContractsRegistry β "Reference registry implementation of ERC-6224 pattern"
β βββ ADependant β "Reference dependant implementation of ERC-6224 pattern"
β βββ pools
β βββ APoolContractsRegistry β "Adaptation of ERC-6224 for factory-like contracts"
β βββ APoolFactory β "Factory implementation for a pooled registry"
βββ diamond
β βββ ADiamondStorage β "The storage part of ERC-2535 diamond"
β βββ Diamond β "Revised ERC-2535 diamond implementation"
β βββ utils
β βββ AInitializableStorage β "Initializable logic for diamond facets"
β βββ DiamondERC165 β "ERC-165 introspection for diamond facets"
βββ finance
β βββ compoundβrateβkeeper
β β βββ ACompoundRateKeeper β "Complex percentage calculator used in lending protocols"
β βββ staking
β β βββ AStaking β "Flexible rewards staking implementation"
β β βββ AValueDistributor β "Efficient distribution algorithm implementation"
β βββ vesting
β βββ AVesting β "Linear and exponential vesting implementation"
βββ libs
β βββ arrays
β β βββ ArrayHelper β "Common functions to work with arrays"
β β βββ Paginator β "Return array slices from view function"
β β βββ SetHelper β "Array abstraction over sets"
β βββ bn
β β βββ U512 β "A hyperoptimized uint512 implementation"
β βββ crypto
β β βββ EC256 β "Elliptic curve arithmetic over a 256-bit prime field"
β β βββ ECDSA256 β "ECDSA verification over any 256-bit curves"
β β βββ ECDSA384 β "ECDSA verification over any 384-bit curves"
β β βββ ECDSA512 β "ECDSA verification over any 512-bit curves"
β β βββ RSASSAPSS β "RSASSA-PSS verification with MGF1"
β β βββ Schnorr256 β "Schnorr signature verification over any 256-bit curve"
β βββ dataβstructures
β β βββ AvlTree β "AVL tree implementation with an iterator traversal"
β β βββ CartesianMerkleTree β "CMT reference implementation"
β β βββ DynamicSet β "Set for strings and bytes"
β β βββ IncrementalMerkleTree β "IMT implementation with flexible tree height"
β β βββ PriorityQueue β "Max queue heap implementation"
β β βββ SparseMerkleTree β "SMT optimized implementation"
β β βββ memory
β β βββ Vector β "A pushable memory array"
β βββ utils
β β βββ DecimalsConverter β "Simplify interaction with ERC-20 decimals"
β β βββ MemoryUtils β "Functions for memory manipulation"
β β βββ ReturnDataProxy β "Bypass extra returndata copy when returning data"
β β βββ Typecaster β "Cast between various Solidity types"
β βββ zkp
β βββ Groth16VerifierHelper β "Simplify integration with Groth16 proofs"
β βββ PlonkVerifierHelper β "Simplify integration with Plonk proofs"
βββ oracles
β βββ AUniswapV2Oracle β "Uniswap V2 oracle with custom TWAP"
β βββ UniswapV3Oracle β "Uniswap V3 oracle with a clean interface"
βββ proxy
β βββ adminable
β βββ AdminableProxy β "A slight modification of a transparent proxy"
β βββ AdminableProxyUpgrader β "A slight modification of a proxy admin"
βββ tokens
β βββ ASBT β "A minimal implementation of an SBT"
βββ utils
β βββ ABlockGuard β "Protect against flashloans"
β βββ Globals β "Some commonly used constants"
βββ presets β "Presets for the library contracts"
βββ interfaces β "Interfaces for the library contracts"
βββ mock β "Mocks for testing purposes"
Built with courage and aspiration to perfection.
The library is designed to work cohesively with hardhat-zkit and circom-lib packages.
Installationβ
npm install @solarity/solidity-lib
The latest stable version is always in the master branch.
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.