2018-10-23 07:52:31 +00:00
|
|
|
pragma solidity 0.4.24;
|
|
|
|
|
|
|
|
/* solium-disable mixedcase */
|
|
|
|
contract Migrations {
|
2018-10-24 17:22:58 +00:00
|
|
|
address public owner;
|
|
|
|
uint public last_completed_migration;
|
2018-10-23 07:52:31 +00:00
|
|
|
|
2018-10-24 17:22:58 +00:00
|
|
|
modifier restricted() {
|
|
|
|
if (msg.sender == owner)
|
|
|
|
_;
|
|
|
|
}
|
2018-10-23 07:52:31 +00:00
|
|
|
|
2018-10-24 17:22:58 +00:00
|
|
|
constructor()
|
|
|
|
public
|
|
|
|
{
|
|
|
|
owner = msg.sender;
|
|
|
|
}
|
2018-10-23 07:52:31 +00:00
|
|
|
|
2018-10-24 17:22:58 +00:00
|
|
|
function setCompleted(uint completed) public restricted {
|
|
|
|
last_completed_migration = completed;
|
|
|
|
}
|
2018-10-23 07:52:31 +00:00
|
|
|
|
2018-10-24 17:22:58 +00:00
|
|
|
function upgrade(address _newAddress) public restricted {
|
|
|
|
Migrations upgraded = Migrations(_newAddress);
|
|
|
|
upgraded.setCompleted(last_completed_migration);
|
|
|
|
}
|
2018-10-23 07:52:31 +00:00
|
|
|
}
|
|
|
|
|
2018-10-24 17:22:58 +00:00
|
|
|
/* solium-enable mixedcase */
|