docs say that Recommended use is to have the amount returned not be close to the actual strategies totalAssets to avoid rounding issues.
In harvestAndReport totalAssets is calculated as
and in availableWithdrawLimit the return is calculated as
So, if underlyingbalance is close to zero, this function might give rounding errors.
Yearn tokenized strategies docs state that recommended use is to have the amount returned not be close to the actual strategies totalAssets to avoid rounding issues.
In _harvestAndReport
totalAssets is calculated as such:
And in availableWithdrawLimit
the return value is
Thus if, for any reason, in the moment of call, the value of underlyingBalance
is close to zero, the function will give rounding errors.
The protocol will suffer from faulty accounting.
Add a check to make sure that the amount returned from availableWithdrawLimit
does not get close to the totalAssets
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.