Omniscia Gravita Protocol Audit

VesselManagerOperations Static Analysis Findings

VesselManagerOperations Static Analysis Findings

VMO-01S: Illegible Numeric Value Representations

TypeSeverityLocation
Code StyleVesselManagerOperations.sol:L15, L389, L960

Description:

The linked representations of numeric literals are sub-optimally represented decreasing the legibility of the codebase.

Example:

contracts/VesselManagerOperations.sol
15uint256 public constant REDEMPTION_SOFTENING_PARAM = 970; // 97%

Recommendation:

To properly illustrate each 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 Gravita Protocol team has opted to not apply a remediation for this exhibit thus rendering it acknowledged.

VMO-02S: Inexistent Sanitization of Input Addresses

TypeSeverityLocation
Input SanitizationVesselManagerOperations.sol:L59-L76

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:

contracts/VesselManagerOperations.sol
59function setAddresses(
60 address _vesselManagerAddress,
61 address _sortedVesselsAddress,
62 address _stabilityPoolAddress,
63 address _collSurplusPoolAddress,
64 address _debtTokenAddress,
65 address _adminContractAddress
66) external initializer {
67 require(!isInitialized, "Already initialized");
68 __Ownable_init();
69 vesselManager = IVesselManager(_vesselManagerAddress);
70 sortedVessels = ISortedVessels(_sortedVesselsAddress);
71 stabilityPool = IStabilityPool(_stabilityPoolAddress);
72 collSurplusPool = ICollSurplusPool(_collSurplusPoolAddress);
73 debtToken = IDebtToken(_debtTokenAddress);
74 adminContract = IAdminContract(_adminContractAddress);
75 isInitialized = true;
76}

Recommendation:

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

Alleviation:

The Gravita Protocol team has opted to not apply a remediation for this exhibit thus rendering it acknowledged.