Omniscia Euler Finance Audit

LidoOracle Code Style Findings

LidoOracle Code Style Findings

LOE-01C: Potential Usage of Library

TypeSeverityLocation
Code StyleLidoOracle.sol:L32, L34, L37

Description:

The referenced statements can be executed via the ScaleUtils::getDirectionOrRevert function.

Example:

src/adapter/lido/LidoOracle.sol
25/// @notice Get a quote by querying the exchange rate from the stEth contract.
26/// @dev Calls `getSharesByPooledEth` for stEth/wstEth and `getPooledEthByShares` for wstEth/stEth.
27/// @param inAmount The amount of `base` to convert.
28/// @param base The token that is being priced. Either `stEth` or `wstEth`.
29/// @param quote The token that is the unit of account. Either `wstEth` or `stEth`.
30/// @return The converted amount.
31function _getQuote(uint256 inAmount, address base, address quote) internal view override returns (uint256) {
32 if (base == stEth && quote == wstEth) {
33 return IStEth(stEth).getSharesByPooledEth(inAmount);
34 } else if (base == wstEth && quote == stEth) {
35 return IStEth(stEth).getPooledEthByShares(inAmount);
36 }
37 revert Errors.PriceOracle_NotSupported(base, quote);
38}

Recommendation:

We advise this to be done so, optimizing the code's legibility.

Alleviation:

The Euler Finance team stated that they do not consider the recommended change a legibility improvement as they wish straightforward wrapped variant oracles to utilize a direct comparison.

Given that the approach the Euler Finance team wishes to retain is uniformly applied to the class of oracles described, we consider this exhibit as an inapplicable recommendation and concur with the Euler Finance team's assessment.