Advertisement
Guest User

Migrations.sol

a guest
Jan 3rd, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. pragma solidity 0.5.0;
  2.  
  3. contract Migrations {
  4. address public owner;
  5. uint public last_completed_migration;
  6.  
  7. modifier restricted() {
  8. if (msg.sender == owner) _;
  9. }
  10.  
  11. constructor () public {
  12. owner = msg.sender;
  13. }
  14.  
  15. function setCompleted(uint completed) restricted public{
  16. last_completed_migration = completed;
  17. }
  18.  
  19. function upgrade(address new_address) restricted public {
  20. Migrations upgraded = Migrations(new_address);
  21. upgraded.setCompleted(last_completed_migration);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement