solmate Documentation

repository·main·Indexed 26 days ago

https://github.com/transmissions11/solmate

A collection of modern, opinionated, and gas-optimized smart contract building blocks version 6.8.0. Includes authorization patterns (Owned, Auth), token standards (ERC20, ERC721, ERC1155, ERC4626, ERC6909, WETH), and utility libraries such as SSTORE2, CREATE3, and ReentrancyGuard.

Tokens
575
Snippets
0
Records
3
Agent score
38%

What's inside solmate

  1. Overview of solmate contracts

    main

    Solmate provides modern, opinionated, and gas-optimized building blocks for smart contract development. The library is organized into three main categories:

    auth

    • Owned: Simple single owner authorization.
    • Auth: Flexible and updatable auth pattern.
    • authorities:
      • RolesAuthority: Role-based Authority supporting up to 256 roles.
      • MultiRolesAuthority: Flexible and target-agnostic role-based Authority.

    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.
    • ERC4626: Minimal ERC4626 tokenized Vault 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.
    • FixedPointMathLib: Arithmetic library for fixed-point numbers.
    • Bytes32AddressLib: Library for converting between addresses and bytes32 values.
    • SafeTransferLib: Safe ERC20/ETH transfer lib that handles missing return values.
  2. Important safety and deprecation notice

    main

    Soft Deprecation

    Solmate is no longer actively maintained. Solady is the effective successor to this project.

    Safety Warning

    Solmate is experimental software provided "as is". While major releases have been audited, these contracts are not designed with user safety in mind.

    • They rely on implicit invariants.
    • Improper use can lead to significant errors.
    • You must thoroughly read each contract top to bottom before use.

    The maintainers provide no warranties and are not liable for any loss incurred through the use of this codebase.