Omniscia Metavisor Audit

MetavisorRegistry Static Analysis Findings

MetavisorRegistry Static Analysis Findings

MRY-01S: Illegible Numeric Value Representation

TypeSeverityLocation
Code StyleMetavisorRegistry.sol:L16

Description:

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

Example:

contracts/MetavisorRegistry.sol
16uint256 constant DENOMINATOR = 10000;

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 separator was properly included in the numeric literal's declaration as advised.

MRY-02S: Inexistent Sanitization of Input Addresses

TypeSeverityLocation
Input SanitizationMetavisorRegistry.sol:L45-L53

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/MetavisorRegistry.sol
45constructor(address _uniswapFactory, address _weth, uint256 _swapPercentage) {
46 uniswapFactory = IUniswapV3Factory(_uniswapFactory);
47 weth = IWETH9(_weth);
48 swapPercentage = _swapPercentage;
49
50 vaultMaster = address(new MetavisorManagedVault());
51
52 isOperator[msg.sender] = true;
53}

Recommendation:

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

Alleviation:

Both input address values are now adequately sanitized as non-zero, alleviating this exhibit.