Created
February 19, 2018 17:35
-
-
Save critesjosh/b3c906de90d3a8d3127c28fa691ed59a 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
| contract Relay { | |
| address public currentVersion; | |
| address public owner; | |
| modifier onlyOwner() { | |
| require(msg.sender == owner); | |
| _; | |
| } | |
| function Relay(address initAddr) { | |
| currentVersion = initAddr; | |
| owner = msg.sender; | |
| } | |
| function changeContract(address newVersion) public | |
| onlyOwner() | |
| { | |
| currentVersion = newVersion; | |
| } | |
| function() { | |
| require(currentVersion.delegatecall(msg.data)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment