Omniscia vfat Audit

FeesLib Static Analysis Findings

FeesLib Static Analysis Findings

FLB-01S: Illegible Numeric Value Representation

TypeSeverityLocation
Code StyleFeesLib.sol:L59

Description:

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

Example:

contracts/libraries/FeesLib.sol
59uint256 amountToCharge = feeBasis * fee / 10_000;

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 (6ab7af3bb495b817ffec469255ea679b1813eecb):

The value literal has been replaced by the BPS_BASIS constant rendering this exhibit no longer applicable.

FLB-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:

contracts/libraries/FeesLib.sol
23constructor(SickleRegistry registry_, WETH weth_) {
24 registry = registry_;
25 weth = weth_;
26}

Recommendation:

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

Alleviation (6ab7af3bb495b817ffec469255ea679b1813eecb):

The vfat team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase.