Skip to content

Commit

Permalink
Remove repeated code from ERC1967Upgrade (#2720)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Jun 14, 2021
1 parent fd111df commit 6f50f6e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions contracts/proxy/ERC1967/ERC1967Upgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ abstract contract ERC1967Upgrade {
bytes memory data,
bool forceCall
) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
Address.functionDelegateCall(newImplementation, data);
}
Expand Down Expand Up @@ -103,8 +102,7 @@ abstract contract ERC1967Upgrade {
// Check rollback was effective
require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
// Finally reset to the new implementation and log the upgrade
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
_upgradeTo(newImplementation);
}
}

Expand Down

0 comments on commit 6f50f6e

Please sign in to comment.