-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
2,346 additions
and
1,936 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
pragma solidity ^0.4.18; | ||
pragma solidity ^0.4.21; | ||
|
||
contract Migrations { | ||
address public owner; | ||
uint public last_completed_migration; | ||
|
||
modifier restricted() { | ||
require (msg.sender == owner); | ||
_; | ||
} | ||
address public owner; | ||
|
||
uint public lastCompletedMigration; | ||
|
||
function Migrations() public { | ||
owner = msg.sender; | ||
} | ||
modifier restricted() { | ||
require(msg.sender == owner); | ||
_; | ||
} | ||
|
||
function setCompleted(uint completed)public restricted { | ||
last_completed_migration = completed; | ||
} | ||
function Migrations() public { | ||
owner = msg.sender; | ||
} | ||
|
||
function upgrade(address new_address)public restricted { | ||
Migrations upgraded = Migrations(new_address); | ||
upgraded.setCompleted(last_completed_migration); | ||
} | ||
function setCompleted(uint _completed)public restricted { | ||
lastCompletedMigration = _completed; | ||
} | ||
|
||
function upgrade(address _newAddress)public restricted { | ||
Migrations upgraded = Migrations(_newAddress); | ||
upgraded.setCompleted(lastCompletedMigration); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.