Omniscia LimeChain Audit
GovernanceFacet Code Style Findings
GovernanceFacet Code Style Findings
GFT-01C: Inefficient Administrator Lookup
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | GovernanceFacet.sol:L102 |
Description:
The updateMember
function redundantly looks up the administrator of a member on each iteration.
Example:
contracts/facets/GovernanceFacet.sol
101for (uint256 i = 0; i < LibRouter.nativeTokensCount(); i++) {102 address accountAdmin = LibGovernance.memberAdmin(_account);103 address token = LibRouter.nativeTokenAt(i);104 uint256 claimableFees = LibFeeCalculator.claimReward(105 _account,106 token107 );108 IERC20(token).safeTransfer(accountAdmin, claimableFees);109}
Recommendation:
We advise this look-up to be performed only once outside the loop as the value of the administrator will not change in between iterations.
Alleviation:
The LimeChain team considered this exhibit and while acknowledged does not wish to apply it as they desire to retain the current contract version actively deployed in place.