diff --git a/.env b/.env index 26856bc57..456d982a8 100644 --- a/.env +++ b/.env @@ -1,3 +1,6 @@ +MNEMONIC="onther eth pls kevin zoe carl jace jason thomas jake aiden jin" +INFURA_API_KEY="ff28995e0d5d43d48f19e8356e77dded" + OPERATOR_PRIV_KEY="b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" ADDR0="0x5df7107c960320b90a3d7ed9a83203d1f98a811d"; diff --git a/migrations/2_deploy_ether_token.js b/migrations/2_deploy_ether_token.js index 260f90690..a350925e6 100644 --- a/migrations/2_deploy_ether_token.js +++ b/migrations/2_deploy_ether_token.js @@ -2,9 +2,7 @@ const MintableToken = artifacts.require('MintableToken.sol'); const EtherToken = artifacts.require('EtherToken.sol'); const development = process.env.NODE_ENV !== 'production'; - const baseTokenAddress = process.env.BASE_TOKEN || '0x0000000000000000000000000000000000000000'; - const swapEnabled = true; module.exports = function (deployer) { diff --git a/migrations/3_deploy_rootchain.js b/migrations/3_deploy_rootchain.js index 43d7e8452..a867bc9fd 100644 --- a/migrations/3_deploy_rootchain.js +++ b/migrations/3_deploy_rootchain.js @@ -1,24 +1,27 @@ +const MintableToken = artifacts.require('MintableToken.sol'); +const EtherToken = artifacts.require('EtherToken.sol'); const EpochHandler = artifacts.require('EpochHandler.sol'); const RootChain = artifacts.require('RootChain.sol'); -const EtherToken = artifacts.require('EtherToken.sol'); +const swapEnabled = true; const development = process.env.NODE_ENV !== 'production'; - const NRBEpochLength = process.env.NRB_EPOCH_LENGTH || 2; const statesRoot = '0xdb431b544b2f5468e3f771d7843d9c5df3b4edcf8bc1c599f18f0b4ea8709bc3'; const transactionsRoot = '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'; const receiptsRoot = '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'; module.exports = function (deployer) { - deployer.deploy(EpochHandler) - .then((epochHandler) => deployer.deploy( - RootChain, - epochHandler.address, - EtherToken.address, - development, - NRBEpochLength, - statesRoot, - transactionsRoot, - receiptsRoot)) - .catch(e => { throw e; }); + deployer.deploy(MintableToken) + .then(token => deployer.deploy(EtherToken, development, token.address, swapEnabled) + .then(etherToken => deployer.deploy(EpochHandler) + .then(epochHandler => deployer.deploy( + RootChain, + epochHandler.address, + etherToken.address, + development, + NRBEpochLength, + statesRoot, + transactionsRoot, + receiptsRoot)) + .catch(e => { throw e; }))); }; diff --git a/truffle-config.js b/truffle-config.js index 418e1024d..d930827d5 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -1,5 +1,9 @@ require('dotenv').config(); +const HDWalletProvider = require('truffle-hdwallet-provider'); +const ropstenProviderUrl = `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`; +const ropstenProvider = new HDWalletProvider(`${process.env.MNEMONIC}`, ropstenProviderUrl, 0, 50); + module.exports = { networks: { development: { @@ -24,22 +28,31 @@ module.exports = { gasPrice: 1e9, network_id: '*', // eslint-disable-line camelcase }, - // ropsten: { - // provider: ropstenProvider, - // network_id: 3, // eslint-disable-line camelcase - // }, - // coverage: { - // host: 'localhost', - // network_id: '*', // eslint-disable-line camelcase - // port: 8555, - // gas: 0xfffffffffff, - // gasPrice: 0x01, - // }, - // ganache: { - // host: 'localhost', - // port: 8545, - // network_id: '*', // eslint-disable-line camelcase - // }, + docker: { + host: '192.168.0.8', + port: 8545, + gas: 7500000, + gasPrice: 1e9, + network_id: '*', // eslint-disable-line camelcase + websocket: true, + }, + ropsten: { + provider: ropstenProvider, + network_id: 3, // eslint-disable-line camelcase + gas: 7500000, + }, + coverage: { + host: 'localhost', + network_id: '*', // eslint-disable-line camelcase + port: 8555, + gas: 0xfffffffffff, + gasPrice: 0x01, + }, + ganache: { + host: 'localhost', + port: 8545, + network_id: '*', // eslint-disable-line camelcase + }, }, mocha: { reporter: 'eth-gas-reporter',