Omniscia Tangible Audit

MarketplaceV2 Static Analysis Findings

MarketplaceV2 Static Analysis Findings

MV2-01S: Illegible Numeric Value Representations

Description:

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

Example:

contracts/MarketplaceV2.sol
35uint256 public constant DEFAULT_SELL_FEE = 250;

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 (2ad448279d9e8e4b6edd94bcd2eb22129b6f7357):

The underscore separator has solely been introduced to the first referenced instance, rendering this exhibit partially alleviated.

MV2-02S: Literal Equality of bool Variable

Description:

The linked bool comparison is performed between a variable and a bool literal.

Example:

contracts/MarketplaceV2.sol
539if (initialSaleCompleted[nft][tokenId] == false) {

Recommendation:

We advise the bool variable to be utilized directly either in its negated (!) or original form.

Alleviation (2ad448279d9e8e4b6edd94bcd2eb22129b6f7357):

The redundant comparison with false has been replaced by a direct utilization of the variable in its negated form.