Omniscia Euler Finance Audit
YieldAggregatorFactory Code Style Findings
YieldAggregatorFactory Code Style Findings
YAF-01C: Ineffectual Usage of Safe Arithmetics
Type | Severity | Location |
---|---|---|
Language Specific | ![]() | YieldAggregatorFactory.sol:L72, L73, L74 |
Description:
The linked mathematical operation is guaranteed to be performed safely by logical inference, such as surrounding conditionals evaluated in require
checks or if-else
constructs.
Example:
src/YieldAggregatorFactory.sol
70if (_end < _start || _end > length) revert InvalidQuery();71
72address[] memory yieldAggregatorVaultsList = new address[](_end - _start);73for (uint256 i; i < _end - _start; ++i) {74 yieldAggregatorVaultsList[i] = yieldAggregatorVaults[_start + i];75}
Recommendation:
Given that safe arithmetics are toggled on by default in pragma
versions of 0.8.X
, we advise the linked statement to be wrapped in an unchecked
code block thereby optimizing its execution cost.
Alleviation:
The Euler Finance team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase.