✅SyncAndSkim
The test file creates a scenario where user transfers both tokens to pair "for free" (did not mint LP tokens). Two things we can do here, either sync or skim.
Sync: This is manual "force" update, the transferred tokens from user will be "merged" into pair accounting. Also sync() can refresh price0Cumulativelast and price1CumulativeLast when twap oracle needs a snapshot: https://rareskills.io/post/twap-uniswap-v2

// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}Skim: This method lets you harvest all accidently transferred token from the pair. User is responsible to either swap or mint LP token within the same tx, if not, the transferred tokens will be arbitraged by anyone.
Last updated