3

I bet this is a simple answer, but I'm just unable to fully understand.

Uniswap has liquidity. It can be added. But what function does it uses? the Transfer() one from the contract?

I'm trying to find a way to track if someone adds liquidity to the pool, through the contract itself.

If anyone has knowledge about this I would appreciate, even if the answer isn't extremely detailed, I can still do more researches afterwards. Thank you.

hyunchel
  • 79
  • 7
Astr153
  • 51
  • 2

1 Answers1

4

I think you're looking for this function: https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/UniswapV2Router02.sol#L61

I'm trying to find a way to track if someone adds liquidity to the pool, through the contract itself.

addLiquidity calls this function:

https://github.com/Uniswap/uniswap-v2-core/blob/4dd59067c76dea4a0e8e4bfdda41877a6b16dedc/contracts/interfaces/IUniswapV2Pair.sol#L45

which should return this event: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol#L24

Sasa Milic
  • 116
  • 6
  • 1
    Thank you for your answer, i'm going to dive into that.

    What I am a bit confused about is the link between my contract and Uniswap one. If my tokens are send to the Liquidity, it has to call a function from my contract first, so it receives the tokens right? If that's the case then I can track the tokens being sent from my own contract, in a simple way

    – Astr153 Feb 10 '21 at 22:20