Submitted by 0xAlix2, also found by zhaojohnson, 0xbepresent, hash, and pkqs90
PositionAction allows users to interact with their position in the CDP Vault through a proxy, on top of that it allows users to do certain actions before interacting with the position. An example of this is the PositionAction::deposit, which allows users to:
This is handled in PositionAction::_deposit, where if swap params exist, swap takes place and the returned amount is used when depositing into the position; else the users specified amount is used.
However, in PositionAction::_repay, this is not the case, where even if a swap took place, the amount sent to the vault/position is still the one specified by the user; which is wrong and inconsistent with the other functions API. This can cause unexpected behaviors and reverts when users try to interact with PositionAction::repay.
Add the following in src/test/integration/IntegrationTestBase.sol, to create a balancer pool for the underlying token:
Add the following POC in src/test/integration/PositionAction20.t.sol:
Update the moving amount of the underlying token after the swap, and use that value when repaying, which matches the logic in PositionAction::_deposit, something similar to the following:
Error
amarcu (LoopFi) confirmed via duplicate Issue #110
Koolex (judge) decreased severity to Medium
