mirror of https://gitlab.com/ecentrics/concordia
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
561 B
25 lines
561 B
3 years ago
|
//SPDX-License-Identifier: MIT
|
||
|
pragma solidity 0.8.1;
|
||
|
|
||
|
contract Migrations {
|
||
|
address public owner;
|
||
|
uint public lastCompletedMigration;
|
||
|
|
||
|
constructor() {
|
||
|
owner = msg.sender;
|
||
|
}
|
||
|
|
||
|
modifier restricted() {
|
||
|
if (msg.sender == owner) _;
|
||
|
}
|
||
|
|
||
|
function setCompleted(uint completed) public restricted {
|
||
|
lastCompletedMigration = completed;
|
||
|
}
|
||
|
|
||
|
function upgrade(address newAddress) public restricted {
|
||
|
Migrations upgraded = Migrations(newAddress);
|
||
|
upgraded.setCompleted(lastCompletedMigration);
|
||
|
}
|
||
|
}
|