Skip to content

Jeiwan/zuniswapv2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZUniswapV2, a clone of UniswapV2 made in educational purposes

Using this repo

  1. git clone git@github.com:Jeiwan/zuniswapv2.git
  2. Ensure you have installed Rust and Cargo: Install Rust
  3. Install Foundry: cargo install --git https://github.com/gakonst/foundry --bin forge --locked
  4. Install dependency contracts: git submodule update --init --recursive
  5. Run tests: forge test

Blog posts

  1. Part 1, architecture of UniswapV2, adding liquidity, first tests in Solidity, removing liquidity.
  2. Part 2, tokens swapping, re-entrancy attacks and protection, price oracle, integer overflow and underflow, safe transfer.
  3. Part 3, factory contract, CREATE2 opcode, Router contract, Library contract
  4. Part 4, LP-tokens burning bug, liquidity removal, output amount calculation, swapExactTokensForTokens, swapTokensForExactTokens, fixing swap fee bug, flash loans, fixing re-entrancy vulnerability, protocol fees