UNPKG

@uniswap/v4-core

Version:

šŸ¦„ Core smart contracts of Uniswap v4

71 lines (54 loc) • 3.05 kB
# solmate **Modern**, **opinionated**, and **gas optimized** building blocks for **smart contract development**. ## Contracts ```ml auth ā”œā”€ Owned — "Simple single owner authorization" ā”œā”€ Auth — "Flexible and updatable auth pattern" ā”œā”€ authorities │ ā”œā”€ RolesAuthority — "Role based Authority that supports up to 256 roles" │ ā”œā”€ MultiRolesAuthority — "Flexible and target agnostic role based Authority" mixins ā”œā”€ ERC4626 — "Minimal ERC4626 tokenized Vault implementation" tokens ā”œā”€ WETH — "Minimalist and modern Wrapped Ether implementation" ā”œā”€ ERC20 — "Modern and gas efficient ERC20 + EIP-2612 implementation" ā”œā”€ ERC721 — "Modern, minimalist, and gas efficient ERC721 implementation" ā”œā”€ ERC1155 — "Minimalist and gas efficient standard ERC1155 implementation" ā”œā”€ ERC6909 — "Minimalist and gas efficient standard ERC6909 implementation" utils ā”œā”€ SSTORE2 — "Library for cheaper reads and writes to persistent storage" ā”œā”€ CREATE3 — "Deploy to deterministic addresses without an initcode factor" ā”œā”€ LibString — "Library for creating string representations of uint values" ā”œā”€ SafeCastLib — "Safe unsigned integer casting lib that reverts on overflow" ā”œā”€ SignedWadMath — "Signed integer 18 decimal fixed point arithmetic library" ā”œā”€ MerkleProofLib — "Efficient merkle tree inclusion proof verification library" ā”œā”€ ReentrancyGuard — "Gas optimized reentrancy protection for smart contracts" ā”œā”€ FixedPointMathLib — "Arithmetic library with operations for fixed-point numbers" ā”œā”€ Bytes32AddressLib — "Library for converting between addresses and bytes32 values" ā”œā”€ SafeTransferLib — "Safe ERC20/ETH transfer lib that handles missing return values" ``` ## Safety This is **experimental software** and is provided on an "as is" and "as available" basis. While each [major release has been audited](audits), these contracts are **not designed with user safety** in mind: - There are implicit invariants these contracts expect to hold. - **You can easily shoot yourself in the foot if you're not careful.** - You should thoroughly read each contract you plan to use top to bottom. We **do not give any warranties** and **will not be liable for any loss** incurred through any use of this codebase. ## Installation To install with [**Foundry**](https://github.com/gakonst/foundry): ```sh forge install transmissions11/solmate ``` To install with [**Hardhat**](https://github.com/nomiclabs/hardhat) or [**Truffle**](https://github.com/trufflesuite/truffle): ```sh npm install solmate ``` ## Acknowledgements These contracts were inspired by or directly modified from many sources, primarily: - [Gnosis](https://github.com/gnosis/gp-v2-contracts) - [Uniswap](https://github.com/Uniswap/uniswap-lib) - [Dappsys](https://github.com/dapphub/dappsys) - [Dappsys V2](https://github.com/dapp-org/dappsys-v2) - [0xSequence](https://github.com/0xSequence) - [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts)