Last active
August 21, 2021 06:34
-
-
Save karlfloersch/b71c9e2453cf40ea886b32c538f4064e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.7.0; | |
contract EOAProxy { | |
address implementation = DEFAULT_IMPL_ADDR; | |
function _eoaUpgrade(address _newImplementation) external { | |
require(msg.sender == address(this)); | |
implementation = _newImplementation; | |
} | |
fallback() external { | |
address impl = implementation; | |
assembly { | |
pop(delegatecall(gas(), impl, 0, 0, 0, calldatasize())) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example upgrade