A user can get 0 amount after swapping.
The calculateMinimumAmountOut function calcualtes the minimum amount a user using the swap function can get. Based on the private function which is called by the swap function, a user can either get 0 amount out of the swap or a certain amount.
return collateralValueMinusSwapValue >= requiredCollateralValue ?
0 : calculator.eurToToken(getToken(_outTokenSymbol), requiredCollateralValue - collateralValueMinusSwapValue);
This shouldn't be the case. A user shouldn't get 0 amount out of a swap. In fact, a user should be able to specifiy the minimum amount he should get and not the other way round.
A user can get 0 amount from a swap
Manual review
A minimum out parameter should be used where a user can specify the minimum amount he should get.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.