Skip to content

Instantly share code, notes, and snippets.

@critesjosh
Created February 19, 2018 17:35
Show Gist options
  • Select an option

  • Save critesjosh/b3c906de90d3a8d3127c28fa691ed59a to your computer and use it in GitHub Desktop.

Select an option

Save critesjosh/b3c906de90d3a8d3127c28fa691ed59a to your computer and use it in GitHub Desktop.
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