Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove repeated code from ERC1967Upgrade #2720

Merged
merged 1 commit into from Jun 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions contracts/proxy/ERC1967/ERC1967Upgrade.sol
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