Submitted by 0xAlix2, also found by pkqs90
Users can use PositionAction::decreaseLever to decrease the leverage of their positions when the collateral is an ERC4626, that position action interacts with PositionAction4626::_onDecreaseLever. With that, the protocol gives the ability to join/exit Balancer pools, leveraging down an ERC4626 position is handled in PositionAction4626::_onDecreaseLever.
This first step is that tokenOut is set to the redeemed 4626 amount; however, when auxAction exists, (i.e. the user wants to exit a Balancer pool), the tokenOut is updated to return the amount of the exit position, this poses multiple issues:
The users extra collateral amount will end up stuck in the position action contract forever.
The following test assuming 3 reported bugs are fixed, to workaround this:
with:
with:
Handle the multiple scenarios where the recipient might not be the position actions contract or where the tokenOut from Balancer isnt the same as the 4626s underlying token. In the if block, just set the tokenOut as the contracts balance which should handle all edge cases.
Error
amarcu (LoopFi) confirmed
Koolex (judge) decreased severity to Medium
Note: For full discussion, see here.
