Migrations.sol 467 B

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