Submitted by monrel, also found by hash, linmiaomiao, and bin2chen
An attacker can steal all outstanding fees belonging to the SFPM in a uniswap pool if a token in the pool is an ERC777.
The attack is possible due to the following sequence of events when minting a short option with minTokenizedPosition():
If at least one of the tokens transferred at step 3 is an ERC777 msg.sender can implement a tokensToSender() hook and transfer the ERC1155 before s_accountFeesBase[positionKey] has been updated. registerTokenTransfer() will copy  s_accountLiquidity[positionKey]>0 and s_accountFeesBase[positionKey] = 0 such that the receiver now has a ERC1155 position with non-zero liquidity but a feesBase = 0.
When this position is burned the fees collected are calculated based on: L1209
The attacker will withdraw fees based on the current value of feeGrowthInside0LastX128 and feeGrowthInside1LastX128 and not the difference between the current values and when the short position was created.
The attacker can chose the tick range such that feeGrowthInside1LastX128 and feeGrowthInside1LastX128 are as large as possible to minimize the liquidity needed steal all available fees.
The AttackImp contract below implements the tokensToSend() hook and transfer the ERC1155 before feesBase has been set.  An address Attacker deploys AttackImp and calls AttackImp#minAndTransfer() to start the attack. To finalize the attack they burn the position and steal all available fees that belong to the SFPM.
In the POC we use the VRA pool as an example of a uniswap pool with a ERC777 token.
Create a test file in 2023-11-panoptic/test/foundry/core/Attacker.t.sol and paste the below code. Run forge test --match-test testAttack --fork-url "https://eth.public-rpc.com" --fork-block-number 18755776 -vvv to execute the POC.
VScode, Foundry
Update liquidity after minting/burning:
For redundancy, registerTokensTransfer() can also use the ReentrancyLock() modifier to always block reentrancy when minting and burning.
Reentrancy
dyedm1 (Panoptic) confirmed via duplicate issue #519
