Skip to content

Commit 2c4ac9d

Browse files
committed
fix(c4-117-g03): state variables should be cached in stack variables
Signed-off-by: Tomás Migone <[email protected]>
1 parent 85312a0 commit 2c4ac9d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

contracts/governance/Governed.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ contract Governed {
5151
* This function must called by the pending governor.
5252
*/
5353
function acceptOwnership() external {
54+
address _pendingGovernor = pendingGovernor;
5455
require(
55-
pendingGovernor != address(0) && msg.sender == pendingGovernor,
56+
_pendingGovernor != address(0) && msg.sender == _pendingGovernor,
5657
"Caller must be pending governor"
5758
);
5859

5960
address oldGovernor = governor;
60-
address oldPendingGovernor = pendingGovernor;
61+
address oldPendingGovernor = _pendingGovernor;
6162

62-
governor = pendingGovernor;
63+
governor = _pendingGovernor;
6364
pendingGovernor = address(0);
6465

6566
emit NewOwnership(oldGovernor, governor);

0 commit comments

Comments
 (0)