Omniscia Morpho Labs Audit

SupplyHarvestVault Static Analysis Findings

SupplyHarvestVault Static Analysis Findings

SHV-01S: Illegible Numeric Value Representation

Description:

The linked representation of a numeric literal is sub-optimally represented decreasing the legibility of the codebase.

Example:

src/aave-v3/SupplyHarvestVault.sol
49uint16 public constant MAX_BASIS_POINTS = 10_000; // 100% in basis points.

Recommendation:

To properly illustrate the value's purpose, we advise the following guidelines to be followed. For values meant to depict fractions with a base of 1e18, we advise fractions to be utilized directly (i.e. 1e17 becomes 0.1e18) as they are supported. For values meant to represent a percentage base, we advise each value to utilize the underscore (_) separator to discern the percentage decimal (i.e. 10000 becomes 100_00, 300 becomes 3_00 and so on). Finally, for large numeric values we simply advise the underscore character to be utilized again to represent them (i.e. 1000000 becomes 1_000_000).

Alleviation:

The underscore character has been relocated according to the specification we shared with the Morpho Labs team thus alleviating this exhibit.

SHV-02S: Inexistent Sanitization of Input Addresses

Description:

The linked function(s) accept address arguments yet do not properly sanitize them.

Impact:

The presence of zero-value addresses, especially in constructor implementations, can cause the contract to be permanently inoperable. These checks are advised as zero-value inputs are a common side-effect of off-chain software related bugs.

Example:

src/aave-v3/SupplyHarvestVault.sol
63function initialize(
64 address _morpho,
65 address _poolToken,
66 string calldata _name,
67 string calldata _symbol,
68 uint256 _initialDeposit,
69 uint16 _harvestingFee,
70 address _swapper
71) external initializer {
72 __SupplyVaultUpgradeable_init(_morpho, _poolToken, _name, _symbol, _initialDeposit);
73
74 harvestingFee = _harvestingFee;
75 swapper = ISwapper(_swapper);
76}

Recommendation:

We advise some basic sanitization to be put in place by ensuring that each address specified is non-zero.

Alleviation:

A zero-address check has been properly introduced for the relevant input argument as advised.