The validation in the convert
function to set toBdv
during conversion is not entirely accurate as Bdv is always decreased if newBdv > fromBdv.
Contrary to the comment and expected functionality of the Bdv is not decreased when the decreaseBDV is true and the newBdv is greater than fromBdv. This will lead to the incorrect data being used when tokens are being deposited for conversion, leading to inaccurate calculations down the line and potential loss of funds.
A short case study of the current implementation.
Case A | Case B | |
---|---|---|
newBdv | 10 | 20 |
fromBdv | 20 | 10 |
Case A | Case B | |
---|---|---|
decreaseBDV | 10 | 20 |
!decreaseBDV | 20 | 20 |
Whenever newBdv is greater than fromBdv, Bdv not decreased going against the intended functionality.
Manual review
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.