-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
2,665 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.