From 41939b7612b600ed01e6289dde4abd85aafd3fa3 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Sun, 13 Jun 2021 17:11:07 +0200 Subject: [PATCH] fix N06 issue --- contracts/proxy/ERC1967/ERC1967Upgrade.sol | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contracts/proxy/ERC1967/ERC1967Upgrade.sol b/contracts/proxy/ERC1967/ERC1967Upgrade.sol index 0e63847187c..7e82f2fd7d1 100644 --- a/contracts/proxy/ERC1967/ERC1967Upgrade.sol +++ b/contracts/proxy/ERC1967/ERC1967Upgrade.sol @@ -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); } @@ -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); } }