Omniscia AllianceBlock Audit

GovernanceFacet Code Style Findings

GovernanceFacet Code Style Findings

GFT-01C: Inexistent Error Message

Description:

The linked require check has no error message explicitly defined.

Example:

contracts/facets/GovernanceFacet.sol
39require(account_ != address(0));

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 (54fd570de24631ca65a7cea022aebe43225a08c7):

An explicit error message has been introduced to the referenced require check by replacing it with an if-revert pattern validation that yields an ICommonErrors::AccountIsAddressZero error.

GFT-02C: Loop Iterator Optimization

Description:

The linked for loop increments / decrements the iterator "safely" due to Solidity's built-in safe arithmetics (post-0.8.X).

Example:

contracts/facets/GovernanceFacet.sol
22for (uint256 i = 0; i < members.length; i++) {

Recommendation:

We advise the increment / decrement operation to be performed in an unchecked code block as the last statement within the for loop to optimize its execution cost.

Alleviation (54fd570de24631ca65a7cea022aebe43225a08c7):

The referenced loop iterator's increment statement has been relocated at the end of the for loop's body and has been unwrapped in an unchecked code block, optimizing its gas cost.