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.

23 lines
506 B

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