In the original issue, the balance of the withdrawQueue is incorrectly calculated due to the usage of i instead of j. This introduces a miscalculation of the TVL, which in results impacts the users and can lead, for example, to less funds received/more funds received.
This mitigation proposes the usage of j instead of i:
- collateralTokens[i],
+ collateralTokens[j],
Comments
This mitigation succesfully mitigates the original issue. Due to the usage of j instead of i, the balance of withdrawQueue will be correctly calculated, thus mitigating the imbalance created by the usage of i in the original issue.
Lines of code
Vulnerability details
Original Issue Summary
In the original issue, the balance of the
withdrawQueue
is incorrectly calculated due to the usage ofi
instead ofj
. This introduces a miscalculation of the TVL, which in results impacts the users and can lead, for example, to less funds received/more funds received.Mitigation
This mitigation proposes the usage of
j
instead ofi
:Comments
This mitigation succesfully mitigates the original issue. Due to the usage of
j
instead ofi
, the balance ofwithdrawQueue
will be correctly calculated, thus mitigating the imbalance created by the usage ofi
in the original issue.Suggestion
n/a
Conclusion
LGTM