Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mskhno committed Sep 24, 2024
1 parent fb38280 commit 9cf9809
Show file tree
Hide file tree
Showing 15 changed files with 2,665 additions and 123 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts
88 changes: 22 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,22 @@
## Foundry

**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**

Foundry consists of:

- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.

## Documentation

https://book.getfoundry.sh/

## Usage

### Build

```shell
$ forge build
```

### Test

```shell
$ forge test
```

### Format

```shell
$ forge fmt
```

### Gas Snapshots

```shell
$ forge snapshot
```

### Anvil

```shell
$ anvil
```

### Deploy

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```

### Cast

```shell
$ cast <subcommand>
```

### Help

```shell
$ forge --help
$ anvil --help
$ cast --help
```
## About
This project is a simple recreation of Uniswap V2 core contracts. There is no peripheral contracts such as UniswapV2Router, so those contracts have to include necessary checks.

## Libs
1. [email protected]

## Structure
1. UniswapV2Factory
Deploys UniswapV2Pair contracts and holds info about their addresses
2. UniswapV2Pair
Holds balances of 2 tokens and logic to handle reserves, issues its tokens to represent holdings of token reserves(pro-rata)
3. UniswapV2ERC20
This contract will be inherited by UniswapV2Pair.
ERC20 which also handles gasless approvals

## Todo
All of those todo's are maybe's. I can't say for sure i will make those changes.

1. As of now(first commit), there is a lot of comments in code. I will probably clean them later.
2. Users don't have information on which amountIn to provide, or how much tokens they will get if they burn their lp tokens.
This means that it's probably good to change some private function to be public and enable users to see the inputs or outputs of functions before calling them.
3. The test suite check 100% of contracts, however it is probably good to do some invariant testing.
Loading

0 comments on commit 9cf9809

Please sign in to comment.