How does an ERC-20 contract differentiate between people ‘selling’ and ‘adding liquidity’ in Uniswap?

In both transactions, the tokens go from the sender address to the token pair address. I want the ERC20 contract to be able to differentiate the two, what other parameters could be used for that?

For example, is there a way to check which function is using transferfrom(), whether it be addliquidity() or swapexacttokensforeth()?


Good question. I don't know the answer, let us know if you find it!