The result for swapRouter.exactInputSingle(params)
is the amountOut
. So, since we are always going to transfer the amountOut, it is not necessary to use IERC20(WETH).balanceOf(address(this))
since we would get the same value that is available.
Optimization
Manual code review
Update the code for:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.