Omniscia Morpho Labs Audit

SupplyHarvestVault Code Style Findings

SupplyHarvestVault Code Style Findings

SRC-01C: Ineffectual Usage of Safe Arithmetics

Description:

The linked mathematical operation is guaranteed to be performed safely by surrounding conditionals evaluated in either require checks or if-else constructs.

Example:

src/compound/SupplyHarvestVault.sol
169rewardsFee = rewardsAmount.percentMul(harvestConfigMem.harvestingFee);
170rewardsAmount -= rewardsFee;

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 Morpho team has wrapped the referenced statement in an unchecked code block as advised. While the exhibit has been dealt with, the rewardsFee assignment within the unchecked code block is redundant as percentMul will apply safe arithmetics internally.

SRC-02C: Potentially Redundant Contract Member

Description:

The linked contract member is not utilized within the codebase and thus may be redundant.

Example:

src/compound/SupplyHarvestVault.sol
67address public cComp; // The address of cCOMP token.

Recommendation:

We advise it to be evaluated and potentially omitted from the codebase to reduce its initialization gas cost and deployment size.

Alleviation:

The cComp member has been removed as it was deemed redundant.