From 7f4c1a6c9df97af1bd4c74f8e6f6339a6b39373a Mon Sep 17 00:00:00 2001 From: danoctavian Date: Tue, 22 Oct 2024 18:42:22 +0300 Subject: [PATCH] remove default calculation for unknown assets --- src/ynEIGEN/ynEigen.sol | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ynEIGEN/ynEigen.sol b/src/ynEIGEN/ynEigen.sol index cdaba1570..ccd67ab05 100644 --- a/src/ynEIGEN/ynEigen.sol +++ b/src/ynEIGEN/ynEigen.sol @@ -230,9 +230,10 @@ contract ynEigen is IynEigen, ynBase, ReentrancyGuardUpgradeable, IynEigenEvents } function convertToAssets(IERC20 asset, uint256 shares) public view returns (uint256) { - return assetIsSupported(asset) ? - assetRegistry.convertFromUnitOfAccount(asset, _convertToAssets(shares, Math.Rounding.Floor)) : - _convertToAssets(shares, Math.Rounding.Floor); + if (assetIsSupported(asset)) { + revert UnsupportedAsset(asset); + } + return assetRegistry.convertFromUnitOfAccount(asset, _convertToAssets(shares, Math.Rounding.Floor)); } function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view returns (uint256) {