Description: The _isEmergencyPauseFacet internal function is used to compare if the facet address is equal to the emergency pause facet. The function is used only in a single instance, so it can be optimized to avoid extra memory.
function _getAllFacetFunctionSelectorsToBeRemoved()
internal
view
returns (IDiamondLoupe.Facet[] memory toBeRemoved)
{
...
if (allFacets[i].facetAddress != _emergencyPauseFacetAddress) {
...
}
[PASS] test_DiamondOwnerCanPauseDiamond() (gas: 490820) --> BEFORE OPTIMIZATION
[PASS] test_DiamondOwnerCanPauseDiamond() (gas: 490536) --> AFTER OPTIMIZATION
Recommendation: Optimize code by removing the _isEmergencyPauseFacet.
Context: EmergencyPauseFacet.sol#L159
Description: The
_isEmergencyPauseFacet
internal function is used to compare if the facet address is equal to the emergency pause facet. The function is used only in a single instance, so it can be optimized to avoid extra memory.Recommendation: Optimize code by removing the
_isEmergencyPauseFacet
.LI.FI: Fixed in 7ea4c75b2049fbe173b145eed91a7b0b048eb786
Researcher: Confirmed.