Assessment reports>Molend Protocol>Informational findings>Using unnecessary code
Category: Code Maturity

Using unnecessary code

Informational Severity
Informational Impact
N/A Likelihood

Description

In the UiIncentiveDataProvider contract, There are some try-catch statements to handle errors from calling functions. However, bytes memory, which is unused, is present in the catch block.

function _getReservesIncentivesData(ILendingPoolAddressesProvider provider)
  private
  view
  returns (AggregatedReserveIncentiveData[] memory)
{
  // ...

  for (uint256 i = 0; i < reserves.length; i++) {
    // ...

    try IStableDebtToken(baseData.aTokenAddress).getIncentivesController() returns (
      IAaveIncentivesController aTokenIncentiveController
    ) {
      // ...
      }
    } catch (
      bytes memory /*lowLevelData*/
    ) {
      // Will not get here
    }
    
  // ...

Recommendations

Delete the unused keyword for code maturity.

Remediation

Molend Labs provided the following response:

Since this contract is directly forked from the latest AAVE mainnet deployment, we'd prefer to keep it untouched.

Zellic © 2024Back to top ↑