Migrations.sol 582 B

1234567891011121314151617181920212223242526
  1. // solhint-disable
  2. pragma solidity ^0.4.4;
  3. contract Migrations {
  4. address public owner;
  5. uint public last_completed_migration;
  6. modifier restricted() {
  7. if (msg.sender == owner) _;
  8. }
  9. function Migrations() public {
  10. owner = msg.sender;
  11. }
  12. function setCompleted(uint completed) public restricted {
  13. last_completed_migration = completed;
  14. }
  15. function upgrade(address new_address) public restricted {
  16. Migrations upgraded = Migrations(new_address);
  17. upgraded.setCompleted(last_completed_migration);
  18. }
  19. }