Skip to content

Commit

Permalink
Initialize Truffle project
Browse files Browse the repository at this point in the history
  • Loading branch information
PRASM-Network committed Jun 7, 2018
1 parent dc886a8 commit 2286287
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions contracts/Migrations.sol
@@ -0,0 +1,23 @@
pragma solidity ^0.4.23;

contract Migrations {
address public owner;
uint public last_completed_migration;

constructor() public {
owner = msg.sender;
}

modifier restricted() {
if (msg.sender == owner) _;
}

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

function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
5 changes: 5 additions & 0 deletions migrations/1_initial_migration.js
@@ -0,0 +1,5 @@
var Migrations = artifacts.require("./Migrations.sol");

module.exports = function(deployer) {
deployer.deploy(Migrations);
};
4 changes: 4 additions & 0 deletions truffle-config.js
@@ -0,0 +1,4 @@
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
};
4 changes: 4 additions & 0 deletions truffle.js
@@ -0,0 +1,4 @@
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
};

0 comments on commit 2286287

Please sign in to comment.