Adding Truffle + changed State Machine image
This commit is contained in:
parent
3f8e8f4527
commit
86c5bb2261
|
@ -0,0 +1,2 @@
|
|||
.DS_Store
|
||||
secrets.json
|
|
@ -0,0 +1,23 @@
|
|||
pragma solidity ^0.4.4;
|
||||
|
||||
contract Migrations {
|
||||
address public owner;
|
||||
uint public last_completed_migration;
|
||||
|
||||
modifier restricted() {
|
||||
if (msg.sender == owner) _;
|
||||
}
|
||||
|
||||
function Migrations() {
|
||||
owner = msg.sender;
|
||||
}
|
||||
|
||||
function setCompleted(uint completed) restricted {
|
||||
last_completed_migration = completed;
|
||||
}
|
||||
|
||||
function upgrade(address new_address) restricted {
|
||||
Migrations upgraded = Migrations(new_address);
|
||||
upgraded.setCompleted(last_completed_migration);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
var Migrations = artifacts.require("./Migrations.sol");
|
||||
|
||||
module.exports = function(deployer) {
|
||||
deployer.deploy(Migrations);
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
let CodeBugBountyFactory = artifacts.require("./CodeBugBountyFactory.sol")
|
||||
|
||||
module.exports = function(deployer) {
|
||||
deployer.deploy(CodeBugBountyFactory);
|
||||
};
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 438 KiB |
|
@ -0,0 +1,39 @@
|
|||
// Allows us to use ES6 in our migrations and tests.
|
||||
require('babel-register')
|
||||
|
||||
const HDWalletProvider = require("truffle-hdwallet-provider")
|
||||
const fs = require("fs")
|
||||
|
||||
// First read in the secrets.json to get our mnemonic
|
||||
let secrets
|
||||
let mnemonic
|
||||
if(fs.existsSync("secrets.json")) {
|
||||
secrets = JSON.parse(fs.readFileSync("secrets.json", "utf8"))
|
||||
mnemonic = secrets.mnemonic
|
||||
} else {
|
||||
console.log("No secrets.json found. If you are trying to publish EPM " +
|
||||
"this will fail. Otherwise, you can ignore this message!")
|
||||
mnemonic = ""
|
||||
}
|
||||
|
||||
//HD Wallet params
|
||||
var providerUrlRopsten = "https://ropsten.infura.io"
|
||||
var providerUrlKovan = "https://kovan.infura.io"
|
||||
|
||||
module.exports = {
|
||||
networks: {
|
||||
development: {
|
||||
host: 'localhost',
|
||||
port: 8545,
|
||||
network_id: '*'
|
||||
},
|
||||
ropsten: {
|
||||
network_id: 3,
|
||||
provider: new HDWalletProvider(mnemonic, providerUrlRopsten)
|
||||
},
|
||||
kovan: {
|
||||
network_id: 4,
|
||||
provider: new HDWalletProvider(mnemonic, providerUrlKovan)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue