Skip to content

MiloTruck/solidity-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

A collection of commonly seen Solidity contracts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published