Skip to content

Commit 2d4b867

Browse files
committed
upgrades: externally Owned Accounts can be set as implementation contracts
Checking whether the address passed to the acceptUpgrade function is a contract or not using the Address.isContract function of the OpenZeppelin contracts.
1 parent b7ca295 commit 2d4b867

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contracts/upgrades/GraphProxy.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
pragma solidity ^0.6.12;
22

3+
import "@openzeppelin/contracts/utils/Address.sol";
4+
35
import "./GraphProxyStorage.sol";
46

57
/**
@@ -69,6 +71,7 @@ contract GraphProxy is GraphProxyStorage {
6971
*/
7072
function acceptUpgrade() external {
7173
address _pendingImplementation = _pendingimplementation();
74+
require(Address.isContract(_pendingImplementation), "Implementation must be a contract");
7275
require(
7376
_pendingImplementation != address(0) && msg.sender == _pendingImplementation,
7477
"Caller must be the pending implementation"

0 commit comments

Comments
 (0)