H-03 MitigationConfirmed #36
Labels
edited-by-warden
mitigation-confirmed
MR-H-03
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
Vulnerability details
Original Issue
H-03 - _amountOut is representing assets and shares at the same time in the liquidate function
Details
In the previous implementation of the Vault contract it was used an
exchangeRate
to determine the number of assets/shares to be minted/burned/transferred, this means that when a value was in terms of asset units but the operation to be executed needed the value to be in shares units, the original value that was in asset units needed to be converted to shares units before executing the operation.The same reasoning applies when comparing asset units against share units, because of the difference that existed between them, if asset units were compared against share units, the comparisson was not correct, it was like comparing apples against peaches.
Mitigation
The mitigation was to refactor the way how the Vault determines if it's collateralized or not, as part of this change, the
exchangeRate
was removed, and instead new logic was implemented to make that the shares are fully backed 1:1 to assets in the YieldVault, which means that now, there is no difference if the value is in terms of assets or shares, they are the same, so, there is no need to convert assets to shares or shares to assets.Conclusion
Because of the refactoring and the removal of the concept of the
exchangeRate
and the introduction of shares fully backed up 1:1 with assets, the original issue is correctly mitigated, and now there are no problems using asset units mixed with share units.liquidableYield
, if the vault is collateralized, the Yield is the difference between all the assets handled by the YieldVault on behalf of the Vault and all the shares minted in the Vault (which represents all the deposited assets in the Vault).The text was updated successfully, but these errors were encountered: