Omniscia CloudFunding Audit

CrowdFunding Code Style Findings

CrowdFunding Code Style Findings

CFG-01C: Inefficient Loop Limit Evaluations

Description:

The linked for loops evaluate their limit inefficiently on each iteration.

Example:

contracts/CrowdFunding.sol
405for (uint256 j; j < airdrop.votePowerBlocks.length; j++) {

Recommendation:

We advise the statements within the for loop limits to be relocated outside to a local variable declaration that is consequently utilized for the evaluations to significantly reduce the codebase's gas cost. We should note the same optimization is applicable for storage reads present in those limits as they are newly read on each iteration (i.e. length members of arrays in storage).

Alleviation:

The CloudFunding team has opted not to alleviate any informational or minor exhibits they disagree with, thus rendering this exhibit as acknowledged.

CFG-02C: Inexistent Error Message

Description:

The linked require check has no error message explicitly defined.

Example:

contracts/CrowdFunding.sol
177require(providers.length == bips.length);

Recommendation:

We advise one to be set so to increase the legibility of the codebase and aid in validating the require check's condition.

Alleviation:

The CloudFunding team has opted not to alleviate any informational or minor exhibits they disagree with, thus rendering this exhibit as acknowledged.

CFG-03C: Repetitive Value Literal

Description:

The linked value literal is repeated across the codebase multiple times.

Example:

contracts/CrowdFunding.sol
184require(totalBips == 100_00, 'Not 100% delegated');

Recommendation:

We advise it to be set to a constant variable instead optimizing the legibility of the codebase.

Alleviation:

The CloudFunding team has opted not to alleviate any informational or minor exhibits they disagree with, thus rendering this exhibit as acknowledged.