hello, how can I detect if a transaction is within the pool? Does this code looks reasonable?

if (from!=uniswapV2Pair&&to!=uniswapV2Pair) { takeFee = false; }

what I aim to achieve is except p2p transactions from fee, but take fee normally (default takeFee=true) if the transaction is between the pool and a holder, I don't know if uniswapV2Pair serves this purpose...

what's the best way to test if a transaction is with the liquidity pool, if other than the above?

Sep 11, 2021, 7:18 PM
exempt
Sep 11, 2021, 7:18 PM
read the uniswap docs
Their docs are actaully pretty good
Sep 11, 2021, 7:19 PM
any more specific indication? I could not realise it reading the basics
Sep 11, 2021, 7:19 PM
So heres a hint - the liquidity pool is just a smart contract
It has a specific address
Sep 11, 2021, 7:20 PM
OK, ill try to figure out how to retrieve this contract address, I only know how to get my own (this) address. Thanks for the hint so far :)
Sep 11, 2021, 7:21 PM
Dm me if you have questions
I like helping people learn but only if they try to figure it out themselves first
Sep 11, 2021, 7:31 PM
looks like im doing right, however its not working as I expected so it might me my logic
thanks ill dm you if I can't advance more by myself :)
I'm learning, started from here: https://ethereum.org/en/developers/tutorials/
Now I am reading the contract on famous/known projects and implementing it on my sample contract :)
Sep 11, 2021, 7:59 PM

© 2024 Draquery.com All rights reserved.