Created
December 7, 2016 22:14
-
-
Save zmitton/dca7bb5e4ede7c9c50ff7aaa7d51577c to your computer and use it in GitHub Desktop.
This file contains 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
contract ContractProxy { | |
address public owner; | |
address public destination; | |
modifier onlyOwner(){ if (msg.sender == owner) _; } | |
function ProxyDapp(){ owner = msg.sender; } | |
//main function called by all users | |
function forward(bytes data) { | |
if (!destination.delegatecall(data)) { throw; } | |
} | |
//upgrade by deploying a new contract and simply updating this address | |
function upgradeDestinationAddress(address _destination) onlyOwner { | |
destination = _destination; | |
} | |
//pass 0x0 to reliquish superhuman ownership powers | |
function transferOwner(address _owner) onlyOwner { owner = _owner; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment