Omniscia Astrolab DAO Audit

StrategyV5Chainlink Code Style Findings

StrategyV5Chainlink Code Style Findings

SVC-01C: Generic Typographic Mistake

Description:

The referenced line contains a typographical mistake (i.e. private variable without an underscore prefix) or generic documentational error (i.e. copy-paste) that should be corrected.

Example:

src/abstract/StrategyV5Chainlink.sol
24mapping (IChainlinkAggregatorV3 => uint8) internal decimalsByFeed;

Recommendation:

We advise this to be done so to enhance the legibility of the codebase.

Alleviation (59b75fbee1d8f3dee807c928f18be41c58b904e1):

The relevant declaration, now located under PriceProvider, has been properly prefixed with an underscore rendering this exhibit addressed.

SVC-02C: Loop Iterator Optimization

Description:

The linked for loop increments / decrements the iterator "safely" due to Solidity's built-in safe arithmetics (post-0.8.X).

Example:

src/abstract/StrategyV5Chainlink.sol
69for (uint256 i = 0; i < _chainlinkParams.inputFeeds.length; i++) {

Recommendation:

We advise the increment / decrement operation to be performed in an unchecked code block as the last statement within the for loop to optimize its execution cost.

Alleviation (59b75fbee1d8f3dee807c928f18be41c58b904e1):

The relevant loop has been relocated under the PriceProvider::_setFeeds function and its iterator has been optimized rendering this exhibit addressed.

SVC-03C: Repetitive Value Literal

Description:

The linked value literal is repeated across the codebase multiple times.

Example:

src/abstract/StrategyV5Chainlink.sol
91uint256 retiredPrice = ChainlinkUtils.getPriceUsd(retiredFeed, validityByFeed[retiredFeed], 18);

Recommendation:

We advise it to be set to a constant variable instead optimizing the legibility of the codebase.

Alleviation (59b75fbee1d8f3dee807c928f18be41c58b904e1):

The relevant literal has been declared as a constant labelled USD_DECIMALS under the PriceProvider implementation, addressing this exhibit.