Skip to content

Commit 0e36a39

Browse files
committed
upgrades: updating the proxy admin address was not emitting an event
Add AdminUpdated(address oldAdmin, address newAdmin) event whenever _setAdmin() is called
1 parent c56de82 commit 0e36a39

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

contracts/upgrades/GraphProxy.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ contract GraphProxy is GraphProxyStorage {
2323
);
2424

2525
_setAdmin(msg.sender);
26-
upgradeTo(_impl);
26+
_setPendingImplementation(_impl);
2727
}
2828

2929
/**

contracts/upgrades/GraphProxyStorage.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ contract GraphProxyStorage {
4545
*/
4646
event ImplementationUpdated(address oldImplementation, address newImplementation);
4747

48+
/**
49+
* @dev Emitted when the admin account has changed.
50+
*/
51+
event AdminUpdated(address oldAdmin, address newAdmin);
52+
4853
/**
4954
* @dev Modifier to check whether the `msg.sender` is the admin.
5055
*/
@@ -72,6 +77,8 @@ contract GraphProxyStorage {
7277
assembly {
7378
sstore(slot, _newAdmin)
7479
}
80+
81+
emit AdminUpdated(_admin(), _newAdmin);
7582
}
7683

7784
/**

0 commit comments

Comments
 (0)