4
4
pragma solidity ^ 0.8.20 ;
5
5
6
6
import {IBeacon} from "../beacon/IBeacon.sol " ;
7
+ import {IERC1967 } from "../../interfaces/IERC1967.sol " ;
7
8
import {Address} from "../../utils/Address.sol " ;
8
9
import {StorageSlot} from "../../utils/StorageSlot.sol " ;
9
10
@@ -12,21 +13,6 @@ import {StorageSlot} from "../../utils/StorageSlot.sol";
12
13
* https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.
13
14
*/
14
15
library ERC1967Utils {
15
- /**
16
- * @dev Emitted when the implementation is upgraded.
17
- */
18
- event Upgraded (address indexed implementation );
19
-
20
- /**
21
- * @dev Emitted when the admin account has changed.
22
- */
23
- event AdminChanged (address previousAdmin , address newAdmin );
24
-
25
- /**
26
- * @dev Emitted when the beacon is changed.
27
- */
28
- event BeaconUpgraded (address indexed beacon );
29
-
30
16
/**
31
17
* @dev Storage slot with the address of the current implementation.
32
18
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
@@ -80,7 +66,7 @@ library ERC1967Utils {
80
66
*/
81
67
function upgradeToAndCall (address newImplementation , bytes memory data ) internal {
82
68
_setImplementation (newImplementation);
83
- emit Upgraded (newImplementation);
69
+ emit IERC1967 . Upgraded (newImplementation);
84
70
85
71
if (data.length > 0 ) {
86
72
Address.functionDelegateCall (newImplementation, data);
@@ -123,7 +109,7 @@ library ERC1967Utils {
123
109
* Emits an {IERC1967-AdminChanged} event.
124
110
*/
125
111
function changeAdmin (address newAdmin ) internal {
126
- emit AdminChanged (getAdmin (), newAdmin);
112
+ emit IERC1967 . AdminChanged (getAdmin (), newAdmin);
127
113
_setAdmin (newAdmin);
128
114
}
129
115
@@ -170,7 +156,7 @@ library ERC1967Utils {
170
156
*/
171
157
function upgradeBeaconToAndCall (address newBeacon , bytes memory data ) internal {
172
158
_setBeacon (newBeacon);
173
- emit BeaconUpgraded (newBeacon);
159
+ emit IERC1967 . BeaconUpgraded (newBeacon);
174
160
175
161
if (data.length > 0 ) {
176
162
Address.functionDelegateCall (IBeacon (newBeacon).implementation (), data);
0 commit comments