The modifier EmergencyGovernable.onlyTimelockOrEmergencyGovernance() calls governor() twice, resulting with two SLOADs operations for the _owner state variable that was inherited from Ownable.
Impact
Storage reads are much more expensive than reading local variables.
Tool Used
Manual code review.
Recommended Mitigation Steps
Call governor() only once and cache the return value in a local variable. Then, use the local variable to load this value again.
Handle
pants
Vulnerability details
The modifier
EmergencyGovernable.onlyTimelockOrEmergencyGovernance()
callsgovernor()
twice, resulting with twoSLOAD
s operations for the_owner
state variable that was inherited fromOwnable
.Impact
Storage reads are much more expensive than reading local variables.
Tool Used
Manual code review.
Recommended Mitigation Steps
Call
governor()
only once and cache the return value in a local variable. Then, use the local variable to load this value again.