Omniscia Euler Finance Audit
EulerRouter Code Style Findings
EulerRouter Code Style Findings
ERR-01C: Imprecise Terminology
Type | Severity | Location |
---|---|---|
Code Style | EulerRouter.sol:L77-L78, L85-L86 |
Description:
The referenced if
conditionals will yield the mutated inAmount
if the base
and quote
assets match which is misleading as the inAmount
might have been mutated as part of EIP-4626 vault conversions and thus be an outAmount
value.
Example:
73/// @inheritdoc IPriceOracle74function getQuote(uint256 inAmount, address base, address quote) external view returns (uint256) {75 address oracle;76 (inAmount, base, quote, oracle) = _resolveOracle(inAmount, base, quote);77 if (base == quote) return inAmount;78 return IPriceOracle(oracle).getQuote(inAmount, base, quote);79}80
81/// @inheritdoc IPriceOracle82function getQuotes(uint256 inAmount, address base, address quote) external view returns (uint256, uint256) {83 address oracle;84 (inAmount, base, quote, oracle) = _resolveOracle(inAmount, base, quote);85 if (base == quote) return (inAmount, inAmount);86 return IPriceOracle(oracle).getQuotes(inAmount, base, quote);87}
Recommendation:
As the inAmount
might be re-used as an optimization, we advise extensive documentation to be introduced to the EulerRouter::getQuote
and EulerRouter::getQuotes
functions while the return argument of the EulerRouter::_resolveOracle
should have its documentation updated to a different name than inAmount
that is more accurate of its purpose.
Alleviation:
The documentation of the EulerRouter::_resolveOracle
was updated to highlight that the returned value is a resolvedAmount
rather than inAmount
which we consider an adequate terminology change to address this exhibit.