• Stars
    star
    3,595
  • Rank 11,802 (Top 0.3 %)
  • Language
    Solidity
  • License
    GNU Affero Genera...
  • Created almost 3 years ago
  • Updated 3 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.
1,921
star
2

VRGDAs

Variable Rate Gradual Dutch Auctions.
Solidity
286
star
3

foundry-template

Streamlined template for getting started with Foundry and Solmate.
Solidity
159
star
4

headers

Generate perfect code headers every time.
Rust
158
star
5

goo-issuance

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

ERC721C

CAPTCHAs for NFTs.
Solidity
70
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
60
star
9

svalbard

📚 Keep track of how well you know the Rust Book 📚
Rust
55
star
10

publications

Collection of reports/articles/publications/etc of mine.
TeX
53
star
11

forgeup

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

transmissions11.github.io

source for 2λ.com
HTML
41
star
13

morale

More life to give on demand, are you ready?
Solidity
33
star
14

survive2020

Game about surviving 2020 in pixel art style.
Rust
29
star
15

vrgda-simulator

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

immutability-but-worse

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

muldiv-battle

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

headers-vy

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

rbmk

Really Bad Math Kontracts — "RBMK reactors don't explode"
17
star
20

crack_yearn_md5

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

timelockvault-contracts

🔐 Lock up your ETH for a set duration (with a bypass option for emergencies!) 🔐
Solidity
13
star
22

merge-cypress-jest-coverage

Merge your Cypress and Jest coverage reports with ease.
JavaScript
9
star
23

ans

a neat sway library.
Rust
9
star
24

4626-wrappers

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

buttered-chakra

👨‍💻 Chakra-UI Extension Library 👨‍💻
TypeScript
5
star
26

forge-template

Solidity
4
star
27

chart-playground

Playground for charting with observablehq's plot lib.
TypeScript
3
star
28

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
29

drex

📖 Docusaurus template for my Open Source projects 📖
JavaScript
1
star
30

cra-template-crows

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

chug-splash

[Optimism] chugsplash!
TypeScript
1
star