Skip to content

Commit

Permalink
remove default calculation for unknown assets
Browse files Browse the repository at this point in the history
  • Loading branch information
danoctavian committed Oct 22, 2024
1 parent c959a36 commit 7f4c1a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ynEIGEN/ynEigen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7f4c1a6

Please sign in to comment.