Created
November 12, 2019 14:39
-
-
Save scottt/d0d2201ef9d144be0b5e73c360c8d648 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
pragma solidity >=0.4.21 <0.6.0; | |
contract Migrations { | |
address public owner; | |
uint public last_completed_migration; | |
constructor() public { | |
owner = msg.sender; | |
} | |
modifier restricted() { | |
if (msg.sender == owner) _; | |
} | |
function setCompleted(uint completed) public restricted { | |
last_completed_migration = completed; | |
} | |
function upgrade(address new_address) public restricted { | |
Migrations upgraded = Migrations(new_address); | |
upgraded.setCompleted(last_completed_migration); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment