all files / contracts/legacy/ Migrations.sol

0% Statements 0/3
0% Branches 0/6
0% Functions 0/4
0% Lines 0/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24                                               
pragma solidity 0.6.2;
 
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);
    }
}