·
We continued the Mento V3 contest on Cantina.
Lesson Summary:
- expectedAmountIn comes from amountOut. If the fee is 1% and I want to get 100, I should get 99. But here I think I should just return 101(fee included);
- protocol fee is also applied to amountIn, so it looks good for now;
- newReserveValue already removed protocol fee(_swapCheck), because the protocol fee was transferred out and the reserves were updated before checking the swap;
- In the check, why are they taking both fees when they already took the protol fee and reset the reserves?
- Should the fees be taken on amount in? Or it should be on amount out?
- Make sure totalFeeInToken1 is correct.