Submitted by 0xAlix2
Users use PoolAction::exit to exit a Balancer pool position, it calls _balancerExit to do the job. It is expected to exit the pool and return the amount out of the token; however, it returns the whole recipients balance, without considering the case where the recipient is holding an amount of the same token from different sources. Itll return an exaggerated amount rather than the amount out.
This will cause PositionAction4626::_onDecreaseLever to revert sometimes. In this case, the user is leveraging down, exiting a Balancer pool, and holds some tokenOut amount. In PositionAction::onCreditFlashLoan, withdrawnCollateral would be an unreal exaggerated amount, and the contract will try to send back residualAmount which will be greater than its balance.
Add the following test in src/test/integration/PoolAction.t.sol:
Instead of returning the whole recipients balance, return the difference between his balances before and after the exit.
DoS
amarcu (LoopFi) confirmed
Koolex (judge) commented:
0xAlix2 (warden) commented:
Koolex (judge) commented:
0xAlix2 (warden) commented:
