Omniscia AllianceBlock Audit
GovernanceFacet Code Style Findings
GovernanceFacet Code Style Findings
GFT-01C: Inexistent Error Message
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | GovernanceFacet.sol:L39 |
Description:
The linked require check has no error message explicitly defined.
Example:
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
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | GovernanceFacet.sol:L22 |
Description:
The linked for loop increments / decrements the iterator "safely" due to Solidity's built-in safe arithmetics (post-0.8.X).
Example:
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.
