https://github.com/code-423n4/2023-11-panoptic/blob/aa86461c9d6e60ef75ed5a1fe36a748b952c8666/contracts/SemiFungiblePositionManager.sol#L1222C2-L1228C15
The earned fees and the burnt liquidities are collected by calling the UniswapV3Pool.collect() function in the SemiFungiblePositionManager::_collectAndWritePositionData() function.
The SFPM contract provides the requested amounts while calling the UniswapV3 pool. These requested amounts include fees and burnt liquidity, and they are provided with amountToCollect.rightSlot() and amountToCollect.leftSlot().
The UniswapV3Pool checks the requested amounts compared to the owed amounts to the position and transfers tokens.
The owner of the position is the SFPM contract itself. So, it is normal to assume that the owed amounts to SFPM will be greater than the users requested amounts and these requested amounts will be transferred correctly.
However, it would be better to check if the actual transferred amounts are equal to the requested amounts as an invariant check. It might be an extremely rare case, but there is no way to collect the remaining owed tokens in that case since the SFPM doesnt have a specific function to call the UniswapV3 collect function.
