Uniswap / v2-core

🦄 🦄 Core smart contracts of Uniswap V2
https://uniswap.org/docs
GNU General Public License v3.0
2.92k stars 3.13k forks source link

General Uniswap Questions #112

Closed Colman closed 3 years ago

Colman commented 3 years ago

Hi I have a couple questions about Uniswap that I couldn't find answers to online.

  1. When someone adds liquidity to a pool, what function gets called and in what contract file? I see functions for swapping but not for adding liquidity.

  2. How is each person's share of liquidity tracked? Is it based on how many UNI tokens they redeem at the time of removing the liquidity or are UNI tokens different? Also what contract function is called to redeem their liquidity?

Thanks, Colman

dgczhh commented 3 years ago
  1. UniswapV2Pair.sol => mint
  2. contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20
  3. UniswapV2Pair.sol => burn
moodysalem commented 3 years ago

Think this discussion is better for the developers channel on the discord https://discord.gg/jG5vpv