ccyanxyz / uniswap-arbitrage-analysis

Uniswap arbitrage problem analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Would it be better to use approve?

StrawberryFlavor opened this issue · comments

commented

In the arb.sol contract,
IERC20 erc20 = IERC20(tokenIn); erc20.transferFrom(msg.sender, address(this), amountIn);

It might be better to use erc20.approve()

Yes you're right, there are a lot improvements to make, so don't use this code in production.