Skip to content

Commit

Permalink
styling in Migrations.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Cosman committed Apr 24, 2018
1 parent 1aebb74 commit c19bb7e
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
pragma solidity ^0.4.21;

contract Migrations {
address public owner;
uint public last_completed_migration;
import "zeppelin-solidity/contracts/ownership/Ownable.sol";

modifier restricted() {
if (msg.sender == owner) _;
}
// This is a truffle contract, needed for truffle integration.
contract Migrations is Ownable {
uint256 public lastCompletedMigration;

function Migrations() public {
owner = msg.sender;
}
function Migrations() public {
owner = msg.sender;
}

function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
function setCompleted(uint _completed) public onlyOwner {
lastCompletedMigration = _completed;
}

function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
function upgrade(address _newAddress) public onlyOwner {
Migrations upgraded = Migrations(_newAddress);
upgraded.setCompleted(lastCompletedMigration);
}
}

0 comments on commit c19bb7e

Please sign in to comment.