Omniscia Morpho Labs Audit
SupplyHarvestVault Code Style Findings
SupplyHarvestVault Code Style Findings
SRC-01C: Ineffectual Usage of Safe Arithmetics
Type | Severity | Location |
---|---|---|
Language Specific | SupplyHarvestVault.sol:L170 |
Description:
The linked mathematical operation is guaranteed to be performed safely by surrounding conditionals evaluated in either require
checks or if-else
constructs.
Example:
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
Type | Severity | Location |
---|---|---|
Gas Optimization | SupplyHarvestVault.sol:L67 |
Description:
The linked contract member is not utilized within the codebase and thus may be redundant.
Example:
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.