Submitted by chaduke, also found by Beepidibop and 0xcm
Detailed description of the impact of this finding.
The collect() function will always transfer ZERO fees. At the same time, non-zero _feesPosition will be burned.
As a result, the contracts will be left in an inconsistent state. The user will burn _feesPositions without receiving the fees!
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
The collect() function will always transfer ZERO fees   in the following line:
This is because, at this moment, the values of  long0Fees, long1Fees, shortFees have not been calculated yet, actually, they will be equal to zero. Therefore, no fees will be transferred. The values of  long0Fees, long1Fees, shortFees are calculated afterwards by the following line:
Therefore, ITimeswapV2Pool(poolPair).transferFees must be called after this line to be correct.
Remix
We moved the line  ITimeswapV2Pool(poolPair).transferFees after long0Fees, long1Fees, shortFees have been calculated first.
vhawk19 (Timeswap) confirmed and resolved:
