Skip to main content

πŸ™ 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.