In SmartVaultV3::swap()
, the user has no control over amountOutMinimum
that is used for the swap. The value of amountOutMinimum
can be 0
, which can lead to loss of funds because of swap.
In the known issues it is mentioned that:
However, the user has no real discretion for the cases where the amountOutMinimum
is 0, and the user should be given control of amountOutMinimum
in such case.
In SmartVaultV3::swap()
, the amountOutMinimum
is determined to ensure there is enough collaterization after swap. The value of amountOutMinimum
can either be 0
if there is enough collaterization already, or some other amount that is determined to ensure there is enough collaterization.
For the case where there is enough collaterization, and amountOutMinimum
is set to 0, the user's only option is to perform a swap with amountOutMinimum
as 0
.
In the known issues it is mentioned:
But "is at the user's discretion" is not true anymore if the user's only option is to swap at amountOutMinimum
as 0
, and that they have no control in such cases.
Manual Review
Take in a value for amountOutMinimum
from the user, and use this value for the cases where amountOutMinimum
is 0
.
Also, in the other case where amountOutMinimum
is not zero, if the user provides a larger value, then that larger value can be used instead.
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.