-
Notifications
You must be signed in to change notification settings - Fork 1
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
Florian Lenz
committed
Sep 6, 2018
0 parents
commit f10ff73
Showing
5 changed files
with
66 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
.DS_Store |
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 |
---|---|---|
@@ -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); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var Migrations = artifacts.require("./Migrations.sol"); | ||
|
||
module.exports = function(deployer) { | ||
deployer.deploy(Migrations); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* NB: since truffle-hdwallet-provider 0.0.5 you must wrap HDWallet providers in a | ||
* function when declaring them. Failure to do so will cause commands to hang. ex: | ||
* ``` | ||
* mainnet: { | ||
* provider: function() { | ||
* return new HDWalletProvider(mnemonic, 'https://mainnet.infura.io/<infura-key>') | ||
* }, | ||
* network_id: '1', | ||
* gas: 4500000, | ||
* gasPrice: 10000000000, | ||
* }, | ||
*/ | ||
|
||
module.exports = { | ||
// See <http://truffleframework.com/docs/advanced/configuration> | ||
// to customize your Truffle configuration! | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* NB: since truffle-hdwallet-provider 0.0.5 you must wrap HDWallet providers in a | ||
* function when declaring them. Failure to do so will cause commands to hang. ex: | ||
* ``` | ||
* mainnet: { | ||
* provider: function() { | ||
* return new HDWalletProvider(mnemonic, 'https://mainnet.infura.io/<infura-key>') | ||
* }, | ||
* network_id: '1', | ||
* gas: 4500000, | ||
* gasPrice: 10000000000, | ||
* }, | ||
*/ | ||
|
||
module.exports = { | ||
// See <http://truffleframework.com/docs/advanced/configuration> | ||
// to customize your Truffle configuration! | ||
}; |