Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.14 KB

README.md

File metadata and controls

45 lines (29 loc) · 1.14 KB

Solidity Snippets

A collection of commonly seen contracts, re-written to prioritize simplicity and readability.

Contracts

All contracts are located in the src directory.

interfaces
└─ IERC20"Interface of the ERC-20 standard"

snippets
└─ ConstantSumPair"Minimal x + y = k AMM"

tokens
└─ ERC20"Minimal ERC-20 implementation"

utils
├─ FixedPointMathLib"Library to manage fixed-point arithmetic"
├─ SafeTransferLib"Library for safe ETH and ERC20 transfers"
└─ VoteHistoryLib"Library to store and retrieve vote history based on block number"

Installation

To install with Foundry:

forge install MiloTruck/solidity-snippets

Safety

This codebase was written for demonstration purposes.

It has not been audited and should not be used in production.

Acknowledgements

This repository is inspired by or directly modified from many sources, primarily: