someone knows how to spot sales on uniswap in a contract (if the transfer function is used to sell on uniswap)
Oct 22, 2020, 8:22 AM
Monitor the events within the transaction
Oct 22, 2020, 8:26 AM
How i can do that
@solidity101
Oct 22, 2020, 8:32 AM
Simplest approach would be to monitor the swap event emitting from
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
And filter it for to/from contract address
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
And filter it for to/from contract address
Check how to monitor events in web3js or etherjs
Oct 22, 2020, 8:34 AM
But i want to check on every tx in solidity
Oct 22, 2020, 8:35 AM
In solidity it's not possible to monitor transactions
Oct 22, 2020, 8:36 AM
but I can't just look at the "to" of the transfer and see if it's uniswap?
Oct 22, 2020, 8:40 AM