Description
In the BorrowingVault.sol the function previewMintDebt(...) is supposed to take an amount of shares and turn them into an amount of debt. Currently it is taking the shares as if they were debt and turning them to shares.
function previewMintDebt(uint256 shares) public view override returns
(uint256 debt) {
return _convertDebtToShares(shares, Math.Rounding.Down);
}Recomendation
Change the function to use _convertToDebt(...) instead of _convertDebtToShares(...), as following
function previewMintDebt(uint256 shares) public view override returns
(uint256 debt) {
return _convertToDebt(shares, Math.Rounding.Down);
}Status
Addressed here: Fujicracy/fuji-v2#624