mirror of https://gitlab.com/ecentrics/concordia
24 lines
561 B
24 lines
561 B
//SPDX-License-Identifier: MIT
|
|
pragma solidity 0.8.0;
|
|
|
|
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);
|
|
}
|
|
}
|
|
|