Skip to content

Commit 6f50f6e

Browse files
authored
Remove repeated code from ERC1967Upgrade (#2720)
1 parent fd111df commit 6f50f6e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

contracts/proxy/ERC1967/ERC1967Upgrade.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ abstract contract ERC1967Upgrade {
6565
bytes memory data,
6666
bool forceCall
6767
) internal {
68-
_setImplementation(newImplementation);
69-
emit Upgraded(newImplementation);
68+
_upgradeTo(newImplementation);
7069
if (data.length > 0 || forceCall) {
7170
Address.functionDelegateCall(newImplementation, data);
7271
}
@@ -103,8 +102,7 @@ abstract contract ERC1967Upgrade {
103102
// Check rollback was effective
104103
require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
105104
// Finally reset to the new implementation and log the upgrade
106-
_setImplementation(newImplementation);
107-
emit Upgraded(newImplementation);
105+
_upgradeTo(newImplementation);
108106
}
109107
}
110108

0 commit comments

Comments
 (0)