• Stars
    star
    3,841
  • Rank 11,439 (Top 0.3 %)
  • Language
    Solidity
  • License
    GNU Affero Genera...
  • Created over 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Modern, opinionated, and gas optimized building blocks for smart contract development.

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:

More Repositories

1

solcurity

Opinionated security and code quality standard for Solidity smart contracts.
2,012
star
2

VRGDAs

Variable Rate Gradual Dutch Auctions.
Solidity
292
star
3

headers

Generate perfect code headers every time.
Rust
200
star
4

foundry-template

Streamlined template for getting started with Foundry and Solmate.
Solidity
162
star
5

goo-issuance

GOO (Gradual Ownership Optimization) Issuance.
Solidity
120
star
6

ERC721C

CAPTCHAs for NFTs.
Solidity
69
star
7

libcompound

Get up to date cToken data using 20% less gas without mutating state.
Solidity
66
star
8

levm

Lightweight Lua EVM
Lua
59
star
9

svalbard

πŸ“š Keep track of how well you know the Rust Book πŸ“š
Rust
57
star
10

dapptools-template

Streamlined template for getting started with DappTools and Solmate.
Shell
52
star
11

publications

Collection of reports/articles/publications/etc of mine.
TeX
51
star
12

transmissions11.github.io

source for 2Ξ».com
HTML
44
star
13

forgeup

Update or revert to a specific Foundry branch with ease.
Shell
44
star
14

morale

More life to give on demand, are you ready?
Solidity
32
star
15

vrgda-simulator

Simulate VRGDAs in your browser. Perfect for prototyping and use with tabletop games.
TypeScript
29
star
16

survive2020

Game about surviving 2020 in pixel art style.
Rust
28
star
17

immutability-but-worse

Delegate your governance tokens to this contract and never worry about those pesky governance proposals again.
Shell
22
star
18

headers-vy

Generate perfect Vyper compatible code headers every time.
Rust
19
star
19

muldiv-battle

Gas comparison between Remco Bloemen's and Mikhail Vladimirov's mulDiv implementations.
Solidity
18
star
20

rbmk

Really Bad Math Kontracts β€” "RBMK reactors don't explode"
17
star
21

crack_yearn_md5

Small Rust script that cracked Yearn's v2 site password from a hashed copy
Rust
15
star
22

timelockvault-contracts

πŸ” Lock up your ETH for a set duration (with a bypass option for emergencies!) πŸ”
Solidity
13
star
23

reth-exex-walltime

wall time exex for reth
Rust
10
star
24

merge-cypress-jest-coverage

Merge your Cypress and Jest coverage reports with ease.
JavaScript
10
star
25

ans

a neat sway library.
Rust
9
star
26

4626-wrappers

ERC4626 wrappers for protocols that implement nonstandard yield bearing vaults.
Shell
9
star
27

buttered-chakra

πŸ‘¨β€πŸ’» Chakra-UI Extension Library πŸ‘¨β€πŸ’»
TypeScript
5
star
28

bistro

Opinionated GPT implementation and finetuning harness.
Python
5
star
29

chart-playground

Playground for charting with observablehq's plot lib.
TypeScript
4
star
30

chai-bn-equal

Adds a bnEqual method to chai that compares the string version of the BN to a string version of its input.
JavaScript
3
star
31

drex

πŸ“– Docusaurus template for my Open Source projects πŸ“–
JavaScript
1
star
32

cra-template-crows

My create-react-app template for React PWAs (with Typescript, Firebase, Cypress, Jest, Chakra-UI)
TypeScript
1
star
33

chug-splash

[Optimism] chugsplash!
TypeScript
1
star