solmate
Modern, opinionated, and gas optimized building blocks for smart contract development.
Contracts
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"
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, 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:
forge install transmissions11/solmate
To install with Hardhat or Truffle:
npm install solmate
Acknowledgements
These contracts were inspired by or directly modified from many sources, primarily: