Submitted by pkqs90
PositionAction.sol#_deposit incorrectly checks auxSwap.assetIn should be equal to collateralParams.targetToken. This is incorrect, because auxSwap.assetIn should be the token used to swap for collateralParams.targetToken.
First, lets inspect how deposit works with swap enabled:
The issue here is, during step 2, the swap is to exchange auxSwap.assetIn for collateralParams.targetToken. This means that the two tokens must not be equal. However, the current implementation checks that they are the same. This means the swap feature is completely unusable.
Remove the check.
Invalid Validation
amarcu (LoopFi) disputed and commented:
Koolex (judge) commented:
pkqs90 (warden) commented:
Koolex (judge) commented:
pkqs90 (warden) commented:
Koolex (judge) commented:
pkqs90 (warden) commented:
Koolex (judge) commented:
