From 04a0e2a5dc4d72f2d1157f3f8a83401a6ae7a67e Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Wed, 19 Sep 2018 14:58:41 -0300 Subject: [PATCH 01/77] Add BlockReward test contract --- contracts/IBlockReward.sol | 6 ++++++ contracts/test/BlockReward.sol | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 contracts/IBlockReward.sol create mode 100644 contracts/test/BlockReward.sol diff --git a/contracts/IBlockReward.sol b/contracts/IBlockReward.sol new file mode 100644 index 000000000..3ff89456d --- /dev/null +++ b/contracts/IBlockReward.sol @@ -0,0 +1,6 @@ +pragma solidity 0.4.24; + + +interface IBlockReward { + function addExtraReceiver(uint256 _amount, address _receiver) external; +} diff --git a/contracts/test/BlockReward.sol b/contracts/test/BlockReward.sol new file mode 100644 index 000000000..636ced2c3 --- /dev/null +++ b/contracts/test/BlockReward.sol @@ -0,0 +1,21 @@ +pragma solidity 0.4.24; + +import "../IBlockReward.sol"; +import "../libraries/SafeMath.sol"; + + +contract BlockReward is IBlockReward { + using SafeMath for uint256; + + uint256 public totalMintedCoins = 0; + + function () external payable { + } + + function addExtraReceiver(uint256 _amount, address _receiver) external { + require(_amount > 0); + require(_receiver != address(0)); + totalMintedCoins = totalMintedCoins.add(_amount); + _receiver.transfer(_amount); + } +} From 845dd821728e5c081bb3032c6284563ee6bf50d5 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Wed, 19 Sep 2018 14:58:56 -0300 Subject: [PATCH 02/77] Add erc20-to-native contracts --- .../ForeignBridgeErcToNative.sol | 47 +++++++++++ .../erc20_to_native/HomeBridgeErcToNative.sol | 78 +++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol create mode 100644 contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol diff --git a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol new file mode 100644 index 000000000..1aca7ea8c --- /dev/null +++ b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol @@ -0,0 +1,47 @@ +pragma solidity 0.4.24; +import "../../libraries/SafeMath.sol"; +import "../../libraries/Message.sol"; +import "../BasicBridge.sol"; +import "../BasicForeignBridge.sol"; +import "../../IBurnableMintableERC677Token.sol"; +import "../../ERC677Receiver.sol"; +import "openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol"; + + +contract ForeignBridgeErcToNative is BasicBridge, BasicForeignBridge { + event RelayedMessage(address recipient, uint value, bytes32 transactionHash); + + function initialize( + address _validatorContract, + address _erc20token, + uint256 _requiredBlockConfirmations + ) public returns(bool) { + require(!isInitialized(), "already initialized"); + require(_validatorContract != address(0), "address cannot be empty"); + require(_requiredBlockConfirmations != 0, "requiredBlockConfirmations cannot be 0"); + addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; + setErc20token(_erc20token); + uintStorage[keccak256(abi.encodePacked("deployedAtBlock"))] = block.number; + uintStorage[keccak256(abi.encodePacked("requiredBlockConfirmations"))] = _requiredBlockConfirmations; + setInitialize(true); + return isInitialized(); + } + + function claimTokens(address _token, address _to) public onlyOwner { + require(_token != address(erc20token())); + super.claimTokens(_token, _to); + } + + function erc20token() public view returns(ERC20Basic) { + return ERC20Basic(addressStorage[keccak256(abi.encodePacked("erc20token"))]); + } + + function onExecuteMessage(address _recipient, uint256 _amount) internal returns(bool) { + return erc20token().transfer(_recipient, _amount); + } + + function setErc20token(address _token) private { + require(_token != address(0)); + addressStorage[keccak256(abi.encodePacked("erc20token"))] = _token; + } +} diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol new file mode 100644 index 000000000..e86cbd81f --- /dev/null +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -0,0 +1,78 @@ +pragma solidity 0.4.24; +import "../../libraries/SafeMath.sol"; +import "../../libraries/Message.sol"; +import "../BasicBridge.sol"; +import "../../upgradeability/EternalStorage.sol"; +import "../../IBlockReward.sol"; +import "../../ERC677Receiver.sol"; +import "../BasicHomeBridge.sol"; +import "../ERC677Bridge.sol"; + + +contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { + + function () public payable { + require(msg.value > 0); + require(msg.data.length == 0); + require(withinLimit(msg.value)); + setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(msg.value)); + setTotalBurntCoins(totalBurntCoins().add(msg.value)); + address(0).transfer(msg.value); + emit UserRequestForSignature(msg.sender, msg.value); + } + + function initialize ( + address _validatorContract, + uint256 _dailyLimit, + uint256 _maxPerTx, + uint256 _minPerTx, + uint256 _homeGasPrice, + uint256 _requiredBlockConfirmations, + address _blockReward + + ) public returns(bool) + { + require(!isInitialized()); + require(_validatorContract != address(0)); + require(_homeGasPrice > 0); + require(_requiredBlockConfirmations > 0); + require(_minPerTx > 0 && _maxPerTx > _minPerTx && _dailyLimit > _maxPerTx); + addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; + uintStorage[keccak256(abi.encodePacked("deployedAtBlock"))] = block.number; + uintStorage[keccak256(abi.encodePacked("dailyLimit"))] = _dailyLimit; + uintStorage[keccak256(abi.encodePacked("maxPerTx"))] = _maxPerTx; + uintStorage[keccak256(abi.encodePacked("minPerTx"))] = _minPerTx; + uintStorage[keccak256(abi.encodePacked("gasPrice"))] = _homeGasPrice; + uintStorage[keccak256(abi.encodePacked("requiredBlockConfirmations"))] = _requiredBlockConfirmations; + setBlockRewardContract(_blockReward); + setInitialize(true); + + return isInitialized(); + } + + function blockRewardContract() public view returns(IBlockReward) { + return IBlockReward(addressStorage[keccak256(abi.encodePacked("blockRewardContract"))]); + } + + function totalBurntCoins() public view returns(uint256) { + return uintStorage[keccak256(abi.encodePacked("totalBurntCoins"))]; + } + + function setBlockRewardContract(address _blockReward) internal { + require(_blockReward != address(0)); + addressStorage[keccak256(abi.encodePacked("blockRewardContract"))] = _blockReward; + } + + function onExecuteAffirmation(address _recipient, uint256 _value) internal returns(bool) { + blockRewardContract().addExtraReceiver(_value, _recipient); + return true; + } + + function fireEventOnTokenTransfer(address _from, uint256 _value) internal { + emit UserRequestForSignature(_from, _value); + } + + function setTotalBurntCoins(uint256 _amount) internal { + uintStorage[keccak256(abi.encodePacked("totalBurntCoins"))] = _amount; + } +} From 3c48744826a79d360679a2df00610df7454bf995 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Wed, 19 Sep 2018 15:00:25 -0300 Subject: [PATCH 03/77] Add home erc20-to-native tests --- test/erc_to_native/home_bridge.test.js | 209 +++++++++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 test/erc_to_native/home_bridge.test.js diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js new file mode 100644 index 000000000..4766ff255 --- /dev/null +++ b/test/erc_to_native/home_bridge.test.js @@ -0,0 +1,209 @@ +const Web3Utils = require('web3-utils') +const HomeBridge = artifacts.require('HomeBridgeErcToNative.sol') +const EternalStorageProxy = artifacts.require('EternalStorageProxy.sol') +const BridgeValidators = artifacts.require('BridgeValidators.sol') +const BlockReward = artifacts.require('BlockReward') +const {ERROR_MSG, ZERO_ADDRESS} = require('../setup'); +const minPerTx = web3.toBigNumber(web3.toWei(0.01, "ether")); +const requireBlockConfirmations = 8; +const gasPrice = Web3Utils.toWei('1', 'gwei'); +const oneEther = web3.toBigNumber(web3.toWei(1, "ether")); +const halfEther = web3.toBigNumber(web3.toWei(0.5, "ether")); + +contract('HomeBridge_ERC20_to_Native', async (accounts) => { + let homeContract, validatorContract, blockRewardContract, authorities, owner; + before(async () => { + validatorContract = await BridgeValidators.new() + blockRewardContract = await BlockReward.new() + authorities = [accounts[1]] + owner = accounts[0] + await validatorContract.initialize(1, authorities, owner) + }) + + describe('initialize', async() => { + beforeEach(async () => { + homeContract = await HomeBridge.new() + }) + it('sets variables', async () => { + ZERO_ADDRESS.should.be.equal(await homeContract.validatorContract()) + '0'.should.be.bignumber.equal(await homeContract.deployedAtBlock()) + '0'.should.be.bignumber.equal(await homeContract.dailyLimit()) + '0'.should.be.bignumber.equal(await homeContract.maxPerTx()) + false.should.be.equal(await homeContract.isInitialized()) + ZERO_ADDRESS.should.be.equal(await homeContract.blockRewardContract()) + + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address).should.be.fulfilled + + true.should.be.equal(await homeContract.isInitialized()) + validatorContract.address.should.be.equal(await homeContract.validatorContract()) + blockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()); + (await homeContract.deployedAtBlock()).should.be.bignumber.above(0) + '3'.should.be.bignumber.equal(await homeContract.dailyLimit()) + '2'.should.be.bignumber.equal(await homeContract.maxPerTx()) + '1'.should.be.bignumber.equal(await homeContract.minPerTx()) + }) + it('cant set maxPerTx > dailyLimit', async () => { + false.should.be.equal(await homeContract.isInitialized()) + + await homeContract.initialize(validatorContract.address, '1', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address).should.be.rejectedWith(ERROR_MSG) + await homeContract.initialize(validatorContract.address, '3', '2', '2', gasPrice, requireBlockConfirmations, blockRewardContract.address).should.be.rejectedWith(ERROR_MSG) + + false.should.be.equal(await homeContract.isInitialized()) + }) + + it('can be deployed via upgradeToAndCall', async () => { + let storageProxy = await EternalStorageProxy.new().should.be.fulfilled; + let data = homeContract.initialize.request(validatorContract.address, "3", "2", "1", gasPrice, requireBlockConfirmations, blockRewardContract.address).params[0].data + + await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled + let finalContract = await HomeBridge.at(storageProxy.address); + + true.should.be.equal(await finalContract.isInitialized()) + validatorContract.address.should.be.equal(await finalContract.validatorContract()) + blockRewardContract.address.should.be.equal(await finalContract.blockRewardContract()) + "3".should.be.bignumber.equal(await finalContract.dailyLimit()) + "2".should.be.bignumber.equal(await finalContract.maxPerTx()) + "1".should.be.bignumber.equal(await finalContract.minPerTx()) + }) + }) + + describe('fallback', async () => { + beforeEach(async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address) + }) + + it('should accept native coins', async () => { + const currentDay = await homeContract.getCurrentDay() + '0'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) + + const {logs} = await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + + logs[0].event.should.be.equal('UserRequestForSignature') + logs[0].args.should.be.deep.equal({ recipient: accounts[1], value: new web3.BigNumber(1) }) + '1'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) + '1'.should.be.bignumber.equal(await homeContract.totalBurntCoins()) + }) + + it('doesnt let you send more than daily limit', async () => { + const currentDay = await homeContract.getCurrentDay() + '0'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + + '1'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) + '1'.should.be.bignumber.equal(await homeContract.totalBurntCoins()) + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled; + '2'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) + + await homeContract.sendTransaction({ from: accounts[1], value: 2 }).should.be.rejectedWith(ERROR_MSG); + + await homeContract.setDailyLimit(4).should.be.fulfilled; + await homeContract.sendTransaction({ from: accounts[1], value: 2 }).should.be.fulfilled; + '4'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) + '4'.should.be.bignumber.equal(await homeContract.totalBurntCoins()) + }) + + it('doesnt let you send more than max amount per tx', async () => { + await homeContract.sendTransaction({ + from: accounts[1], + value: 1 + }).should.be.fulfilled + await homeContract.sendTransaction({ + from: accounts[1], + value: 3 + }).should.be.rejectedWith(ERROR_MSG) + await homeContract.setMaxPerTx(100).should.be.rejectedWith(ERROR_MSG); + await homeContract.setDailyLimit(100).should.be.fulfilled; + await homeContract.setMaxPerTx(99).should.be.fulfilled; + //meets max per tx and daily limit + await homeContract.sendTransaction({ + from: accounts[1], + value: 99 + }).should.be.fulfilled + //above daily limit + await homeContract.sendTransaction({ + from: accounts[1], + value: 1 + }).should.be.rejectedWith(ERROR_MSG) + + }) + + it('should not let to deposit less than minPerTx', async () => { + const newDailyLimit = 100; + const newMaxPerTx = 50; + const newMinPerTx = 20; + + await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled; + await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled; + await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled; + + await homeContract.sendTransaction({ from: accounts[1], value: newMinPerTx }).should.be.fulfilled + await homeContract.sendTransaction({ from: accounts[1], value: newMinPerTx - 1 }).should.be.rejectedWith(ERROR_MSG) + }) + }) + + describe('setting limits', async () => { + let homeContract; + beforeEach(async () => { + homeContract = await HomeBridge.new() + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address) + }) + it('setMaxPerTx allows to set only to owner and cannot be more than daily limit', async () => { + await homeContract.setMaxPerTx(2, {from: authorities[0]}).should.be.rejectedWith(ERROR_MSG); + await homeContract.setMaxPerTx(2, {from: owner}).should.be.fulfilled; + + await homeContract.setMaxPerTx(3, {from: owner}).should.be.rejectedWith(ERROR_MSG); + }) + + it('setMinPerTx allows to set only to owner and cannot be more than daily limit and should be less than maxPerTx', async () => { + await homeContract.setMinPerTx(1, {from: authorities[0]}).should.be.rejectedWith(ERROR_MSG); + await homeContract.setMinPerTx(1, {from: owner}).should.be.fulfilled; + + await homeContract.setMinPerTx(2, {from: owner}).should.be.rejectedWith(ERROR_MSG); + }) + }) + + describe('executeAffirmation', async () => { + let homeBridge; + beforeEach(async () => { + homeBridge = await HomeBridge.new(); + await homeBridge.initialize(validatorContract.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, blockRewardContract.address); + await blockRewardContract.sendTransaction({ + from: accounts[2], + value: oneEther + }).should.be.fulfilled + }) + it('should allow validator to executeAffirmation', async () => { + const recipient = accounts[5]; + const value = halfEther; + const balanceBefore = await web3.eth.getBalance(recipient) + const balanceBlockRewardContract = await web3.eth.getBalance(blockRewardContract.address) + console.log('balanceBlockRewardContract', balanceBlockRewardContract.toString()) + const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; + const {logs} = await homeBridge.executeAffirmation(recipient, value, transactionHash, {from: authorities[0]}) + + logs[0].event.should.be.equal("SignedForAffirmation"); + logs[0].args.should.be.deep.equal({ + signer: authorities[0], + transactionHash + }); + logs[1].event.should.be.equal("AffirmationCompleted"); + logs[1].args.should.be.deep.equal({ + recipient, + value, + transactionHash + }) + const homeBalanceAfter = await web3.eth.getBalance(homeBridge.address) + const balanceAfter = await web3.eth.getBalance(recipient) + balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) + homeBalanceAfter.should.be.bignumber.equal(0) + + const msgHash = Web3Utils.soliditySha3(recipient, value, transactionHash); + const senderHash = Web3Utils.soliditySha3(authorities[0], msgHash) + true.should.be.equal(await homeBridge.affirmationsSigned(senderHash)) + }) + }) + +}) From 325c319e30effc07989db4d2c41862e99b072378 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 20 Sep 2018 10:35:41 -0300 Subject: [PATCH 04/77] Update home erc20-to-native tests --- test/erc_to_native/home_bridge.test.js | 184 +++++++++++++++++++++++-- 1 file changed, 176 insertions(+), 8 deletions(-) diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 4766ff255..0b5d6310e 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -4,6 +4,7 @@ const EternalStorageProxy = artifacts.require('EternalStorageProxy.sol') const BridgeValidators = artifacts.require('BridgeValidators.sol') const BlockReward = artifacts.require('BlockReward') const {ERROR_MSG, ZERO_ADDRESS} = require('../setup'); +const {createMessage, sign } = require('../helpers/helpers'); const minPerTx = web3.toBigNumber(web3.toWei(0.01, "ether")); const requireBlockConfirmations = 8; const gasPrice = Web3Utils.toWei('1', 'gwei'); @@ -20,7 +21,7 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { await validatorContract.initialize(1, authorities, owner) }) - describe('initialize', async() => { + describe('#initialize', async() => { beforeEach(async () => { homeContract = await HomeBridge.new() }) @@ -67,7 +68,7 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { }) }) - describe('fallback', async () => { + describe('#fallback', async () => { beforeEach(async () => { homeContract = await HomeBridge.new() await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address) @@ -83,6 +84,25 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { logs[0].args.should.be.deep.equal({ recipient: accounts[1], value: new web3.BigNumber(1) }) '1'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) '1'.should.be.bignumber.equal(await homeContract.totalBurntCoins()) + const homeContractBalance = await web3.eth.getBalance(homeContract.address) + homeContractBalance.should.be.bignumber.equal('0') + }) + + it('should accumulate burnt coins', async () => { + const currentDay = await homeContract.getCurrentDay() + '0'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + '1'.should.be.bignumber.equal(await homeContract.totalBurntCoins()) + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + '2'.should.be.bignumber.equal(await homeContract.totalBurntCoins()) + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + '3'.should.be.bignumber.equal(await homeContract.totalBurntCoins()) + + const homeContractBalance = await web3.eth.getBalance(homeContract.address) + homeContractBalance.should.be.bignumber.equal('0') }) it('doesnt let you send more than daily limit', async () => { @@ -144,7 +164,7 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { }) }) - describe('setting limits', async () => { + describe('#setting limits', async () => { let homeContract; beforeEach(async () => { homeContract = await HomeBridge.new() @@ -165,7 +185,7 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { }) }) - describe('executeAffirmation', async () => { + describe('#executeAffirmation', async () => { let homeBridge; beforeEach(async () => { homeBridge = await HomeBridge.new(); @@ -175,12 +195,11 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { value: oneEther }).should.be.fulfilled }) + it('should allow validator to executeAffirmation', async () => { const recipient = accounts[5]; const value = halfEther; const balanceBefore = await web3.eth.getBalance(recipient) - const balanceBlockRewardContract = await web3.eth.getBalance(blockRewardContract.address) - console.log('balanceBlockRewardContract', balanceBlockRewardContract.toString()) const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; const {logs} = await homeBridge.executeAffirmation(recipient, value, transactionHash, {from: authorities[0]}) @@ -195,15 +214,164 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { value, transactionHash }) - const homeBalanceAfter = await web3.eth.getBalance(homeBridge.address) const balanceAfter = await web3.eth.getBalance(recipient) balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) - homeBalanceAfter.should.be.bignumber.equal(0) const msgHash = Web3Utils.soliditySha3(recipient, value, transactionHash); const senderHash = Web3Utils.soliditySha3(authorities[0], msgHash) true.should.be.equal(await homeBridge.affirmationsSigned(senderHash)) }) + + it('test with 2 signatures required', async () => { + const validatorContractWith2Signatures = await BridgeValidators.new() + const authoritiesTwoAccs = [accounts[1], accounts[2], accounts[3]]; + const ownerOfValidators = accounts[0] + await validatorContractWith2Signatures.initialize(2, authoritiesTwoAccs, ownerOfValidators) + const homeBridgeWithTwoSigs = await HomeBridge.new(); + await homeBridgeWithTwoSigs.initialize(validatorContractWith2Signatures.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, blockRewardContract.address); + const recipient = accounts[5]; + const value = halfEther; + const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; + const balanceBefore = await web3.eth.getBalance(recipient) + const msgHash = Web3Utils.soliditySha3(recipient, value, transactionHash); + + const { logs } = await homeBridgeWithTwoSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesTwoAccs[0]}).should.be.fulfilled; + logs[0].event.should.be.equal("SignedForAffirmation"); + logs[0].args.should.be.deep.equal({ signer: authorities[0], transactionHash }); + const notProcessed = await homeBridgeWithTwoSigs.numAffirmationsSigned(msgHash); + notProcessed.should.be.bignumber.equal(1); + + await homeBridgeWithTwoSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesTwoAccs[0]}).should.be.rejectedWith(ERROR_MSG); + const secondSignature = await homeBridgeWithTwoSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesTwoAccs[1]}).should.be.fulfilled; + + const balanceAfter = await web3.eth.getBalance(recipient) + balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) + + secondSignature.logs[1].event.should.be.equal("AffirmationCompleted"); + secondSignature.logs[1].args.should.be.deep.equal({ recipient, value, transactionHash }) + + const senderHash = Web3Utils.soliditySha3(authoritiesTwoAccs[0], msgHash) + true.should.be.equal(await homeBridgeWithTwoSigs.affirmationsSigned(senderHash)) + + const senderHash2 = Web3Utils.soliditySha3(authoritiesTwoAccs[1], msgHash); + true.should.be.equal(await homeBridgeWithTwoSigs.affirmationsSigned(senderHash2)) + + const markedAsProcessed = await homeBridgeWithTwoSigs.numAffirmationsSigned(msgHash); + const processed = new web3.BigNumber(2).pow(255).add(2); + markedAsProcessed.should.be.bignumber.equal(processed) + }) + + it('should not allow non-validator to execute affirmation', async () => { + const recipient = accounts[5]; + const value = oneEther; + const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; + await homeBridge.executeAffirmation(recipient, value, transactionHash, {from: accounts[7]}).should.be.rejectedWith(ERROR_MSG); + }) }) + describe('#submitSignature', async () => { + let validatorContractWith2Signatures,authoritiesTwoAccs,ownerOfValidators,homeBridgeWithTwoSigs + beforeEach(async () => { + validatorContractWith2Signatures = await BridgeValidators.new() + authoritiesTwoAccs = [accounts[1], accounts[2], accounts[3]]; + ownerOfValidators = accounts[0] + await validatorContractWith2Signatures.initialize(2, authoritiesTwoAccs, ownerOfValidators) + homeBridgeWithTwoSigs = await HomeBridge.new(); + await homeBridgeWithTwoSigs.initialize(validatorContractWith2Signatures.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, blockRewardContract.address); + }) + + it('allows a validator to submit a signature', async () => { + const recipientAccount = accounts[8] + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80"; + const message = createMessage(recipientAccount, value, transactionHash, homeBridgeWithTwoSigs.address); + + const signature = await sign(authoritiesTwoAccs[0], message) + const { logs } = await homeBridgeWithTwoSigs.submitSignature(signature, message, {from: authorities[0]}).should.be.fulfilled; + + logs[0].event.should.be.equal('SignedForUserRequest') + const { messageHash } = logs[0].args + const signatureFromContract = await homeBridgeWithTwoSigs.signature(messageHash, 0); + const messageFromContract = await homeBridgeWithTwoSigs.message(messageHash); + signature.should.be.equal(signatureFromContract); + messageFromContract.should.be.equal(messageFromContract); + const hashMsg = Web3Utils.soliditySha3(message); + const hashSenderMsg = Web3Utils.soliditySha3(authorities[0], hashMsg) + true.should.be.equal(await homeBridgeWithTwoSigs.messagesSigned(hashSenderMsg)); + }) + + it('when enough requiredSignatures are collected, CollectedSignatures event is emitted', async () => { + const recipientAccount = accounts[8] + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80"; + const message = createMessage(recipientAccount, value, transactionHash, homeBridgeWithTwoSigs.address); + + const signature = await sign(authoritiesTwoAccs[0], message) + const signature2 = await sign(authoritiesTwoAccs[1], message) + '2'.should.be.bignumber.equal(await validatorContractWith2Signatures.requiredSignatures()); + + await homeBridgeWithTwoSigs.submitSignature(signature, message, {from: authoritiesTwoAccs[0]}).should.be.fulfilled; + await homeBridgeWithTwoSigs.submitSignature(signature, message, {from: authoritiesTwoAccs[0]}).should.be.rejectedWith(ERROR_MSG); + await homeBridgeWithTwoSigs.submitSignature(signature, message, {from: authoritiesTwoAccs[1]}).should.be.rejectedWith(ERROR_MSG); + const { logs } = await homeBridgeWithTwoSigs.submitSignature(signature2, message, {from: authoritiesTwoAccs[1]}).should.be.fulfilled; + + logs.length.should.be.equal(2) + logs[1].event.should.be.equal('CollectedSignatures') + logs[1].args.authorityResponsibleForRelay.should.be.equal(authoritiesTwoAccs[1]) + }) + + it('attack when increasing requiredSignatures', async () => { + const recipientAccount = accounts[8] + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80"; + const message = createMessage(recipientAccount, value, transactionHash, homeBridgeWithTwoSigs.address); + const signature = await sign(authoritiesTwoAccs[0], message) + const signature2 = await sign(authoritiesTwoAccs[1], message) + const signature3 = await sign(authoritiesTwoAccs[2], message) + '2'.should.be.bignumber.equal(await validatorContractWith2Signatures.requiredSignatures()); + + await homeBridgeWithTwoSigs.submitSignature(signature, message, {from: authoritiesTwoAccs[0]}).should.be.fulfilled; + await homeBridgeWithTwoSigs.submitSignature(signature, message, {from: authoritiesTwoAccs[0]}).should.be.rejectedWith(ERROR_MSG); + await homeBridgeWithTwoSigs.submitSignature(signature, message, {from: authoritiesTwoAccs[1]}).should.be.rejectedWith(ERROR_MSG); + const { logs } = await homeBridgeWithTwoSigs.submitSignature(signature2, message, {from: authoritiesTwoAccs[1]}).should.be.fulfilled; + + logs.length.should.be.equal(2) + logs[1].event.should.be.equal('CollectedSignatures') + logs[1].args.authorityResponsibleForRelay.should.be.equal(authoritiesTwoAccs[1]) + + await validatorContractWith2Signatures.setRequiredSignatures(3).should.be.fulfilled; + '3'.should.be.bignumber.equal(await validatorContractWith2Signatures.requiredSignatures()); + await homeBridgeWithTwoSigs.submitSignature(signature3, message, {from: authoritiesTwoAccs[2]}).should.be.rejectedWith(ERROR_MSG); + }) + + it('attack when decreasing requiredSignatures', async () => { + const recipientAccount = accounts[8] + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80"; + const message = createMessage(recipientAccount, value, transactionHash, homeBridgeWithTwoSigs.address); + const signature = await sign(authoritiesTwoAccs[0], message) + const signature2 = await sign(authoritiesTwoAccs[1], message) + '2'.should.be.bignumber.equal(await validatorContractWith2Signatures.requiredSignatures()); + + await homeBridgeWithTwoSigs.submitSignature(signature, message, {from: authoritiesTwoAccs[0]}).should.be.fulfilled; + await validatorContractWith2Signatures.setRequiredSignatures(1).should.be.fulfilled; + '1'.should.be.bignumber.equal(await validatorContractWith2Signatures.requiredSignatures()); + const { logs } = await homeBridgeWithTwoSigs.submitSignature(signature2, message, {from: authoritiesTwoAccs[1]}).should.be.fulfilled; + + logs.length.should.be.equal(2) + logs[1].event.should.be.equal('CollectedSignatures') + logs[1].args.authorityResponsibleForRelay.should.be.equal(authoritiesTwoAccs[1]) + }) + }) + + describe('#requiredMessageLength', async () => { + beforeEach(async () => { + homeContract = await HomeBridge.new() + }) + + it('should return the required message length', async () => { + const requiredMessageLength = await homeContract.requiredMessageLength() + '104'.should.be.bignumber.equal(requiredMessageLength) + }) + }) }) From 2c7db37a6d82fb084166cc8a342408d01e3505cd Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 20 Sep 2018 11:00:25 -0300 Subject: [PATCH 05/77] Add erc20-to-native bridge mode method --- .../erc20_to_native/ForeignBridgeErcToNative.sol | 4 ++++ .../erc20_to_native/HomeBridgeErcToNative.sol | 4 ++++ test/erc_to_native/home_bridge.test.js | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol index 1aca7ea8c..a2a648612 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol @@ -27,6 +27,10 @@ contract ForeignBridgeErcToNative is BasicBridge, BasicForeignBridge { return isInitialized(); } + function getBridgeMode() public pure returns(bytes4 _data) { + return bytes4(keccak256(abi.encodePacked("erc-to-native-core"))); + } + function claimTokens(address _token, address _to) public onlyOwner { require(_token != address(erc20token())); super.claimTokens(_token, _to); diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index e86cbd81f..3483ba55e 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -50,6 +50,10 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { return isInitialized(); } + function getBridgeMode() public pure returns(bytes4 _data) { + return bytes4(keccak256(abi.encodePacked("erc-to-native-core"))); + } + function blockRewardContract() public view returns(IBlockReward) { return IBlockReward(addressStorage[keccak256(abi.encodePacked("blockRewardContract"))]); } diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 0b5d6310e..b847eb820 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -42,6 +42,13 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { '3'.should.be.bignumber.equal(await homeContract.dailyLimit()) '2'.should.be.bignumber.equal(await homeContract.maxPerTx()) '1'.should.be.bignumber.equal(await homeContract.minPerTx()) + const bridgeMode = '0x18762d46' // 4 bytes of keccak256('erc-to-native-core') + const mode = await homeContract.getBridgeMode(); + mode.should.be.equal(bridgeMode) + const [major, minor, patch] = await homeContract.getBridgeInterfacesVersion() + major.should.be.bignumber.gte(0) + minor.should.be.bignumber.gte(0) + patch.should.be.bignumber.gte(0) }) it('cant set maxPerTx > dailyLimit', async () => { false.should.be.equal(await homeContract.isInitialized()) From 622e3fc6ed06bba9b96634e10f8e1f9c3ff5c51d Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 20 Sep 2018 16:04:29 -0300 Subject: [PATCH 06/77] Add foreign erc20-to-native tests --- test/erc_to_native/foreign_bridge.test.js | 261 ++++++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 test/erc_to_native/foreign_bridge.test.js diff --git a/test/erc_to_native/foreign_bridge.test.js b/test/erc_to_native/foreign_bridge.test.js new file mode 100644 index 000000000..5505ba38f --- /dev/null +++ b/test/erc_to_native/foreign_bridge.test.js @@ -0,0 +1,261 @@ +const ForeignBridge = artifacts.require("ForeignBridgeErcToNative.sol"); +const ForeignBridgeV2 = artifacts.require("ForeignBridgeV2.sol"); +const BridgeValidators = artifacts.require("BridgeValidators.sol"); +const EternalStorageProxy = artifacts.require("EternalStorageProxy.sol"); + +const ERC677BridgeToken = artifacts.require("ERC677BridgeToken.sol"); +const { ERROR_MSG, ZERO_ADDRESS } = require('../setup'); +const { createMessage, sign, signatureToVRS } = require('../helpers/helpers'); +const halfEther = web3.toBigNumber(web3.toWei(0.5, "ether")); +const requireBlockConfirmations = 8; + +contract('ForeignBridge_ERC20_to_Native', async (accounts) => { + let validatorContract, authorities, owner, token; + before(async () => { + validatorContract = await BridgeValidators.new() + authorities = [accounts[1], accounts[2]]; + owner = accounts[0] + await validatorContract.initialize(1, authorities, owner) + }) + + describe('#initialize', async () => { + it('should initialize', async () => { + token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); + let foreignBridge = await ForeignBridge.new(); + + ZERO_ADDRESS.should.be.equal(await foreignBridge.erc20token()); + ZERO_ADDRESS.should.be.equal(await foreignBridge.validatorContract()) + '0'.should.be.bignumber.equal(await foreignBridge.deployedAtBlock()) + false.should.be.equal(await foreignBridge.isInitialized()) + '0'.should.be.bignumber.equal(await foreignBridge.requiredBlockConfirmations()) + + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations); + + token.address.should.be.equal(await foreignBridge.erc20token()); + true.should.be.equal(await foreignBridge.isInitialized()) + validatorContract.address.should.be.equal(await foreignBridge.validatorContract()); + token.address.should.be.equal(await foreignBridge.erc20token()); + (await foreignBridge.deployedAtBlock()).should.be.bignumber.above(0); + requireBlockConfirmations.should.be.bignumber.equal(await foreignBridge.requiredBlockConfirmations()) + const bridgeMode = '0x18762d46' // 4 bytes of keccak256('erc-to-erc-core') + const mode = await foreignBridge.getBridgeMode(); + mode.should.be.equal(bridgeMode) + const [major, minor, patch] = await foreignBridge.getBridgeInterfacesVersion() + major.should.be.bignumber.gte(0) + minor.should.be.bignumber.gte(0) + patch.should.be.bignumber.gte(0) + }) + }) + + describe('#executeSignatures', async () => { + const value = web3.toBigNumber(web3.toWei(0.25, "ether")); + let foreignBridge + beforeEach(async () => { + foreignBridge = await ForeignBridge.new() + token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations); + await token.mint(foreignBridge.address,value); + }) + + it('should allow to executeSignatures', async () => { + const recipientAccount = accounts[3]; + const balanceBefore = await token.balanceOf(recipientAccount) + + const transactionHash = "0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80"; + const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address); + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature); + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + + const { logs } = await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + + logs[0].event.should.be.equal("RelayedMessage") + logs[0].args.recipient.should.be.equal(recipientAccount) + logs[0].args.value.should.be.bignumber.equal(value) + const balanceAfter = await token.balanceOf(recipientAccount); + const balanceAfterBridge = await token.balanceOf(foreignBridge.address); + balanceAfter.should.be.bignumber.equal(balanceBefore.add(value)) + balanceAfterBridge.should.be.bignumber.equal(0) + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + }) + + it('should allow second withdrawal with different transactionHash but same recipient and value', async ()=> { + const recipientAccount = accounts[3]; + const balanceBefore = await token.balanceOf(recipientAccount) + + // tx 1 + const value = web3.toBigNumber(web3.toWei(0.25, "ether")); + const transactionHash = "0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121"; + const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address); + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature); + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + + // tx 2 + await token.mint(foreignBridge.address,value); + var transactionHash2 = "0x77a496628a776a03d58d7e6059a5937f04bebd8ba4ff89f76dd4bb8ba7e291ee"; + var message2 = createMessage(recipientAccount, value, transactionHash2, foreignBridge.address); + var signature2 = await sign(authorities[0], message2) + var vrs2 = signatureToVRS(signature2); + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash2)) + + const {logs} = await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.fulfilled + + logs[0].event.should.be.equal("RelayedMessage") + logs[0].args.recipient.should.be.equal(recipientAccount) + logs[0].args.value.should.be.bignumber.equal(value) + const balanceAfter = await token.balanceOf(recipientAccount) + balanceAfter.should.be.bignumber.equal(balanceBefore.add(value.mul(2))) + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash2)) + }) + + it('should not allow second withdraw (replay attack) with same transactionHash but different recipient', async () => { + const recipientAccount = accounts[3]; + + // tx 1 + const transactionHash = "0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121"; + const message = createMessage(recipientAccount, value, transactionHash, foreignBridge.address); + const signature = await sign(authorities[0], message) + const vrs = signatureToVRS(signature); + false.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + + await foreignBridge.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.fulfilled + + // tx 2 + await token.mint(foreignBridge.address,value); + const message2 = createMessage(accounts[4], value, transactionHash, foreignBridge.address); + const signature2 = await sign(authorities[0], message2) + const vrs2 = signatureToVRS(signature2); + true.should.be.equal(await foreignBridge.relayedMessages(transactionHash)) + + await foreignBridge.executeSignatures([vrs2.v], [vrs2.r], [vrs2.s], message2).should.be.rejectedWith(ERROR_MSG) + }) + }) + + describe('#withdraw with 2 minimum signatures', async () => { + let multisigValidatorContract, twoAuthorities, ownerOfValidatorContract, foreignBridgeWithMultiSignatures + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + beforeEach(async () => { + multisigValidatorContract = await BridgeValidators.new() + token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); + twoAuthorities = [accounts[0], accounts[1]]; + ownerOfValidatorContract = accounts[3] + await multisigValidatorContract.initialize(2, twoAuthorities, ownerOfValidatorContract, {from: ownerOfValidatorContract}) + foreignBridgeWithMultiSignatures = await ForeignBridge.new() + await foreignBridgeWithMultiSignatures.initialize(multisigValidatorContract.address, token.address, requireBlockConfirmations, {from: ownerOfValidatorContract}); + await token.mint(foreignBridgeWithMultiSignatures.address,value); + }) + + it('withdraw should fail if not enough signatures are provided', async () => { + const recipientAccount = accounts[4]; + + // msg 1 + const transactionHash = "0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121"; + const message = createMessage(recipientAccount, value, transactionHash, foreignBridgeWithMultiSignatures.address); + const signature = await sign(twoAuthorities[0], message) + const vrs = signatureToVRS(signature); + false.should.be.equal(await foreignBridgeWithMultiSignatures.relayedMessages(transactionHash)) + + await foreignBridgeWithMultiSignatures.executeSignatures([vrs.v], [vrs.r], [vrs.s], message).should.be.rejectedWith(ERROR_MSG) + + // msg 2 + const signature2 = await sign(twoAuthorities[1], message) + const vrs2 = signatureToVRS(signature2); + + const {logs} = await foreignBridgeWithMultiSignatures.executeSignatures([vrs.v, vrs2.v], [vrs.r, vrs2.r], [vrs.s, vrs2.s], message).should.be.fulfilled; + + logs[0].event.should.be.equal("RelayedMessage") + logs[0].args.recipient.should.be.equal(recipientAccount) + logs[0].args.value.should.be.bignumber.equal(value) + true.should.be.equal(await foreignBridgeWithMultiSignatures.relayedMessages(transactionHash)) + }) + + it('withdraw should fail if duplicate signature is provided', async () => { + const recipientAccount = accounts[4]; + const transactionHash = "0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121"; + const message = createMessage(recipientAccount, value, transactionHash, foreignBridgeWithMultiSignatures.address); + const signature = await sign(twoAuthorities[0], message) + const vrs = signatureToVRS(signature); + false.should.be.equal(await foreignBridgeWithMultiSignatures.relayedMessages(transactionHash)) + + await foreignBridgeWithMultiSignatures.executeSignatures([vrs.v, vrs.v], [vrs.r, vrs.r], [vrs.s, vrs.s], message).should.be.rejectedWith(ERROR_MSG) + }) + }) + + describe('#upgradeable', async () => { + it('can be upgraded', async () => { + const REQUIRED_NUMBER_OF_VALIDATORS = 1 + const VALIDATORS = [accounts[1]] + const PROXY_OWNER = accounts[0] + // Validators Contract + let validatorsProxy = await EternalStorageProxy.new().should.be.fulfilled; + const validatorsContractImpl = await BridgeValidators.new().should.be.fulfilled; + await validatorsProxy.upgradeTo('1', validatorsContractImpl.address).should.be.fulfilled; + validatorsContractImpl.address.should.be.equal(await validatorsProxy.implementation()) + + validatorsProxy = await BridgeValidators.at(validatorsProxy.address); + await validatorsProxy.initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, PROXY_OWNER).should.be.fulfilled; + let token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); + + // ForeignBridge V1 Contract + + let foreignBridgeProxy = await EternalStorageProxy.new().should.be.fulfilled; + const foreignBridgeImpl = await ForeignBridge.new().should.be.fulfilled; + await foreignBridgeProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled; + + foreignBridgeProxy = await ForeignBridge.at(foreignBridgeProxy.address); + await foreignBridgeProxy.initialize(validatorsProxy.address, token.address, requireBlockConfirmations) + + // Deploy V2 + let foreignImplV2 = await ForeignBridgeV2.new(); + let foreignBridgeProxyUpgrade = await EternalStorageProxy.at(foreignBridgeProxy.address); + await foreignBridgeProxyUpgrade.upgradeTo('2', foreignImplV2.address).should.be.fulfilled; + foreignImplV2.address.should.be.equal(await foreignBridgeProxyUpgrade.implementation()) + + let foreignBridgeV2Proxy = await ForeignBridgeV2.at(foreignBridgeProxy.address) + await foreignBridgeV2Proxy.doSomething(accounts[2], {from: accounts[4]}).should.be.rejectedWith(ERROR_MSG) + await foreignBridgeV2Proxy.doSomething(accounts[2], {from: PROXY_OWNER}).should.be.fulfilled; + (await foreignBridgeV2Proxy.something()).should.be.equal(accounts[2]) + }) + + it('can be deployed via upgradeToAndCall', async () => { + const fakeTokenAddress = accounts[7] + const fakeValidatorsAddress = accounts[6] + + const storageProxy = await EternalStorageProxy.new().should.be.fulfilled; + const foreignBridge = await ForeignBridge.new(); + const data = foreignBridge.initialize.request(fakeValidatorsAddress, fakeTokenAddress, requireBlockConfirmations).params[0].data + + await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; + + let finalContract = await ForeignBridge.at(storageProxy.address); + true.should.be.equal(await finalContract.isInitialized()); + fakeValidatorsAddress.should.be.equal(await finalContract.validatorContract()) + }) + }) + + describe('#claimTokens', async () => { + it('can send erc20', async () => { + const owner = accounts[0]; + token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); + const foreignBridge = await ForeignBridge.new(); + + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations); + const tokenSecond = await ERC677BridgeToken.new("Roman Token", "RST", 18); + + await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled; + halfEther.should.be.bignumber.equal(await tokenSecond.balanceOf(accounts[0])) + + await tokenSecond.transfer(foreignBridge.address, halfEther); + '0'.should.be.bignumber.equal(await tokenSecond.balanceOf(accounts[0])) + halfEther.should.be.bignumber.equal(await tokenSecond.balanceOf(foreignBridge.address)) + + await foreignBridge.claimTokens(tokenSecond.address, accounts[3], {from: owner}); + '0'.should.be.bignumber.equal(await tokenSecond.balanceOf(foreignBridge.address)) + halfEther.should.be.bignumber.equal(await tokenSecond.balanceOf(accounts[3])) + }) + }) +}) From 203d8763cba7f355b6fa25628e8b86f498e7fecc Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Thu, 20 Sep 2018 13:37:16 -0300 Subject: [PATCH 07/77] Add eslint and prettier --- deploy/.eslintrc | 28 + deploy/.nvmrc | 1 + deploy/.prettierrc | 5 + deploy/deploy.js | 105 +- deploy/package-lock.json | 1936 ++++++++++++++++++++------- deploy/package.json | 13 +- deploy/src/deploymentUtils.js | 88 +- deploy/src/erc_to_erc/foreign.js | 151 ++- deploy/src/erc_to_erc/home.js | 163 ++- deploy/src/native_to_erc/foreign.js | 192 ++- deploy/src/native_to_erc/home.js | 135 +- deploy/src/web3.js | 32 +- 12 files changed, 2007 insertions(+), 842 deletions(-) create mode 100644 deploy/.eslintrc create mode 100644 deploy/.nvmrc create mode 100644 deploy/.prettierrc diff --git a/deploy/.eslintrc b/deploy/.eslintrc new file mode 100644 index 000000000..e4796828f --- /dev/null +++ b/deploy/.eslintrc @@ -0,0 +1,28 @@ +{ + "extends": [ + "plugin:node/recommended", + "airbnb-base", + "plugin:prettier/recommended" + ], + "plugins": ["node"], + "rules": { + "no-var": "error", + /* "arrow-body-style": "off", */ + /* "func-names": "off", */ + /* "no-await-in-loop": "off", */ + "consistent-return": "off", + "global-require": "off", + "no-console": "off", + /* "no-param-reassign": "off", */ + "no-plusplus": "off", + /* "no-restricted-syntax": "off", */ + /* "no-shadow": "off", */ + "no-use-before-define": ["error", { "functions": false }], + /* "import/no-dynamic-require": "off" */ + "import/no-extraneous-dependencies": "off", + "node/no-extraneous-require": ["error", { + "allowModules": ["web3-utils"] + }], + "node/no-unpublished-require": "off", + } +} diff --git a/deploy/.nvmrc b/deploy/.nvmrc new file mode 100644 index 000000000..fa97ecedc --- /dev/null +++ b/deploy/.nvmrc @@ -0,0 +1 @@ +8.9 diff --git a/deploy/.prettierrc b/deploy/.prettierrc new file mode 100644 index 000000000..75a894a27 --- /dev/null +++ b/deploy/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "printWidth": 100 +} diff --git a/deploy/deploy.js b/deploy/deploy.js index 7ef59c4ea..42108fd8a 100644 --- a/deploy/deploy.js +++ b/deploy/deploy.js @@ -1,66 +1,93 @@ -const fs = require('fs'); +const fs = require('fs') const path = require('path') require('dotenv').config({ path: path.join(__dirname, '.env') -}); +}) const deployResultsPath = path.join(__dirname, './bridgeDeploymentResults.json') -async function deployNativeToErc(){ - const deployHome = require('./src/native_to_erc/home'); - const deployForeign = require('./src/native_to_erc/foreign'); +async function deployNativeToErc() { + const deployHome = require('./src/native_to_erc/home') + const deployForeign = require('./src/native_to_erc/foreign') const homeBridge = await deployHome() - const {foreignBridge, erc677} = await deployForeign(); - console.log("\nDeployment has been completed.\n\n") - console.log(`[ Home ] HomeBridge: ${homeBridge.address} at block ${homeBridge.deployedBlockNumber}`) - console.log(`[ Foreign ] ForeignBridge: ${foreignBridge.address} at block ${foreignBridge.deployedBlockNumber}`) + const { foreignBridge, erc677 } = await deployForeign() + console.log('\nDeployment has been completed.\n\n') + console.log( + `[ Home ] HomeBridge: ${homeBridge.address} at block ${homeBridge.deployedBlockNumber}` + ) + console.log( + `[ Foreign ] ForeignBridge: ${foreignBridge.address} at block ${ + foreignBridge.deployedBlockNumber + }` + ) console.log(`[ Foreign ] POA20: ${erc677.address}`) - fs.writeFileSync(deployResultsPath, JSON.stringify({ - homeBridge: { - ...homeBridge, - },foreignBridge: { - ...foreignBridge, - },erc677 - },null,4)); + fs.writeFileSync( + deployResultsPath, + JSON.stringify( + { + homeBridge: { + ...homeBridge + }, + foreignBridge: { + ...foreignBridge + }, + erc677 + }, + null, + 4 + ) + ) console.log('Contracts Deployment have been saved to `bridgeDeploymentResults.json`') } async function deployErcToErc() { - const deployHome = require('./src/erc_to_erc/home'); - const deployForeign = require('./src/erc_to_erc/foreign'); + const deployHome = require('./src/erc_to_erc/home') + const deployForeign = require('./src/erc_to_erc/foreign') - const {homeBridgeAddress, erc677tokenAddress, deployedBlockNumber} = await deployHome() - const {foreignBridge} = await deployForeign(); - console.log("\nDeployment has been completed.\n\n") + const { homeBridgeAddress, erc677tokenAddress, deployedBlockNumber } = await deployHome() + const { foreignBridge } = await deployForeign() + console.log('\nDeployment has been completed.\n\n') console.log(`[ Home ] HomeBridge: ${homeBridgeAddress} at block ${deployedBlockNumber}`) - console.log(`[ Foreign ] ForeignBridge: ${foreignBridge.address} at block ${foreignBridge.deployedBlockNumber}`) + console.log( + `[ Foreign ] ForeignBridge: ${foreignBridge.address} at block ${ + foreignBridge.deployedBlockNumber + }` + ) console.log(`[ Foreign ] ERC20 Token: ${process.env.ERC20_TOKEN_ADDRESS}`) console.log(`[ Home ] ERC677 Bridgeble Token: ${erc677tokenAddress}`) - fs.writeFileSync(deployResultsPath, JSON.stringify({ - homeBridge: { - homeBridgeAddress, - erc677tokenAddress - },foreignBridge: { - ...foreignBridge, - } - },null,4)); + fs.writeFileSync( + deployResultsPath, + JSON.stringify( + { + homeBridge: { + homeBridgeAddress, + erc677tokenAddress + }, + foreignBridge: { + ...foreignBridge + } + }, + null, + 4 + ) + ) console.log('Contracts Deployment have been saved to `bridgeDeploymentResults.json`') } async function main() { - const BRIDGE_MODE = process.env.BRIDGE_MODE; + const { BRIDGE_MODE } = process.env console.log(`Bridge mode: ${BRIDGE_MODE}`) - switch(BRIDGE_MODE) { - case "NATIVE_TO_ERC": - await deployNativeToErc(); - break; - case "ERC_TO_ERC": - await deployErcToErc(); - break; + switch (BRIDGE_MODE) { + case 'NATIVE_TO_ERC': + await deployNativeToErc() + break + case 'ERC_TO_ERC': + await deployErcToErc() + break default: console.log(BRIDGE_MODE) - throw "Please specify BRIDGE_MODE: NATIVE_TO_ERC or ERC_TO_ERC" + throw new Error('Please specify BRIDGE_MODE: NATIVE_TO_ERC or ERC_TO_ERC') } } diff --git a/deploy/package-lock.json b/deploy/package-lock.json index 3d8430efd..01d7b921a 100644 --- a/deploy/package-lock.json +++ b/deploy/package-lock.json @@ -4,12 +4,32 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, "accepts": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "requires": { - "mime-types": "2.1.18", + "mime-types": "~2.1.18", "negotiator": "0.6.1" } }, @@ -18,12 +38,21 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==" }, + "acorn-jsx": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz", + "integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==", + "dev": true, + "requires": { + "acorn": "^5.0.3" + } + }, "acorn-object-rest-spread": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/acorn-object-rest-spread/-/acorn-object-rest-spread-1.1.0.tgz", "integrity": "sha1-eGma790Y7DGCyq2t9S4ml8BI9HY=", "requires": { - "acorn": "5.5.3" + "acorn": "^5.0.3" } }, "ajv": { @@ -31,24 +60,42 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "optional": true }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { - "color-convert": "1.9.1" + "color-convert": "^1.9.0" } }, "any-promise": { @@ -56,6 +103,15 @@ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -66,7 +122,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -74,6 +130,12 @@ "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "asn1": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", @@ -84,9 +146,9 @@ "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "requires": { - "bn.js": "4.11.8", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "assert-plus": { @@ -119,8 +181,8 @@ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.25.0.tgz", "integrity": "sha1-M7mOql1IK7AajRqmtDetKwGuxBw=", "requires": { - "core-js": "2.5.4", - "regenerator-runtime": "0.10.5" + "core-js": "^2.4.0", + "regenerator-runtime": "^0.10.0" } }, "balanced-match": { @@ -139,7 +201,7 @@ "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "bindings": { @@ -152,7 +214,7 @@ "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.0.1" } }, "bl": { @@ -160,8 +222,8 @@ "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "requires": { - "readable-stream": "2.3.5", - "safe-buffer": "5.1.1" + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" } }, "block-stream": { @@ -169,7 +231,7 @@ "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "requires": { - "inherits": "2.0.3" + "inherits": "~2.0.0" } }, "bluebird": { @@ -188,15 +250,15 @@ "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", "requires": { "bytes": "3.0.0", - "content-type": "1.0.4", + "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "1.1.2", - "http-errors": "1.6.2", + "depd": "~1.1.1", + "http-errors": "~1.6.2", "iconv-lite": "0.4.19", - "on-finished": "2.3.0", + "on-finished": "~2.3.0", "qs": "6.5.1", "raw-body": "2.3.2", - "type-is": "1.6.16" + "type-is": "~1.6.15" } }, "boom": { @@ -204,7 +266,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } }, "brace-expansion": { @@ -212,7 +274,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -226,12 +288,12 @@ "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", "requires": { - "buffer-xor": "1.0.3", - "cipher-base": "1.0.4", - "create-hash": "1.1.3", - "evp_bytestokey": "1.0.3", - "inherits": "2.0.3", - "safe-buffer": "5.1.1" + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "browserify-cipher": { @@ -239,9 +301,9 @@ "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", "requires": { - "browserify-aes": "1.1.1", - "browserify-des": "1.0.0", - "evp_bytestokey": "1.0.3" + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" } }, "browserify-des": { @@ -249,9 +311,9 @@ "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", "requires": { - "cipher-base": "1.0.4", - "des.js": "1.0.0", - "inherits": "2.0.3" + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1" } }, "browserify-rsa": { @@ -259,8 +321,8 @@ "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "requires": { - "bn.js": "4.11.8", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" } }, "browserify-sha3": { @@ -268,7 +330,7 @@ "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.1.tgz", "integrity": "sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE=", "requires": { - "js-sha3": "0.3.1" + "js-sha3": "^0.3.1" } }, "browserify-sign": { @@ -276,13 +338,13 @@ "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "elliptic": "6.4.0", - "inherits": "2.0.3", - "parse-asn1": "5.1.0" + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" } }, "buffer": { @@ -290,8 +352,8 @@ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.1.0.tgz", "integrity": "sha512-YkIRgwsZwJWTnyQrsBTWefizHh+8GYj3kbL1BTiAQ/9pwpino0G7B2gp5tx/FUBqUlvtxV85KNR3mwfAtv15Yw==", "requires": { - "base64-js": "1.2.3", - "ieee754": "1.1.11" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" } }, "buffer-crc32": { @@ -319,6 +381,21 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -329,20 +406,47 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "ansi-styles": "^3.1.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^4.0.0" } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -353,7 +457,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "requires": { - "color-name": "1.1.3" + "color-name": "^1.1.1" } }, "color-name": { @@ -366,7 +470,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "commander": { @@ -374,7 +478,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "requires": { - "graceful-readlink": "1.0.1" + "graceful-readlink": ">= 1.0.0" } }, "concat-map": { @@ -417,8 +521,8 @@ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", "requires": { - "object-assign": "4.1.1", - "vary": "1.1.2" + "object-assign": "^4", + "vary": "^1" } }, "create-ecdh": { @@ -426,8 +530,8 @@ "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.0" + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" } }, "create-hash": { @@ -435,10 +539,10 @@ "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", "requires": { - "cipher-base": "1.0.4", - "inherits": "2.0.3", - "ripemd160": "2.0.1", - "sha.js": "2.4.11" + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "sha.js": "^2.4.0" } }, "create-hmac": { @@ -446,12 +550,33 @@ "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", "requires": { - "cipher-base": "1.0.4", - "create-hash": "1.1.3", - "inherits": "2.0.3", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.11" + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "dev": true + } } }, "cryptiles": { @@ -459,7 +584,7 @@ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", "requires": { - "boom": "5.2.0" + "boom": "5.x.x" }, "dependencies": { "boom": { @@ -467,7 +592,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } } } @@ -477,17 +602,17 @@ "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "requires": { - "browserify-cipher": "1.0.0", - "browserify-sign": "4.0.4", - "create-ecdh": "4.0.0", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "diffie-hellman": "5.0.2", - "inherits": "2.0.3", - "pbkdf2": "3.0.14", - "public-encrypt": "4.0.0", - "randombytes": "2.0.6", - "randomfill": "1.0.4" + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" } }, "dashdash": { @@ -495,7 +620,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "debug": { @@ -516,14 +641,14 @@ "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz", "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", "requires": { - "decompress-tar": "4.1.1", - "decompress-tarbz2": "4.1.1", - "decompress-targz": "4.1.1", - "decompress-unzip": "4.0.1", - "graceful-fs": "4.1.11", - "make-dir": "1.2.0", - "pify": "2.3.0", - "strip-dirs": "2.1.0" + "decompress-tar": "^4.0.0", + "decompress-tarbz2": "^4.0.0", + "decompress-targz": "^4.0.0", + "decompress-unzip": "^4.0.1", + "graceful-fs": "^4.1.10", + "make-dir": "^1.0.0", + "pify": "^2.3.0", + "strip-dirs": "^2.0.0" } }, "decompress-response": { @@ -531,7 +656,7 @@ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "requires": { - "mimic-response": "1.0.0" + "mimic-response": "^1.0.0" } }, "decompress-tar": { @@ -539,9 +664,9 @@ "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "requires": { - "file-type": "5.2.0", - "is-stream": "1.1.0", - "tar-stream": "1.5.5" + "file-type": "^5.2.0", + "is-stream": "^1.1.0", + "tar-stream": "^1.5.2" } }, "decompress-tarbz2": { @@ -549,11 +674,11 @@ "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", "requires": { - "decompress-tar": "4.1.1", - "file-type": "6.2.0", - "is-stream": "1.1.0", - "seek-bzip": "1.0.5", - "unbzip2-stream": "1.2.5" + "decompress-tar": "^4.1.0", + "file-type": "^6.1.0", + "is-stream": "^1.1.0", + "seek-bzip": "^1.0.5", + "unbzip2-stream": "^1.0.9" }, "dependencies": { "file-type": { @@ -568,9 +693,9 @@ "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", "requires": { - "decompress-tar": "4.1.1", - "file-type": "5.2.0", - "is-stream": "1.1.0" + "decompress-tar": "^4.1.1", + "file-type": "^5.2.0", + "is-stream": "^1.1.0" } }, "decompress-unzip": { @@ -578,10 +703,10 @@ "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", "requires": { - "file-type": "3.9.0", - "get-stream": "2.3.1", - "pify": "2.3.0", - "yauzl": "2.9.1" + "file-type": "^3.8.0", + "get-stream": "^2.2.0", + "pify": "^2.3.0", + "yauzl": "^2.4.2" }, "dependencies": { "file-type": { @@ -594,8 +719,8 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", "requires": { - "object-assign": "4.1.1", - "pinkie-promise": "2.0.1" + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" } } } @@ -605,6 +730,46 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + }, + "dependencies": { + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + } + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -620,8 +785,8 @@ "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "destroy": { @@ -634,9 +799,18 @@ "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", "requires": { - "bn.js": "4.11.8", - "miller-rabin": "4.0.1", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" } }, "dom-walk": { @@ -654,9 +828,9 @@ "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", "requires": { - "browserify-aes": "1.1.1", - "create-hash": "1.1.3", - "create-hmac": "1.1.6" + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" } }, "duplexer3": { @@ -670,7 +844,7 @@ "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0" } }, "ee-first": { @@ -683,13 +857,13 @@ "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0", - "hash.js": "1.1.3", - "hmac-drbg": "1.0.1", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0", - "minimalistic-crypto-utils": "1.0.1" + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" } }, "encodeurl": { @@ -702,7 +876,31 @@ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "requires": { - "once": "1.4.0" + "once": "^1.4.0" + } + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" } }, "escape-html": { @@ -720,11 +918,188 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.2.0" + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" + } + }, + "eslint": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.6.0.tgz", + "integrity": "sha512-/eVYs9VVVboX286mBK7bbKnO1yamUy2UCRjiY6MryhQL2PaaXCExsCQ2aO83OeYRhU2eCU/FMFP+tVMoOrzNrA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^4.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "imurmurhash": "^0.1.4", + "inquirer": "^6.1.0", + "is-resolvable": "^1.1.0", + "js-yaml": "^3.12.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^2.0.0", + "require-uncached": "^1.0.3", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^4.0.3", + "text-table": "^0.2.0" + }, + "dependencies": { + "ajv": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", + "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "debug": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz", + "integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "dev": true + } + } + }, + "eslint-config-airbnb-base": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.1.0.tgz", + "integrity": "sha512-XWwQtf3U3zIoKO1BbHh6aUhJZQweOwSt4c2JrPDg9FP3Ltv3+YfEv7jIDB8275tVnO/qOHbfuYg3kzw6Je7uWw==", + "dev": true, + "requires": { + "eslint-restricted-globals": "^0.1.1", + "object.assign": "^4.1.0", + "object.entries": "^1.0.4" + } + }, + "eslint-config-prettier": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-3.0.1.tgz", + "integrity": "sha512-vA0TB8HCx/idHXfKHYcg9J98p0Q8nkfNwNAoP7e+ywUidn6ScaFS5iqncZAHPz+/a0A/tp657ulFHFx/2JDP4Q==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-plugin-prettier": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz", + "integrity": "sha512-tGek5clmW5swrAx1mdPYM8oThrBE83ePh7LeseZHBWfHVGrHPhKn7Y5zgRMbU/9D5Td9K4CEmUPjGxA7iw98Og==", + "dev": true, + "requires": { + "fast-diff": "^1.1.1", + "jest-docblock": "^21.0.0" + } + }, + "eslint-restricted-globals": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz", + "integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=", + "dev": true + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-4.0.0.tgz", + "integrity": "sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg==", + "dev": true, + "requires": { + "acorn": "^5.6.0", + "acorn-jsx": "^4.1.1" + }, + "dependencies": { + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + } } }, "esprima": { @@ -732,6 +1107,40 @@ "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, "estraverse": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", @@ -752,13 +1161,13 @@ "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.0", - "keccakjs": "0.2.1", - "nano-json-stream-parser": "0.1.2", - "servify": "0.1.12", - "ws": "3.3.3", - "xhr-request-promise": "0.1.2" + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "keccakjs": "^0.2.1", + "nano-json-stream-parser": "^0.1.2", + "servify": "^0.1.12", + "ws": "^3.0.0", + "xhr-request-promise": "^0.1.2" } }, "ethereum-common": { @@ -771,8 +1180,8 @@ "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.4.tgz", "integrity": "sha512-kOgUd5jC+0tgV7t52UDECMMz9Uf+Lro+6fSpCvzWemtXfMEcwI3EOxf5mVPMRbTFkMMhuERokNNVF3jItAjidg==", "requires": { - "ethereum-common": "0.0.18", - "ethereumjs-util": "5.1.5" + "ethereum-common": "^0.0.18", + "ethereumjs-util": "^5.0.0" } }, "ethereumjs-util": { @@ -780,13 +1189,13 @@ "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.1.5.tgz", "integrity": "sha512-xPaSEATYJpMTCGowIt0oMZwFP4R1bxd6QsWgkcDvFL0JtXsr39p32WEcD14RscCjfP41YXZPCVWA4yAg0nrJmw==", "requires": { - "bn.js": "4.11.8", - "create-hash": "1.1.3", - "ethjs-util": "0.1.4", - "keccak": "1.4.0", - "rlp": "2.0.0", - "safe-buffer": "5.1.1", - "secp256k1": "3.5.0" + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" } }, "ethjs-unit": { @@ -824,8 +1233,8 @@ "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "requires": { - "md5.js": "1.3.4", - "safe-buffer": "5.1.1" + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" } }, "expand-template": { @@ -838,36 +1247,36 @@ "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", "requires": { - "accepts": "1.3.5", + "accepts": "~1.3.5", "array-flatten": "1.1.1", "body-parser": "1.18.2", "content-disposition": "0.5.2", - "content-type": "1.0.4", + "content-type": "~1.0.4", "cookie": "0.3.1", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "1.1.2", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "finalhandler": "1.1.1", "fresh": "0.5.2", "merge-descriptors": "1.0.1", - "methods": "1.1.2", - "on-finished": "2.3.0", - "parseurl": "1.3.2", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.3", + "proxy-addr": "~2.0.3", "qs": "6.5.1", - "range-parser": "1.2.0", + "range-parser": "~1.2.0", "safe-buffer": "5.1.1", "send": "0.16.2", "serve-static": "1.13.2", "setprototypeof": "1.1.0", - "statuses": "1.4.0", - "type-is": "1.6.16", + "statuses": "~1.4.0", + "type-is": "~1.6.16", "utils-merge": "1.0.1", - "vary": "1.1.2" + "vary": "~1.1.2" }, "dependencies": { "setprototypeof": { @@ -887,6 +1296,28 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -897,6 +1328,12 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" }, + "fast-diff": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", + "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==", + "dev": true + }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", @@ -912,7 +1349,26 @@ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", "requires": { - "pend": "1.2.0" + "pend": "~1.2.0" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" } }, "file-type": { @@ -926,12 +1382,12 @@ "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "requires": { "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.4.0", - "unpipe": "1.0.0" + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" }, "dependencies": { "statuses": { @@ -941,12 +1397,24 @@ } } }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" + } + }, "for-each": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", "requires": { - "is-function": "1.0.1" + "is-function": "~1.0.0" } }, "forever-agent": { @@ -959,9 +1427,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { - "asynckit": "0.4.0", + "asynckit": "^0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.18" + "mime-types": "^2.1.12" } }, "forwarded": { @@ -979,8 +1447,8 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0" } }, "fs-promise": { @@ -988,10 +1456,10 @@ "resolved": "https://registry.npmjs.org/fs-promise/-/fs-promise-2.0.3.tgz", "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", "requires": { - "any-promise": "1.3.0", - "fs-extra": "2.1.2", - "mz": "2.7.0", - "thenify-all": "1.6.0" + "any-promise": "^1.3.0", + "fs-extra": "^2.0.0", + "mz": "^2.6.0", + "thenify-all": "^1.6.0" } }, "fs.realpath": { @@ -1004,12 +1472,30 @@ "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.2" + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" } }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -1020,7 +1506,7 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "glob": { @@ -1028,12 +1514,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "global": { @@ -1041,20 +1527,26 @@ "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", "requires": { - "min-document": "2.19.0", - "process": "0.5.2" + "min-document": "^2.19.0", + "process": "~0.5.1" } }, + "globals": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "dev": true + }, "globby": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "requires": { - "array-union": "1.0.2", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "got": { @@ -1062,20 +1554,20 @@ "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", "requires": { - "decompress-response": "3.3.0", - "duplexer3": "0.1.4", - "get-stream": "3.0.0", - "is-plain-obj": "1.1.0", - "is-retry-allowed": "1.1.0", - "is-stream": "1.1.0", - "isurl": "1.0.0", - "lowercase-keys": "1.0.1", - "p-cancelable": "0.3.0", - "p-timeout": "1.2.1", - "safe-buffer": "5.1.1", - "timed-out": "4.0.1", - "url-parse-lax": "1.0.0", - "url-to-options": "1.0.1" + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" } }, "graceful-fs": { @@ -1098,8 +1590,17 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^5.1.0", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" } }, "has-flag": { @@ -1112,12 +1613,18 @@ "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==" }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, "has-to-string-tag-x": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", "requires": { - "has-symbol-support-x": "1.4.2" + "has-symbol-support-x": "^1.4.1" } }, "hash-base": { @@ -1125,7 +1632,7 @@ "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", "requires": { - "inherits": "2.0.3" + "inherits": "^2.0.1" } }, "hash.js": { @@ -1133,8 +1640,8 @@ "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" } }, "hawk": { @@ -1142,10 +1649,10 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.1.0" + "boom": "4.x.x", + "cryptiles": "3.x.x", + "hoek": "4.x.x", + "sntp": "2.x.x" } }, "hmac-drbg": { @@ -1153,9 +1660,9 @@ "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "requires": { - "hash.js": "1.1.3", - "minimalistic-assert": "1.0.0", - "minimalistic-crypto-utils": "1.0.1" + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, "hoek": { @@ -1171,7 +1678,7 @@ "depd": "1.1.1", "inherits": "2.0.3", "setprototypeof": "1.0.3", - "statuses": "1.5.0" + "statuses": ">= 1.3.1 < 2" }, "dependencies": { "depd": { @@ -1191,9 +1698,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "iconv-lite": { @@ -1206,6 +1713,18 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.11.tgz", "integrity": "sha512-VhDzCKN7K8ufStx/CLj5/PDTMgph+qwN5Pkd5i0sGnVwk56zJ0lkT8Qzi1xqWLS0Wp29DgDtNeS7v8/wMoZeHg==" }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "in-publish": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", @@ -1216,8 +1735,8 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -1225,11 +1744,50 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "inquirer": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", + "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.0", + "figures": "^2.0.0", + "lodash": "^4.17.10", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.1.0", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, "ipaddr.js": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, "is-function": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", @@ -1250,11 +1808,56 @@ "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, "is-retry-allowed": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", @@ -1265,6 +1868,12 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -1275,6 +1884,12 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -1285,15 +1900,45 @@ "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "requires": { - "has-to-string-tag-x": "1.4.1", - "is-object": "1.0.1" + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" } }, + "jest-docblock": { + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-21.2.0.tgz", + "integrity": "sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw==", + "dev": true + }, "js-sha3": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.3.1.tgz", "integrity": "sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=" }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -1315,9 +1960,15 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -1328,7 +1979,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } }, "jsonify": { @@ -1352,10 +2003,10 @@ "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "requires": { - "bindings": "1.3.0", - "inherits": "2.0.3", - "nan": "2.10.0", - "safe-buffer": "5.1.1" + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" } }, "keccakjs": { @@ -1363,8 +2014,8 @@ "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.1.tgz", "integrity": "sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0=", "requires": { - "browserify-sha3": "0.0.1", - "sha3": "1.2.0" + "browserify-sha3": "^0.0.1", + "sha3": "^1.1.0" } }, "levn": { @@ -1372,10 +2023,16 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -1386,7 +2043,7 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" }, "dependencies": { "pify": { @@ -1401,8 +2058,8 @@ "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.3" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" }, "dependencies": { "hash-base": { @@ -1410,8 +2067,8 @@ "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } } } @@ -1436,8 +2093,8 @@ "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0" + "bn.js": "^4.0.0", + "brorand": "^1.0.1" } }, "mime": { @@ -1455,9 +2112,15 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "requires": { - "mime-db": "1.33.0" + "mime-db": "~1.33.0" } }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, "mimic-response": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.0.tgz", @@ -1468,7 +2131,7 @@ "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", "requires": { - "dom-walk": "0.1.1" + "dom-walk": "^0.1.0" } }, "minimalistic-assert": { @@ -1486,7 +2149,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -1507,7 +2170,7 @@ "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", "requires": { - "mkdirp": "0.5.1" + "mkdirp": "*" } }, "mock-fs": { @@ -1530,18 +2193,24 @@ "resolved": "https://registry.npmjs.org/multistream/-/multistream-2.1.0.tgz", "integrity": "sha1-YlwmfVxEQkrWKUeItbtNo9yzLx0=", "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.5" + "inherits": "^2.0.1", + "readable-stream": "^2.0.5" } }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, "mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "requires": { - "any-promise": "1.3.0", - "object-assign": "4.1.1", - "thenify-all": "1.6.0" + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" } }, "nan": { @@ -1554,11 +2223,23 @@ "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=" }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "node-fetch": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", @@ -1590,12 +2271,42 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "dev": true + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.entries": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.0.4.tgz", + "integrity": "sha1-G/mk3SKI9bM/Opk9JXZh8F0WGl8=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.6.1", + "function-bind": "^1.1.0", + "has": "^1.0.1" + } + }, "oboe": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.3.tgz", "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", "requires": { - "http-https": "1.0.0" + "http-https": "^1.0.0" } }, "on-finished": { @@ -1611,7 +2322,16 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" } }, "optionator": { @@ -1619,12 +2339,12 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "os-tmpdir": { @@ -1647,7 +2367,7 @@ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", "requires": { - "p-finally": "1.0.0" + "p-finally": "^1.0.0" } }, "parse-asn1": { @@ -1655,11 +2375,11 @@ "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", "requires": { - "asn1.js": "4.10.1", - "browserify-aes": "1.1.1", - "create-hash": "1.1.3", - "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.14" + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" } }, "parse-headers": { @@ -1667,7 +2387,7 @@ "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", "requires": { - "for-each": "0.3.2", + "for-each": "^0.3.2", "trim": "0.0.1" } }, @@ -1681,6 +2401,18 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", @@ -1696,11 +2428,11 @@ "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", "requires": { - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.11" + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, "pend": { @@ -1728,7 +2460,7 @@ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pkg": { @@ -1757,9 +2489,9 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.1.tgz", "integrity": "sha1-f8DGyJV/mD9X8waiTlud3Y0N2IA=", "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "3.0.1", - "universalify": "0.1.1" + "graceful-fs": "^4.1.2", + "jsonfile": "^3.0.0", + "universalify": "^0.1.0" } }, "jsonfile": { @@ -1767,7 +2499,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } }, "minimist": { @@ -1801,8 +2533,8 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" } }, "assert-plus": { @@ -1820,7 +2552,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "cryptiles": { @@ -1828,7 +2560,7 @@ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "requires": { - "boom": "2.10.1" + "boom": "2.x.x" } }, "form-data": { @@ -1836,9 +2568,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.18" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" } }, "fs-extra": { @@ -1846,9 +2578,9 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.1.tgz", "integrity": "sha1-f8DGyJV/mD9X8waiTlud3Y0N2IA=", "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "3.0.1", - "universalify": "0.1.1" + "graceful-fs": "^4.1.2", + "jsonfile": "^3.0.0", + "universalify": "^0.1.0" } }, "har-schema": { @@ -1861,8 +2593,8 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" + "ajv": "^4.9.1", + "har-schema": "^1.0.5" } }, "hawk": { @@ -1870,10 +2602,10 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" } }, "hoek": { @@ -1886,9 +2618,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "jsonfile": { @@ -1896,7 +2628,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } }, "minimist": { @@ -1919,28 +2651,28 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" } }, "sntp": { @@ -1948,11 +2680,17 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } } } }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -1963,6 +2701,12 @@ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, + "prettier": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.3.tgz", + "integrity": "sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==", + "dev": true + }, "process": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", @@ -1983,7 +2727,7 @@ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", "requires": { - "forwarded": "0.1.2", + "forwarded": "~0.1.2", "ipaddr.js": "1.6.0" } }, @@ -1992,11 +2736,11 @@ "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "parse-asn1": "5.1.0", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1" } }, "punycode": { @@ -2014,9 +2758,9 @@ "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "requires": { - "decode-uri-component": "0.2.0", - "object-assign": "4.1.1", - "strict-uri-encode": "1.1.0" + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" } }, "randombytes": { @@ -2024,7 +2768,7 @@ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.1.0" } }, "randomfill": { @@ -2032,8 +2776,8 @@ "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "requires": { - "randombytes": "2.0.6", - "safe-buffer": "5.1.1" + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" } }, "randomhex": { @@ -2062,13 +2806,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" } }, "regenerator-runtime": { @@ -2076,33 +2820,39 @@ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" }, + "regexpp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz", + "integrity": "sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA==", + "dev": true + }, "request": { "version": "2.85.0", "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "hawk": "~6.0.2", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "stringstream": "~0.0.5", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" } }, "request-progress": { @@ -2110,7 +2860,17 @@ "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", "integrity": "sha1-TKdUCBx/7GP1BeT6qCWqBs1mnb4=", "requires": { - "throttleit": "1.0.0" + "throttleit": "^1.0.0" + } + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" } }, "resolve": { @@ -2118,7 +2878,23 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" } }, "rimraf": { @@ -2126,7 +2902,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "ripemd160": { @@ -2134,8 +2910,8 @@ "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", "requires": { - "hash-base": "2.0.2", - "inherits": "2.0.3" + "hash-base": "^2.0.0", + "inherits": "^2.0.1" } }, "rlp": { @@ -2143,17 +2919,41 @@ "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.0.0.tgz", "integrity": "sha1-nbOE/0uJqPYVY9kjldhiWxjzr7A=" }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.2.tgz", + "integrity": "sha512-hV7criqbR0pe7EeL3O66UYVg92IR0XsA97+9y+BWTePK9SKmEI5Qd3Zj6uPnGkNzXsBywBQWTvujPl+1Kn9Zjw==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "scrypt": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz", "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", "requires": { - "nan": "2.10.0" + "nan": "^2.0.8" } }, "scrypt.js": { @@ -2161,8 +2961,8 @@ "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.2.0.tgz", "integrity": "sha1-r40UZbcemZARC+38WTuUeeA6ito=", "requires": { - "scrypt": "6.0.3", - "scryptsy": "1.2.1" + "scrypt": "^6.0.2", + "scryptsy": "^1.2.1" } }, "scryptsy": { @@ -2170,7 +2970,7 @@ "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", "requires": { - "pbkdf2": "3.0.14" + "pbkdf2": "^3.0.3" } }, "secp256k1": { @@ -2178,14 +2978,14 @@ "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.5.0.tgz", "integrity": "sha512-e5QIJl8W7Y4tT6LHffVcZAxJjvpgE5Owawv6/XCYPQljE9aP2NFFddQ8OYMKhdLshNu88FfL3qCN3/xYkXGRsA==", "requires": { - "bindings": "1.3.0", - "bip66": "1.1.5", - "bn.js": "4.11.8", - "create-hash": "1.1.3", - "drbg.js": "1.0.1", - "elliptic": "6.4.0", - "nan": "2.10.0", - "safe-buffer": "5.1.1" + "bindings": "^1.2.1", + "bip66": "^1.1.3", + "bn.js": "^4.11.3", + "create-hash": "^1.1.2", + "drbg.js": "^1.0.1", + "elliptic": "^6.2.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" } }, "seek-bzip": { @@ -2193,7 +2993,7 @@ "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", "requires": { - "commander": "2.8.1" + "commander": "~2.8.1" } }, "semver": { @@ -2207,18 +3007,18 @@ "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "requires": { "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.6.2", + "http-errors": "~1.6.2", "mime": "1.4.1", "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" }, "dependencies": { "statuses": { @@ -2233,9 +3033,9 @@ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "requires": { - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "parseurl": "1.3.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", "send": "0.16.2" } }, @@ -2244,11 +3044,11 @@ "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", "requires": { - "body-parser": "1.18.2", - "cors": "2.8.4", - "express": "4.16.3", - "request": "2.85.0", - "xhr": "2.4.1" + "body-parser": "^1.16.0", + "cors": "^2.8.1", + "express": "^4.14.0", + "request": "^2.79.0", + "xhr": "^2.3.3" } }, "setimmediate": { @@ -2266,8 +3066,8 @@ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "sha3": { @@ -2275,9 +3075,30 @@ "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.0.tgz", "integrity": "sha1-aYnxtwpJhwWHajc+LGKs6WqpOZo=", "requires": { - "nan": "2.10.0" + "nan": "^2.0.5" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" } }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, "simple-bufferstream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/simple-bufferstream/-/simple-bufferstream-1.0.0.tgz", @@ -2293,9 +3114,18 @@ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.7.0.tgz", "integrity": "sha512-RkE9rGPHcxYZ/baYmgJtOSM63vH0Vyq+ma5TijBcLla41SWlh8t6XYIGMR/oeZcmr+/G8k+zrClkkVrtnQ0esg==", "requires": { - "decompress-response": "3.3.0", - "once": "1.4.0", - "simple-concat": "1.0.0" + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" } }, "sntp": { @@ -2303,7 +3133,7 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } }, "source-map": { @@ -2312,22 +3142,28 @@ "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", "optional": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "sshpk": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" } }, "statuses": { @@ -2340,7 +3176,7 @@ "resolved": "https://registry.npmjs.org/stream-meter/-/stream-meter-1.0.4.tgz", "integrity": "sha1-Uq+Vql6nYKJJFxZwTb/5D3Ov3R0=", "requires": { - "readable-stream": "2.3.5" + "readable-stream": "^2.1.4" } }, "strict-uri-encode": { @@ -2348,12 +3184,22 @@ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, "stringstream": { @@ -2361,12 +3207,21 @@ "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, "strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", "requires": { - "is-natural-number": "4.0.1" + "is-natural-number": "^4.0.1" } }, "strip-hex-prefix": { @@ -2377,12 +3232,18 @@ "is-hex-prefixed": "1.0.0" } }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "supports-color": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", "requires": { - "has-flag": "2.0.0" + "has-flag": "^2.0.0" } }, "swarm-js": { @@ -2390,19 +3251,59 @@ "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.37.tgz", "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", "requires": { - "bluebird": "3.5.1", - "buffer": "5.1.0", - "decompress": "4.2.0", - "eth-lib": "0.1.27", - "fs-extra": "2.1.2", - "fs-promise": "2.0.3", - "got": "7.1.0", - "mime-types": "2.1.18", - "mkdirp-promise": "5.0.1", - "mock-fs": "4.4.2", - "setimmediate": "1.0.5", - "tar.gz": "1.0.7", - "xhr-request-promise": "0.1.2" + "bluebird": "^3.5.0", + "buffer": "^5.0.5", + "decompress": "^4.0.0", + "eth-lib": "^0.1.26", + "fs-extra": "^2.1.2", + "fs-promise": "^2.0.0", + "got": "^7.1.0", + "mime-types": "^2.1.16", + "mkdirp-promise": "^5.0.1", + "mock-fs": "^4.1.0", + "setimmediate": "^1.0.5", + "tar.gz": "^1.0.5", + "xhr-request-promise": "^0.1.2" + } + }, + "table": { + "version": "4.0.3", + "resolved": "http://registry.npmjs.org/table/-/table-4.0.3.tgz", + "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", + "dev": true, + "requires": { + "ajv": "^6.0.1", + "ajv-keywords": "^3.0.0", + "chalk": "^2.1.0", + "lodash": "^4.17.4", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", + "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + } } }, "tar": { @@ -2410,9 +3311,9 @@ "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" } }, "tar-stream": { @@ -2420,10 +3321,10 @@ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.5.tgz", "integrity": "sha512-mQdgLPc/Vjfr3VWqWbfxW8yQNiJCbAZ+Gf6GDu1Cy0bdb33ofyiNGBtAY96jHFhDuivCwgW1H9DgTON+INiXgg==", "requires": { - "bl": "1.2.2", - "end-of-stream": "1.4.1", - "readable-stream": "2.3.5", - "xtend": "4.0.1" + "bl": "^1.0.0", + "end-of-stream": "^1.0.0", + "readable-stream": "^2.0.0", + "xtend": "^4.0.0" } }, "tar.gz": { @@ -2431,11 +3332,11 @@ "resolved": "https://registry.npmjs.org/tar.gz/-/tar.gz-1.0.7.tgz", "integrity": "sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg==", "requires": { - "bluebird": "2.11.0", - "commander": "2.8.1", - "fstream": "1.0.11", - "mout": "0.11.1", - "tar": "2.2.1" + "bluebird": "^2.9.34", + "commander": "^2.8.1", + "fstream": "^1.0.8", + "mout": "^0.11.0", + "tar": "^2.1.1" }, "dependencies": { "bluebird": { @@ -2445,12 +3346,18 @@ } } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "thenify": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", "requires": { - "any-promise": "1.3.0" + "any-promise": "^1.0.0" } }, "thenify-all": { @@ -2458,7 +3365,7 @@ "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", "requires": { - "thenify": "3.3.0" + "thenify": ">= 3.1.0 < 4" } }, "throttleit": { @@ -2476,12 +3383,21 @@ "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "tough-cookie": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "trim": { @@ -2489,12 +3405,18 @@ "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -2508,7 +3430,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "type-is": { @@ -2517,7 +3439,7 @@ "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", "requires": { "media-typer": "0.3.0", - "mime-types": "2.1.18" + "mime-types": "~2.1.18" } }, "typedarray-to-buffer": { @@ -2525,7 +3447,7 @@ "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "requires": { - "is-typedarray": "1.0.0" + "is-typedarray": "^1.0.0" } }, "uid2": { @@ -2543,8 +3465,8 @@ "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz", "integrity": "sha512-izD3jxT8xkzwtXRUZjtmRwKnZoeECrfZ8ra/ketwOcusbZEp4mjULMnJOCfTDZBgGQAAY1AJ/IgxcwkavcX9Og==", "requires": { - "buffer": "3.6.0", - "through": "2.3.8" + "buffer": "^3.0.1", + "through": "^2.3.6" }, "dependencies": { "base64-js": { @@ -2558,8 +3480,8 @@ "integrity": "sha1-pyyTb3e5a/UvX357RnGAYoVR3vs=", "requires": { "base64-js": "0.0.8", - "ieee754": "1.1.11", - "isarray": "1.0.0" + "ieee754": "^1.1.4", + "isarray": "^1.0.0" } } } @@ -2574,8 +3496,8 @@ "resolved": "https://registry.npmjs.org/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz", "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=", "requires": { - "mkdirp": "0.5.1", - "os-tmpdir": "1.0.2", + "mkdirp": "^0.5.1", + "os-tmpdir": "^1.0.1", "uid2": "0.0.3" } }, @@ -2589,12 +3511,29 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, "url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "requires": { - "prepend-http": "1.0.4" + "prepend-http": "^1.0.1" } }, "url-set-query": { @@ -2637,9 +3576,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" } }, "web3": { @@ -2789,9 +3728,9 @@ "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.0", - "xhr-request-promise": "0.1.2" + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" } }, "uuid": { @@ -2917,11 +3856,21 @@ }, "websocket": { "version": "git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c", + "from": "websocket@git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c", "requires": { - "debug": "2.6.9", - "nan": "2.10.0", - "typedarray-to-buffer": "3.1.5", - "yaeti": "0.0.6" + "debug": "^2.2.0", + "nan": "^2.3.3", + "typedarray-to-buffer": "^3.1.2", + "yaeti": "^0.0.6" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" } }, "wordwrap": { @@ -2934,14 +3883,23 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "ws": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "requires": { - "async-limiter": "1.0.0", - "safe-buffer": "5.1.1", - "ultron": "1.1.1" + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" } }, "xhr": { @@ -2949,10 +3907,10 @@ "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.4.1.tgz", "integrity": "sha512-pAIU5vBr9Hiy5cpFIbPnwf0C18ZF86DBsZKrlsf87N5De/JbA6RJ83UP/cv+aljl4S40iRVMqP4pr4sF9Dnj0A==", "requires": { - "global": "4.3.2", - "is-function": "1.0.1", - "parse-headers": "2.0.1", - "xtend": "4.0.1" + "global": "~4.3.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" } }, "xhr-request": { @@ -2960,13 +3918,13 @@ "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", "requires": { - "buffer-to-arraybuffer": "0.0.5", - "object-assign": "4.1.1", - "query-string": "5.1.1", - "simple-get": "2.7.0", - "timed-out": "4.0.1", - "url-set-query": "1.0.0", - "xhr": "2.4.1" + "buffer-to-arraybuffer": "^0.0.5", + "object-assign": "^4.1.1", + "query-string": "^5.0.1", + "simple-get": "^2.7.0", + "timed-out": "^4.0.1", + "url-set-query": "^1.0.0", + "xhr": "^2.0.4" } }, "xhr-request-promise": { @@ -2974,7 +3932,7 @@ "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz", "integrity": "sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0=", "requires": { - "xhr-request": "1.1.0" + "xhr-request": "^1.0.1" } }, "xhr2": { @@ -2997,8 +3955,8 @@ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.9.1.tgz", "integrity": "sha1-qBmB6nCleUYTOIPwKcWCGok1mn8=", "requires": { - "buffer-crc32": "0.2.13", - "fd-slicer": "1.0.1" + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.0.1" } } } diff --git a/deploy/package.json b/deploy/package.json index 53dc4cec2..950b2da5e 100644 --- a/deploy/package.json +++ b/deploy/package.json @@ -4,7 +4,8 @@ "description": "", "main": "deploy.js", "scripts": { - "compile": "pkg deploy.js --out-path build/tmp_build" + "compile": "pkg deploy.js --out-path build/tmp_build", + "lint": "eslint ." }, "author": "", "license": "ISC", @@ -14,5 +15,15 @@ "node-fetch": "^2.1.2", "pkg": "^4.3.1", "web3": "^1.0.0-beta.33" + }, + "devDependencies": { + "eslint": "^5.6.0", + "eslint-config-airbnb-base": "^13.1.0", + "eslint-config-prettier": "^3.0.1", + "eslint-plugin-prettier": "^2.6.2", + "prettier": "^1.14.3" + }, + "engines": { + "node": ">= 8.9" } } diff --git a/deploy/src/deploymentUtils.js b/deploy/src/deploymentUtils.js index 5945c9d1e..915f1c4d5 100644 --- a/deploy/src/deploymentUtils.js +++ b/deploy/src/deploymentUtils.js @@ -1,4 +1,8 @@ const Web3 = require('web3') +const Tx = require('ethereumjs-tx') +const Web3Utils = require('web3-utils') +const fetch = require('node-fetch') +const assert = require('assert') const { web3Home, web3Foreign, @@ -8,15 +12,12 @@ const { GAS_LIMIT, GAS_PRICE, GET_RECEIPT_INTERVAL_IN_MILLISECONDS -} = require('./web3'); -const Tx = require('ethereumjs-tx'); -const Web3Utils = require('web3-utils'); -const fetch = require('node-fetch'); -const assert = require('assert') +} = require('./web3') -async function deployContract(contractJson, args, {from, network, nonce}) { - let web3, url; - if(network === 'foreign'){ +async function deployContract(contractJson, args, { from, network, nonce }) { + let web3 + let url + if (network === 'foreign') { web3 = web3Foreign url = FOREIGN_RPC_URL } else { @@ -25,13 +26,15 @@ async function deployContract(contractJson, args, {from, network, nonce}) { } const options = { from, - gasPrice: GAS_PRICE, - }; - let instance = new web3.eth.Contract(contractJson.abi, options); - const result = await instance.deploy({ - data: contractJson.bytecode, - arguments: args - }).encodeABI() + gasPrice: GAS_PRICE + } + const instance = new web3.eth.Contract(contractJson.abi, options) + const result = await instance + .deploy({ + data: contractJson.bytecode, + arguments: args + }) + .encodeABI() const tx = await sendRawTx({ data: result, nonce: Web3Utils.toHex(nonce), @@ -39,18 +42,17 @@ async function deployContract(contractJson, args, {from, network, nonce}) { privateKey: deploymentPrivateKey, url }) - if(tx.status !== '0x1'){ - throw new Error('Tx failed'); + if (tx.status !== '0x1') { + throw new Error('Tx failed') } - instance.options.address = tx.contractAddress; + instance.options.address = tx.contractAddress instance.deployedBlockNumber = tx.blockNumber - return instance; + return instance } - -async function sendRawTx({data, nonce, to, privateKey, url}) { +async function sendRawTx({ data, nonce, to, privateKey, url }) { try { - var rawTx = { + const rawTx = { nonce, gasPrice: Web3Utils.toHex(GAS_PRICE), gasLimit: Web3Utils.toHex(GAS_LIMIT), @@ -58,51 +60,53 @@ async function sendRawTx({data, nonce, to, privateKey, url}) { data } - var tx = new Tx(rawTx); - tx.sign(privateKey); - var serializedTx = tx.serialize(); - const txHash = await sendNodeRequest(url, "eth_sendRawTransaction", '0x' + serializedTx.toString('hex')); - console.log('pending txHash', txHash ); - const receipt = await getReceipt(txHash, url); + const tx = new Tx(rawTx) + tx.sign(privateKey) + const serializedTx = tx.serialize() + const txHash = await sendNodeRequest( + url, + 'eth_sendRawTransaction', + `0x${serializedTx.toString('hex')}` + ) + console.log('pending txHash', txHash) + const receipt = await getReceipt(txHash, url) return receipt - } catch (e) { console.error(e) } } -async function sendNodeRequest(url, method, signedData){ +async function sendNodeRequest(url, method, signedData) { const request = await fetch(url, { headers: { 'Content-type': 'application/json' }, method: 'POST', body: JSON.stringify({ - jsonrpc: "2.0", + jsonrpc: '2.0', method, params: [signedData], id: 1 }) - }); + }) const json = await request.json() - if(method === 'eth_sendRawTransaction') { + if (method === 'eth_sendRawTransaction') { assert.equal(json.result.length, 66, `Tx wasn't sent ${json}`) } - return json.result; - + return json.result } function timeout(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); + return new Promise(resolve => setTimeout(resolve, ms)) } async function getReceipt(txHash, url) { - await timeout(GET_RECEIPT_INTERVAL_IN_MILLISECONDS); - let receipt = await sendNodeRequest(url, "eth_getTransactionReceipt", txHash); - if(receipt === null || receipt.blockNumber === null) { - receipt = await getReceipt(txHash, url); + await timeout(GET_RECEIPT_INTERVAL_IN_MILLISECONDS) + let receipt = await sendNodeRequest(url, 'eth_getTransactionReceipt', txHash) + if (receipt === null || receipt.blockNumber === null) { + receipt = await getReceipt(txHash, url) } - return receipt; + return receipt } function add0xPrefix(s) { @@ -110,7 +114,7 @@ function add0xPrefix(s) { return s } - return '0x' + s + return `0x${s}` } function privateKeyToAddress(privateKey) { diff --git a/deploy/src/erc_to_erc/foreign.js b/deploy/src/erc_to_erc/foreign.js index c476c4e60..473a3bfd5 100644 --- a/deploy/src/erc_to_erc/foreign.js +++ b/deploy/src/erc_to_erc/foreign.js @@ -1,18 +1,18 @@ const Web3Utils = require('web3-utils') require('dotenv').config({ - path: __dirname + '../../.env' -}); + path: `${__dirname}../../.env` +}) -const assert = require('assert'); +const assert = require('assert') -const {deployContract, privateKeyToAddress, sendRawTx} = require('../deploymentUtils'); -const {web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL} = require('../web3'); +const { deployContract, privateKeyToAddress, sendRawTx } = require('../deploymentUtils') +const { web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL } = require('../web3') -const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json'); +const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') const ForeignBridge = require('../../../build/contracts/ForeignBridgeErcToErc.json') -const VALIDATORS = process.env.VALIDATORS.split(" ") +const VALIDATORS = process.env.VALIDATORS.split(' ') const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -22,130 +22,161 @@ const { FOREIGN_UPGRADEABLE_ADMIN_BRIDGE, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, ERC20_TOKEN_ADDRESS -} = process.env; +} = process.env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) async function deployForeign() { - if(!Web3Utils.isAddress(ERC20_TOKEN_ADDRESS)){ - throw "ERC20_TOKEN_ADDRESS env var is not defined" + if (!Web3Utils.isAddress(ERC20_TOKEN_ADDRESS)) { + throw new Error('ERC20_TOKEN_ADDRESS env var is not defined') } - let foreignNonce = await web3Foreign.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS); + let foreignNonce = await web3Foreign.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) console.log('========================================') console.log('deploying ForeignBridge') console.log('========================================\n') console.log('deploying storage for foreign validators') - const storageValidatorsForeign = await deployContract(EternalStorageProxy, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce}) - foreignNonce++; + const storageValidatorsForeign = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ console.log('[Foreign] BridgeValidators Storage: ', storageValidatorsForeign.options.address) console.log('\ndeploying implementation for foreign validators') - let bridgeValidatorsForeign = await deployContract(BridgeValidators, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce}) - foreignNonce++; - console.log('[Foreign] BridgeValidators Implementation: ', bridgeValidatorsForeign.options.address) + const bridgeValidatorsForeign = await deployContract(BridgeValidators, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ + console.log( + '[Foreign] BridgeValidators Implementation: ', + bridgeValidatorsForeign.options.address + ) console.log('\nhooking up eternal storage to BridgeValidators') - const upgradeToBridgeVForeignData = await storageValidatorsForeign.methods.upgradeTo('1', bridgeValidatorsForeign.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const upgradeToBridgeVForeignData = await storageValidatorsForeign.methods + .upgradeTo('1', bridgeValidatorsForeign.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txUpgradeToBridgeVForeign = await sendRawTx({ data: upgradeToBridgeVForeignData, nonce: foreignNonce, to: storageValidatorsForeign.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txUpgradeToBridgeVForeign.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txUpgradeToBridgeVForeign.status, '0x1', 'Transaction Failed') + foreignNonce++ console.log('\ninitializing Foreign Bridge Validators with following parameters:\n') - console.log(`REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}`) + console.log( + `REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}` + ) bridgeValidatorsForeign.options.address = storageValidatorsForeign.options.address - const initializeForeignData = await bridgeValidatorsForeign.methods.initialize( - REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, FOREIGN_OWNER_MULTISIG - ).encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const initializeForeignData = await bridgeValidatorsForeign.methods + .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, FOREIGN_OWNER_MULTISIG) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitializeForeign = await sendRawTx({ data: initializeForeignData, nonce: foreignNonce, to: bridgeValidatorsForeign.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txInitializeForeign.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txInitializeForeign.status, '0x1', 'Transaction Failed') + foreignNonce++ console.log('\nTransferring ownership of ValidatorsProxy\n') - const validatorsForeignOwnershipData = await storageValidatorsForeign.methods.transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const validatorsForeignOwnershipData = await storageValidatorsForeign.methods + .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txValidatorsForeignOwnershipData = await sendRawTx({ data: validatorsForeignOwnershipData, nonce: foreignNonce, to: storageValidatorsForeign.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txValidatorsForeignOwnershipData.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txValidatorsForeignOwnershipData.status, '0x1', 'Transaction Failed') + foreignNonce++ console.log('\ndeploying foreignBridge storage\n') - const foreignBridgeStorage = await deployContract(EternalStorageProxy, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce}) - foreignNonce++; + const foreignBridgeStorage = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ console.log('[Foreign] ForeignBridge Storage: ', foreignBridgeStorage.options.address) console.log('\ndeploying foreignBridge implementation\n') - const foreignBridgeImplementation = await deployContract(ForeignBridge, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce}) - foreignNonce++; - console.log('[Foreign] ForeignBridge Implementation: ', foreignBridgeImplementation.options.address) + const foreignBridgeImplementation = await deployContract(ForeignBridge, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ + console.log( + '[Foreign] ForeignBridge Implementation: ', + foreignBridgeImplementation.options.address + ) console.log('\nhooking up ForeignBridge storage to ForeignBridge implementation') - const upgradeToForeignBridgeData = await foreignBridgeStorage.methods.upgradeTo('1', foreignBridgeImplementation.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const upgradeToForeignBridgeData = await foreignBridgeStorage.methods + .upgradeTo('1', foreignBridgeImplementation.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txUpgradeToForeignBridge = await sendRawTx({ data: upgradeToForeignBridgeData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txUpgradeToForeignBridge.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txUpgradeToForeignBridge.status, '0x1', 'Transaction Failed') + foreignNonce++ console.log('\ninitializing Foreign Bridge with following parameters:\n') console.log(`Foreign Validators: ${storageValidatorsForeign.options.address}, `) foreignBridgeImplementation.options.address = foreignBridgeStorage.options.address - const initializeFBridgeData = await foreignBridgeImplementation.methods.initialize( - storageValidatorsForeign.options.address, ERC20_TOKEN_ADDRESS, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS - ).encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const initializeFBridgeData = await foreignBridgeImplementation.methods + .initialize( + storageValidatorsForeign.options.address, + ERC20_TOKEN_ADDRESS, + FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS + ) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitializeBridge = await sendRawTx({ data: initializeFBridgeData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txInitializeBridge.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txInitializeBridge.status, '0x1', 'Transaction Failed') + foreignNonce++ - const bridgeOwnershipData = await foreignBridgeStorage.methods.transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_BRIDGE) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const bridgeOwnershipData = await foreignBridgeStorage.methods + .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_BRIDGE) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txBridgeOwnershipData = await sendRawTx({ data: bridgeOwnershipData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed') + foreignNonce++ return { - foreignBridge: - { - address: foreignBridgeStorage.options.address, - deployedBlockNumber: Web3Utils.hexToNumber(foreignBridgeStorage.deployedBlockNumber) - } + foreignBridge: { + address: foreignBridgeStorage.options.address, + deployedBlockNumber: Web3Utils.hexToNumber(foreignBridgeStorage.deployedBlockNumber) + } } } -module.exports = deployForeign; +module.exports = deployForeign diff --git a/deploy/src/erc_to_erc/home.js b/deploy/src/erc_to_erc/home.js index 5ac6f3ad6..3c636c1d5 100644 --- a/deploy/src/erc_to_erc/home.js +++ b/deploy/src/erc_to_erc/home.js @@ -1,20 +1,20 @@ const Web3Utils = require('web3-utils') require('dotenv').config({ - path: __dirname + '../../.env' -}); + path: `${__dirname}../../.env` +}) -const assert = require('assert'); +const assert = require('assert') -const {deployContract, privateKeyToAddress, sendRawTx} = require('../deploymentUtils'); -const {web3Home, deploymentPrivateKey, HOME_RPC_URL} = require('../web3'); +const { deployContract, privateKeyToAddress, sendRawTx } = require('../deploymentUtils') +const { web3Home, deploymentPrivateKey, HOME_RPC_URL } = require('../web3') -const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json'); +const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') const HomeBridge = require('../../../build/contracts/HomeBridgeErcToErc.json') -const ERC677BridgeToken = require('../../../build/contracts/ERC677BridgeToken.json'); +const ERC677BridgeToken = require('../../../build/contracts/ERC677BridgeToken.json') -const VALIDATORS = process.env.VALIDATORS.split(" ") -const HOME_GAS_PRICE = Web3Utils.toWei(process.env.HOME_GAS_PRICE, 'gwei'); +const VALIDATORS = process.env.VALIDATORS.split(' ') +const HOME_GAS_PRICE = Web3Utils.toWei(process.env.HOME_GAS_PRICE, 'gwei') const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -28,28 +28,33 @@ const { HOME_REQUIRED_BLOCK_CONFIRMATIONS, BRIDGEABLE_TOKEN_NAME, BRIDGEABLE_TOKEN_SYMBOL, - BRIDGEABLE_TOKEN_DECIMALS, - -} = process.env; + BRIDGEABLE_TOKEN_DECIMALS +} = process.env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) -async function deployHome() -{ - let homeNonce = await web3Home.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS); +async function deployHome() { + let homeNonce = await web3Home.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) console.log('deploying storage for home validators') - const storageValidatorsHome = await deployContract(EternalStorageProxy, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce: homeNonce}) + const storageValidatorsHome = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) console.log('[Home] BridgeValidators Storage: ', storageValidatorsHome.options.address) - homeNonce++; + homeNonce++ console.log('\ndeploying implementation for home validators') - let bridgeValidatorsHome = await deployContract(BridgeValidators, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce: homeNonce}) + const bridgeValidatorsHome = await deployContract(BridgeValidators, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) console.log('[Home] BridgeValidators Implementation: ', bridgeValidatorsHome.options.address) - homeNonce++; + homeNonce++ console.log('\nhooking up eternal storage to BridgeValidators') - const upgradeToBridgeVHomeData = await storageValidatorsHome.methods.upgradeTo('1', bridgeValidatorsHome.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const upgradeToBridgeVHomeData = await storageValidatorsHome.methods + .upgradeTo('1', bridgeValidatorsHome.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txUpgradeToBridgeVHome = await sendRawTx({ data: upgradeToBridgeVHomeData, nonce: homeNonce, @@ -57,15 +62,17 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToBridgeVHome.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txUpgradeToBridgeVHome.status, '0x1', 'Transaction Failed') + homeNonce++ console.log('\ninitializing Home Bridge Validators with following parameters:\n') - console.log(`REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}`) + console.log( + `REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}` + ) bridgeValidatorsHome.options.address = storageValidatorsHome.options.address - const initializeData = await bridgeValidatorsHome.methods.initialize( - REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, HOME_OWNER_MULTISIG - ).encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}) + const initializeData = await bridgeValidatorsHome.methods + .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, HOME_OWNER_MULTISIG) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitialize = await sendRawTx({ data: initializeData, nonce: homeNonce, @@ -73,11 +80,13 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txInitialize.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txInitialize.status, '0x1', 'Transaction Failed') + homeNonce++ - console.log('transferring proxy ownership to multisig for Validators Proxy contract'); - const proxyDataTransfer = await storageValidatorsHome.methods.transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_VALIDATORS).encodeABI(); + console.log('transferring proxy ownership to multisig for Validators Proxy contract') + const proxyDataTransfer = await storageValidatorsHome.methods + .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_VALIDATORS) + .encodeABI() const txProxyDataTransfer = await sendRawTx({ data: proxyDataTransfer, nonce: homeNonce, @@ -85,22 +94,29 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txProxyDataTransfer.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txProxyDataTransfer.status, '0x1', 'Transaction Failed') + homeNonce++ console.log('\ndeploying homeBridge storage\n') - const homeBridgeStorage = await deployContract(EternalStorageProxy, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce: homeNonce}) - homeNonce++; + const homeBridgeStorage = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) + homeNonce++ console.log('[Home] HomeBridge Storage: ', homeBridgeStorage.options.address) console.log('\ndeploying homeBridge implementation\n') - const homeBridgeImplementation = await deployContract(HomeBridge, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce: homeNonce}) - homeNonce++; + const homeBridgeImplementation = await deployContract(HomeBridge, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) + homeNonce++ console.log('[Home] HomeBridge Implementation: ', homeBridgeImplementation.options.address) console.log('\nhooking up HomeBridge storage to HomeBridge implementation') - const upgradeToHomeBridgeData = await homeBridgeStorage.methods.upgradeTo('1', homeBridgeImplementation.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const upgradeToHomeBridgeData = await homeBridgeStorage.methods + .upgradeTo('1', homeBridgeImplementation.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txUpgradeToHomeBridge = await sendRawTx({ data: upgradeToHomeBridgeData, nonce: homeNonce, @@ -108,59 +124,69 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToHomeBridge.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txUpgradeToHomeBridge.status, '0x1', 'Transaction Failed') + homeNonce++ console.log('\n[Home] deploying Bridgeble token') - const erc677token = await deployContract(ERC677BridgeToken, + const erc677token = await deployContract( + ERC677BridgeToken, [BRIDGEABLE_TOKEN_NAME, BRIDGEABLE_TOKEN_SYMBOL, BRIDGEABLE_TOKEN_DECIMALS], - {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'home', nonce: homeNonce} + { from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'home', nonce: homeNonce } ) - homeNonce++; + homeNonce++ console.log('[Home] Bridgeble Token: ', erc677token.options.address) console.log('transferring ownership of Bridgeble token to homeBridge contract') - const txOwnershipData = await erc677token.methods.transferOwnership(homeBridgeStorage.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}) + const txOwnershipData = await erc677token.methods + .transferOwnership(homeBridgeStorage.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txOwnership = await sendRawTx({ data: txOwnershipData, nonce: homeNonce, to: erc677token.options.address, privateKey: deploymentPrivateKey, url: HOME_RPC_URL - }); - assert.equal(txOwnership.status, '0x1', 'Transaction Failed'); - homeNonce++; + }) + assert.equal(txOwnership.status, '0x1', 'Transaction Failed') + homeNonce++ console.log('\ninitializing Home Bridge with following parameters:\n') console.log(`Home Validators: ${storageValidatorsHome.options.address}, HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, - HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, - HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, + HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + HOME_MAX_AMOUNT_PER_TX + )} in eth, + HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + HOME_MIN_AMOUNT_PER_TX + )} in eth, HOME_GAS_PRICE: ${HOME_GAS_PRICE}, HOME_REQUIRED_BLOCK_CONFIRMATIONS : ${HOME_REQUIRED_BLOCK_CONFIRMATIONS} `) homeBridgeImplementation.options.address = homeBridgeStorage.options.address - const initializeHomeBridgeData = await homeBridgeImplementation.methods.initialize( - storageValidatorsHome.options.address, - HOME_DAILY_LIMIT, - HOME_MAX_AMOUNT_PER_TX, - HOME_MIN_AMOUNT_PER_TX, - HOME_GAS_PRICE, - HOME_REQUIRED_BLOCK_CONFIRMATIONS, - erc677token.options.address - ).encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const initializeHomeBridgeData = await homeBridgeImplementation.methods + .initialize( + storageValidatorsHome.options.address, + HOME_DAILY_LIMIT, + HOME_MAX_AMOUNT_PER_TX, + HOME_MIN_AMOUNT_PER_TX, + HOME_GAS_PRICE, + HOME_REQUIRED_BLOCK_CONFIRMATIONS, + erc677token.options.address + ) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitializeHomeBridge = await sendRawTx({ data: initializeHomeBridgeData, nonce: homeNonce, to: homeBridgeStorage.options.address, privateKey: deploymentPrivateKey, url: HOME_RPC_URL - }); - assert.equal(txInitializeHomeBridge.status, '0x1', 'Transaction Failed'); - homeNonce++; + }) + assert.equal(txInitializeHomeBridge.status, '0x1', 'Transaction Failed') + homeNonce++ - console.log('transferring proxy ownership to multisig for Home bridge Proxy contract'); - const homeBridgeProxyData = await homeBridgeStorage.methods.transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_BRIDGE).encodeABI(); + console.log('transferring proxy ownership to multisig for Home bridge Proxy contract') + const homeBridgeProxyData = await homeBridgeStorage.methods + .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_BRIDGE) + .encodeABI() const txhomeBridgeProxyData = await sendRawTx({ data: homeBridgeProxyData, nonce: homeNonce, @@ -168,8 +194,8 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed') + homeNonce++ console.log('\nHome Deployment Bridge is complete\n') return { @@ -177,6 +203,5 @@ async function deployHome() erc677tokenAddress: erc677token.options.address, deployedBlockNumber: Web3Utils.hexToNumber(homeBridgeStorage.deployedBlockNumber) } - } -module.exports = deployHome; +module.exports = deployHome diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index f3c10aba9..6733babab 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -1,20 +1,20 @@ const Web3Utils = require('web3-utils') require('dotenv').config({ - path: __dirname + '../../.env' -}); + path: `${__dirname}../../.env` +}) -const assert = require('assert'); +const assert = require('assert') -const {deployContract, privateKeyToAddress, sendRawTx} = require('../deploymentUtils'); -const {web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL} = require('../web3'); +const { deployContract, privateKeyToAddress, sendRawTx } = require('../deploymentUtils') +const { web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL } = require('../web3') -const ERC677BridgeToken = require('../../../build/contracts/ERC677BridgeToken.json'); -const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json'); +const ERC677BridgeToken = require('../../../build/contracts/ERC677BridgeToken.json') +const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') const ForeignBridge = require('../../../build/contracts/ForeignBridgeNativeToErc.json') -const VALIDATORS = process.env.VALIDATORS.split(" ") -const FOREIGN_GAS_PRICE = Web3Utils.toWei(process.env.FOREIGN_GAS_PRICE, 'gwei'); +const VALIDATORS = process.env.VALIDATORS.split(' ') +const FOREIGN_GAS_PRICE = Web3Utils.toWei(process.env.FOREIGN_GAS_PRICE, 'gwei') const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -28,152 +28,196 @@ const { FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, BRIDGEABLE_TOKEN_NAME, BRIDGEABLE_TOKEN_SYMBOL, - BRIDGEABLE_TOKEN_DECIMALS, - -} = process.env; + BRIDGEABLE_TOKEN_DECIMALS +} = process.env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) async function deployForeign() { - let foreignNonce = await web3Foreign.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS); + let foreignNonce = await web3Foreign.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) console.log('========================================') console.log('deploying ForeignBridge') console.log('========================================\n') console.log('\n[Foreign] deploying BRIDGEABLE_TOKEN_SYMBOL token') - const erc677bridgeToken = await deployContract(ERC677BridgeToken, [BRIDGEABLE_TOKEN_NAME, BRIDGEABLE_TOKEN_SYMBOL, BRIDGEABLE_TOKEN_DECIMALS], {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce}) - foreignNonce++; + const erc677bridgeToken = await deployContract( + ERC677BridgeToken, + [BRIDGEABLE_TOKEN_NAME, BRIDGEABLE_TOKEN_SYMBOL, BRIDGEABLE_TOKEN_DECIMALS], + { from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce } + ) + foreignNonce++ console.log('[Foreign] BRIDGEABLE_TOKEN_SYMBOL: ', erc677bridgeToken.options.address) - console.log('deploying storage for foreign validators') - const storageValidatorsForeign = await deployContract(EternalStorageProxy, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce}) - foreignNonce++; + const storageValidatorsForeign = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ console.log('[Foreign] BridgeValidators Storage: ', storageValidatorsForeign.options.address) console.log('\ndeploying implementation for foreign validators') - let bridgeValidatorsForeign = await deployContract(BridgeValidators, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce}) - foreignNonce++; - console.log('[Foreign] BridgeValidators Implementation: ', bridgeValidatorsForeign.options.address) + const bridgeValidatorsForeign = await deployContract(BridgeValidators, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ + console.log( + '[Foreign] BridgeValidators Implementation: ', + bridgeValidatorsForeign.options.address + ) console.log('\nhooking up eternal storage to BridgeValidators') - const upgradeToBridgeVForeignData = await storageValidatorsForeign.methods.upgradeTo('1', bridgeValidatorsForeign.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const upgradeToBridgeVForeignData = await storageValidatorsForeign.methods + .upgradeTo('1', bridgeValidatorsForeign.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txUpgradeToBridgeVForeign = await sendRawTx({ data: upgradeToBridgeVForeignData, nonce: foreignNonce, to: storageValidatorsForeign.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txUpgradeToBridgeVForeign.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txUpgradeToBridgeVForeign.status, '0x1', 'Transaction Failed') + foreignNonce++ console.log('\ninitializing Foreign Bridge Validators with following parameters:\n') - console.log(`REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}`) + console.log( + `REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}` + ) bridgeValidatorsForeign.options.address = storageValidatorsForeign.options.address - const initializeForeignData = await bridgeValidatorsForeign.methods.initialize( - REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, FOREIGN_OWNER_MULTISIG - ).encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const initializeForeignData = await bridgeValidatorsForeign.methods + .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, FOREIGN_OWNER_MULTISIG) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitializeForeign = await sendRawTx({ data: initializeForeignData, nonce: foreignNonce, to: bridgeValidatorsForeign.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txInitializeForeign.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txInitializeForeign.status, '0x1', 'Transaction Failed') + foreignNonce++ console.log('\nTransferring ownership of ValidatorsProxy\n') - const validatorsForeignOwnershipData = await storageValidatorsForeign.methods.transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const validatorsForeignOwnershipData = await storageValidatorsForeign.methods + .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txValidatorsForeignOwnershipData = await sendRawTx({ data: validatorsForeignOwnershipData, nonce: foreignNonce, to: storageValidatorsForeign.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txValidatorsForeignOwnershipData.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txValidatorsForeignOwnershipData.status, '0x1', 'Transaction Failed') + foreignNonce++ console.log('\ndeploying foreignBridge storage\n') - const foreignBridgeStorage = await deployContract(EternalStorageProxy, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce}) - foreignNonce++; + const foreignBridgeStorage = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ console.log('[Foreign] ForeignBridge Storage: ', foreignBridgeStorage.options.address) console.log('\ndeploying foreignBridge implementation\n') - const foreignBridgeImplementation = await deployContract(ForeignBridge, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce}) - foreignNonce++; - console.log('[Foreign] ForeignBridge Implementation: ', foreignBridgeImplementation.options.address) + const foreignBridgeImplementation = await deployContract(ForeignBridge, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ + console.log( + '[Foreign] ForeignBridge Implementation: ', + foreignBridgeImplementation.options.address + ) console.log('\nhooking up ForeignBridge storage to ForeignBridge implementation') - const upgradeToForeignBridgeData = await foreignBridgeStorage.methods.upgradeTo('1', foreignBridgeImplementation.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const upgradeToForeignBridgeData = await foreignBridgeStorage.methods + .upgradeTo('1', foreignBridgeImplementation.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txUpgradeToForeignBridge = await sendRawTx({ data: upgradeToForeignBridgeData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txUpgradeToForeignBridge.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txUpgradeToForeignBridge.status, '0x1', 'Transaction Failed') + foreignNonce++ console.log('\ninitializing Foreign Bridge with following parameters:\n') console.log(`Foreign Validators: ${storageValidatorsForeign.options.address}, - FOREIGN_DAILY_LIMIT : ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei(FOREIGN_DAILY_LIMIT)} in eth, - FOREIGN_MAX_AMOUNT_PER_TX: ${FOREIGN_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(FOREIGN_MAX_AMOUNT_PER_TX)} in eth, - FOREIGN_MIN_AMOUNT_PER_TX: ${FOREIGN_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(FOREIGN_MIN_AMOUNT_PER_TX)} in eth + FOREIGN_DAILY_LIMIT : ${FOREIGN_DAILY_LIMIT} which is ${Web3Utils.fromWei( + FOREIGN_DAILY_LIMIT + )} in eth, + FOREIGN_MAX_AMOUNT_PER_TX: ${FOREIGN_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + FOREIGN_MAX_AMOUNT_PER_TX + )} in eth, + FOREIGN_MIN_AMOUNT_PER_TX: ${FOREIGN_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + FOREIGN_MIN_AMOUNT_PER_TX + )} in eth `) foreignBridgeImplementation.options.address = foreignBridgeStorage.options.address - const initializeFBridgeData = await foreignBridgeImplementation.methods.initialize( - storageValidatorsForeign.options.address, erc677bridgeToken.options.address, FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX, FOREIGN_GAS_PRICE, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS - ).encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const initializeFBridgeData = await foreignBridgeImplementation.methods + .initialize( + storageValidatorsForeign.options.address, + erc677bridgeToken.options.address, + FOREIGN_DAILY_LIMIT, + FOREIGN_MAX_AMOUNT_PER_TX, + FOREIGN_MIN_AMOUNT_PER_TX, + FOREIGN_GAS_PRICE, + FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS + ) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitializeBridge = await sendRawTx({ data: initializeFBridgeData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txInitializeBridge.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txInitializeBridge.status, '0x1', 'Transaction Failed') + foreignNonce++ console.log('transferring ownership of ERC677BridgeToken token to foreignBridge contract') - const txOwnershipData = await erc677bridgeToken.methods.transferOwnership(foreignBridgeStorage.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}) + const txOwnershipData = await erc677bridgeToken.methods + .transferOwnership(foreignBridgeStorage.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txOwnership = await sendRawTx({ data: txOwnershipData, nonce: foreignNonce, to: erc677bridgeToken.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txOwnership.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txOwnership.status, '0x1', 'Transaction Failed') + foreignNonce++ - const bridgeOwnershipData = await foreignBridgeStorage.methods.transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_BRIDGE) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const bridgeOwnershipData = await foreignBridgeStorage.methods + .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_BRIDGE) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txBridgeOwnershipData = await sendRawTx({ data: bridgeOwnershipData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL - }); - assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed'); - foreignNonce++; + }) + assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed') + foreignNonce++ return { - foreignBridge: - { - address: foreignBridgeStorage.options.address, - deployedBlockNumber: Web3Utils.hexToNumber(foreignBridgeStorage.deployedBlockNumber) - }, - erc677: {address: erc677bridgeToken.options.address} + foreignBridge: { + address: foreignBridgeStorage.options.address, + deployedBlockNumber: Web3Utils.hexToNumber(foreignBridgeStorage.deployedBlockNumber) + }, + erc677: { address: erc677bridgeToken.options.address } } } -module.exports = deployForeign; +module.exports = deployForeign diff --git a/deploy/src/native_to_erc/home.js b/deploy/src/native_to_erc/home.js index 0536ca534..d7c3b056e 100644 --- a/deploy/src/native_to_erc/home.js +++ b/deploy/src/native_to_erc/home.js @@ -1,19 +1,19 @@ const Web3Utils = require('web3-utils') require('dotenv').config({ - path: __dirname + '../../.env' -}); + path: `${__dirname}../../.env` +}) -const assert = require('assert'); +const assert = require('assert') -const {deployContract, privateKeyToAddress, sendRawTx} = require('../deploymentUtils'); -const {web3Home, deploymentPrivateKey, HOME_RPC_URL} = require('../web3'); +const { deployContract, privateKeyToAddress, sendRawTx } = require('../deploymentUtils') +const { web3Home, deploymentPrivateKey, HOME_RPC_URL } = require('../web3') -const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json'); +const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') const HomeBridge = require('../../../build/contracts/HomeBridgeNativeToErc.json') -const VALIDATORS = process.env.VALIDATORS.split(" ") -const HOME_GAS_PRICE = Web3Utils.toWei(process.env.HOME_GAS_PRICE, 'gwei'); +const VALIDATORS = process.env.VALIDATORS.split(' ') +const HOME_GAS_PRICE = Web3Utils.toWei(process.env.HOME_GAS_PRICE, 'gwei') const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -24,27 +24,33 @@ const { HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX, - HOME_REQUIRED_BLOCK_CONFIRMATIONS, -} = process.env; + HOME_REQUIRED_BLOCK_CONFIRMATIONS +} = process.env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) -async function deployHome() -{ - let homeNonce = await web3Home.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS); +async function deployHome() { + let homeNonce = await web3Home.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) console.log('deploying storage for home validators') - const storageValidatorsHome = await deployContract(EternalStorageProxy, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce: homeNonce}) + const storageValidatorsHome = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) console.log('[Home] BridgeValidators Storage: ', storageValidatorsHome.options.address) - homeNonce++; + homeNonce++ console.log('\ndeploying implementation for home validators') - let bridgeValidatorsHome = await deployContract(BridgeValidators, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce: homeNonce}) + const bridgeValidatorsHome = await deployContract(BridgeValidators, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) console.log('[Home] BridgeValidators Implementation: ', bridgeValidatorsHome.options.address) - homeNonce++; + homeNonce++ console.log('\nhooking up eternal storage to BridgeValidators') - const upgradeToBridgeVHomeData = await storageValidatorsHome.methods.upgradeTo('1', bridgeValidatorsHome.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const upgradeToBridgeVHomeData = await storageValidatorsHome.methods + .upgradeTo('1', bridgeValidatorsHome.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txUpgradeToBridgeVHome = await sendRawTx({ data: upgradeToBridgeVHomeData, nonce: homeNonce, @@ -52,15 +58,17 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToBridgeVHome.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txUpgradeToBridgeVHome.status, '0x1', 'Transaction Failed') + homeNonce++ console.log('\ninitializing Home Bridge Validators with following parameters:\n') - console.log(`REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}`) + console.log( + `REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}` + ) bridgeValidatorsHome.options.address = storageValidatorsHome.options.address - const initializeData = await bridgeValidatorsHome.methods.initialize( - REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, HOME_OWNER_MULTISIG - ).encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}) + const initializeData = await bridgeValidatorsHome.methods + .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, HOME_OWNER_MULTISIG) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitialize = await sendRawTx({ data: initializeData, nonce: homeNonce, @@ -68,11 +76,13 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txInitialize.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txInitialize.status, '0x1', 'Transaction Failed') + homeNonce++ - console.log('transferring proxy ownership to multisig for Validators Proxy contract'); - const proxyDataTransfer = await storageValidatorsHome.methods.transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_VALIDATORS).encodeABI(); + console.log('transferring proxy ownership to multisig for Validators Proxy contract') + const proxyDataTransfer = await storageValidatorsHome.methods + .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_VALIDATORS) + .encodeABI() const txProxyDataTransfer = await sendRawTx({ data: proxyDataTransfer, nonce: homeNonce, @@ -80,22 +90,29 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txProxyDataTransfer.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txProxyDataTransfer.status, '0x1', 'Transaction Failed') + homeNonce++ console.log('\ndeploying homeBridge storage\n') - const homeBridgeStorage = await deployContract(EternalStorageProxy, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce: homeNonce}) - homeNonce++; + const homeBridgeStorage = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) + homeNonce++ console.log('[Home] HomeBridge Storage: ', homeBridgeStorage.options.address) console.log('\ndeploying homeBridge implementation\n') - const homeBridgeImplementation = await deployContract(HomeBridge, [], {from: DEPLOYMENT_ACCOUNT_ADDRESS, nonce: homeNonce}) - homeNonce++; + const homeBridgeImplementation = await deployContract(HomeBridge, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) + homeNonce++ console.log('[Home] HomeBridge Implementation: ', homeBridgeImplementation.options.address) console.log('\nhooking up HomeBridge storage to HomeBridge implementation') - const upgradeToHomeBridgeData = await homeBridgeStorage.methods.upgradeTo('1', homeBridgeImplementation.options.address) - .encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const upgradeToHomeBridgeData = await homeBridgeStorage.methods + .upgradeTo('1', homeBridgeImplementation.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txUpgradeToHomeBridge = await sendRawTx({ data: upgradeToHomeBridgeData, nonce: homeNonce, @@ -103,32 +120,45 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToHomeBridge.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txUpgradeToHomeBridge.status, '0x1', 'Transaction Failed') + homeNonce++ console.log('\ninitializing Home Bridge with following parameters:\n') console.log(`Home Validators: ${storageValidatorsHome.options.address}, HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, - HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MAX_AMOUNT_PER_TX)} in eth, - HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei(HOME_MIN_AMOUNT_PER_TX)} in eth, + HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + HOME_MAX_AMOUNT_PER_TX + )} in eth, + HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + HOME_MIN_AMOUNT_PER_TX + )} in eth, HOME_GAS_PRICE: ${HOME_GAS_PRICE}, HOME_REQUIRED_BLOCK_CONFIRMATIONS : ${HOME_REQUIRED_BLOCK_CONFIRMATIONS} `) homeBridgeImplementation.options.address = homeBridgeStorage.options.address - const initializeHomeBridgeData = await homeBridgeImplementation.methods.initialize( - storageValidatorsHome.options.address, HOME_DAILY_LIMIT, HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX, HOME_GAS_PRICE, HOME_REQUIRED_BLOCK_CONFIRMATIONS - ).encodeABI({from: DEPLOYMENT_ACCOUNT_ADDRESS}); + const initializeHomeBridgeData = await homeBridgeImplementation.methods + .initialize( + storageValidatorsHome.options.address, + HOME_DAILY_LIMIT, + HOME_MAX_AMOUNT_PER_TX, + HOME_MIN_AMOUNT_PER_TX, + HOME_GAS_PRICE, + HOME_REQUIRED_BLOCK_CONFIRMATIONS + ) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitializeHomeBridge = await sendRawTx({ data: initializeHomeBridgeData, nonce: homeNonce, to: homeBridgeStorage.options.address, privateKey: deploymentPrivateKey, url: HOME_RPC_URL - }); - assert.equal(txInitializeHomeBridge.status, '0x1', 'Transaction Failed'); - homeNonce++; + }) + assert.equal(txInitializeHomeBridge.status, '0x1', 'Transaction Failed') + homeNonce++ - console.log('transferring proxy ownership to multisig for Home bridge Proxy contract'); - const homeBridgeProxyData = await homeBridgeStorage.methods.transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_BRIDGE).encodeABI(); + console.log('transferring proxy ownership to multisig for Home bridge Proxy contract') + const homeBridgeProxyData = await homeBridgeStorage.methods + .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_BRIDGE) + .encodeABI() const txhomeBridgeProxyData = await sendRawTx({ data: homeBridgeProxyData, nonce: homeNonce, @@ -136,14 +166,13 @@ async function deployHome() privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed'); - homeNonce++; + assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed') + homeNonce++ console.log('\nHome Deployment Bridge is complete\n') return { address: homeBridgeStorage.options.address, deployedBlockNumber: Web3Utils.hexToNumber(homeBridgeStorage.deployedBlockNumber) } - } -module.exports = deployHome; +module.exports = deployHome diff --git a/deploy/src/web3.js b/deploy/src/web3.js index d337ceaff..ef1acf639 100644 --- a/deploy/src/web3.js +++ b/deploy/src/web3.js @@ -1,24 +1,26 @@ require('dotenv').config({ - path: __dirname + '/../.env' -}); -const Web3Utils = require('web3-utils'); + path: `${__dirname}/../.env` +}) +const Web3Utils = require('web3-utils') +const Web3 = require('web3') -const HOME_RPC_URL = process.env.HOME_RPC_URL; -const FOREIGN_RPC_URL = process.env.FOREIGN_RPC_URL; -const Web3 = require('web3'); -const homeProvider = new Web3.providers.HttpProvider(HOME_RPC_URL); -const web3Home = new Web3(homeProvider); +const { + HOME_RPC_URL, + FOREIGN_RPC_URL, + GET_RECEIPT_INTERVAL_IN_MILLISECONDS, + DEPLOYMENT_ACCOUNT_PRIVATE_KEY +} = process.env -const foreignProvider = new Web3.providers.HttpProvider(FOREIGN_RPC_URL); -const web3Foreign = new Web3(foreignProvider); +const homeProvider = new Web3.providers.HttpProvider(HOME_RPC_URL) +const web3Home = new Web3(homeProvider) -const GAS_PRICE = Web3Utils.toWei(process.env.DEPLOYMENT_GAS_PRICE, 'gwei'); -const GAS_LIMIT = process.env.DEPLOYMENT_GAS_LIMIT; -const GET_RECEIPT_INTERVAL_IN_MILLISECONDS = process.env.GET_RECEIPT_INTERVAL_IN_MILLISECONDS; +const foreignProvider = new Web3.providers.HttpProvider(FOREIGN_RPC_URL) +const web3Foreign = new Web3(foreignProvider) -const DEPLOYMENT_ACCOUNT_PRIVATE_KEY = process.env.DEPLOYMENT_ACCOUNT_PRIVATE_KEY; -const deploymentPrivateKey = Buffer.from(DEPLOYMENT_ACCOUNT_PRIVATE_KEY, 'hex') +const GAS_PRICE = Web3Utils.toWei(process.env.DEPLOYMENT_GAS_PRICE, 'gwei') +const GAS_LIMIT = process.env.DEPLOYMENT_GAS_LIMIT +const deploymentPrivateKey = Buffer.from(DEPLOYMENT_ACCOUNT_PRIVATE_KEY, 'hex') module.exports = { web3Home, From f86f83c1a4460e783514edd5b77b30e97c147a80 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Thu, 20 Sep 2018 14:11:33 -0300 Subject: [PATCH 08/77] Add envalid --- deploy/deploy.js | 9 ++++----- deploy/package-lock.json | 28 ++++++++++++++++++++++++++++ deploy/package.json | 1 + deploy/src/erc_to_erc/foreign.js | 8 +++----- deploy/src/erc_to_erc/home.js | 13 +++++-------- deploy/src/loadEnv.js | 12 ++++++++++++ deploy/src/native_to_erc/foreign.js | 10 ++++------ deploy/src/native_to_erc/home.js | 10 ++++------ deploy/src/web3.js | 10 ++++------ 9 files changed, 65 insertions(+), 36 deletions(-) create mode 100644 deploy/src/loadEnv.js diff --git a/deploy/deploy.js b/deploy/deploy.js index 42108fd8a..b58bd464a 100644 --- a/deploy/deploy.js +++ b/deploy/deploy.js @@ -1,8 +1,8 @@ const fs = require('fs') const path = require('path') -require('dotenv').config({ - path: path.join(__dirname, '.env') -}) +const env = require('./src/loadEnv') + +const { BRIDGE_MODE, ERC20_TOKEN_ADDRESS } = env const deployResultsPath = path.join(__dirname, './bridgeDeploymentResults.json') @@ -54,7 +54,7 @@ async function deployErcToErc() { foreignBridge.deployedBlockNumber }` ) - console.log(`[ Foreign ] ERC20 Token: ${process.env.ERC20_TOKEN_ADDRESS}`) + console.log(`[ Foreign ] ERC20 Token: ${ERC20_TOKEN_ADDRESS}`) console.log(`[ Home ] ERC677 Bridgeble Token: ${erc677tokenAddress}`) fs.writeFileSync( deployResultsPath, @@ -76,7 +76,6 @@ async function deployErcToErc() { } async function main() { - const { BRIDGE_MODE } = process.env console.log(`Bridge mode: ${BRIDGE_MODE}`) switch (BRIDGE_MODE) { case 'NATIVE_TO_ERC': diff --git a/deploy/package-lock.json b/deploy/package-lock.json index 01d7b921a..8757c3596 100644 --- a/deploy/package-lock.json +++ b/deploy/package-lock.json @@ -879,6 +879,24 @@ "once": "^1.4.0" } }, + "envalid": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/envalid/-/envalid-4.1.4.tgz", + "integrity": "sha512-Xz1fNmcAFLQsUcYgoN2YmXkl9hGfLFXpvTHJKEBW/Nsqj+/4WoFnGf6wbdxJXIx5aKpdapf8XJCGrCRfrk2OZg==", + "requires": { + "chalk": "2.1.0", + "dotenv": "4.0.0", + "meant": "1.0.0", + "validator": "9.4.1" + }, + "dependencies": { + "dotenv": { + "version": "4.0.0", + "resolved": "http://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz", + "integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=" + } + } + }, "es-abstract": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", @@ -2073,6 +2091,11 @@ } } }, + "meant": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/meant/-/meant-1.0.0.tgz", + "integrity": "sha1-y2KG47evkxXxYRj9wiRybtOAdLs=" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -3566,6 +3589,11 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" }, + "validator": { + "version": "9.4.1", + "resolved": "http://registry.npmjs.org/validator/-/validator-9.4.1.tgz", + "integrity": "sha512-YV5KjzvRmSyJ1ee/Dm5UED0G+1L4GZnLN3w6/T+zZm8scVua4sOhYKWTUrKa0H/tMiJyO9QLHMPN+9mB/aMunA==" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/deploy/package.json b/deploy/package.json index 950b2da5e..121aa3d6c 100644 --- a/deploy/package.json +++ b/deploy/package.json @@ -11,6 +11,7 @@ "license": "ISC", "dependencies": { "dotenv": "^5.0.1", + "envalid": "^4.1.4", "ethereumjs-tx": "^1.3.4", "node-fetch": "^2.1.2", "pkg": "^4.3.1", diff --git a/deploy/src/erc_to_erc/foreign.js b/deploy/src/erc_to_erc/foreign.js index 473a3bfd5..a6dd2c935 100644 --- a/deploy/src/erc_to_erc/foreign.js +++ b/deploy/src/erc_to_erc/foreign.js @@ -1,7 +1,5 @@ const Web3Utils = require('web3-utils') -require('dotenv').config({ - path: `${__dirname}../../.env` -}) +const env = require('../loadEnv') const assert = require('assert') @@ -12,7 +10,7 @@ const EternalStorageProxy = require('../../../build/contracts/EternalStorageProx const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') const ForeignBridge = require('../../../build/contracts/ForeignBridgeErcToErc.json') -const VALIDATORS = process.env.VALIDATORS.split(' ') +const VALIDATORS = env.VALIDATORS.split(' ') const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -22,7 +20,7 @@ const { FOREIGN_UPGRADEABLE_ADMIN_BRIDGE, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, ERC20_TOKEN_ADDRESS -} = process.env +} = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) diff --git a/deploy/src/erc_to_erc/home.js b/deploy/src/erc_to_erc/home.js index 3c636c1d5..b18357d36 100644 --- a/deploy/src/erc_to_erc/home.js +++ b/deploy/src/erc_to_erc/home.js @@ -1,9 +1,6 @@ -const Web3Utils = require('web3-utils') -require('dotenv').config({ - path: `${__dirname}../../.env` -}) - const assert = require('assert') +const Web3Utils = require('web3-utils') +const env = require('../loadEnv') const { deployContract, privateKeyToAddress, sendRawTx } = require('../deploymentUtils') const { web3Home, deploymentPrivateKey, HOME_RPC_URL } = require('../web3') @@ -13,8 +10,8 @@ const BridgeValidators = require('../../../build/contracts/BridgeValidators.json const HomeBridge = require('../../../build/contracts/HomeBridgeErcToErc.json') const ERC677BridgeToken = require('../../../build/contracts/ERC677BridgeToken.json') -const VALIDATORS = process.env.VALIDATORS.split(' ') -const HOME_GAS_PRICE = Web3Utils.toWei(process.env.HOME_GAS_PRICE, 'gwei') +const VALIDATORS = env.VALIDATORS.split(' ') +const HOME_GAS_PRICE = Web3Utils.toWei(env.HOME_GAS_PRICE, 'gwei') const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -29,7 +26,7 @@ const { BRIDGEABLE_TOKEN_NAME, BRIDGEABLE_TOKEN_SYMBOL, BRIDGEABLE_TOKEN_DECIMALS -} = process.env +} = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js new file mode 100644 index 000000000..5496882e8 --- /dev/null +++ b/deploy/src/loadEnv.js @@ -0,0 +1,12 @@ +const path = require('path') +const envalid = require('envalid') +require('dotenv').config({ + path: path.join(__dirname, '', '.env') +}) + +const validBridgeModes = ['NATIVE_TO_ERC', 'ERC_TO_ERC'] +const env = envalid.cleanEnv(process.env, { + BRIDGE_MODE: envalid.str(validBridgeModes) +}) + +module.exports = env diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index 6733babab..11e8e496e 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -1,7 +1,5 @@ const Web3Utils = require('web3-utils') -require('dotenv').config({ - path: `${__dirname}../../.env` -}) +const env = require('../loadEnv') const assert = require('assert') @@ -13,8 +11,8 @@ const EternalStorageProxy = require('../../../build/contracts/EternalStorageProx const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') const ForeignBridge = require('../../../build/contracts/ForeignBridgeNativeToErc.json') -const VALIDATORS = process.env.VALIDATORS.split(' ') -const FOREIGN_GAS_PRICE = Web3Utils.toWei(process.env.FOREIGN_GAS_PRICE, 'gwei') +const VALIDATORS = env.VALIDATORS.split(' ') +const FOREIGN_GAS_PRICE = Web3Utils.toWei(env.FOREIGN_GAS_PRICE, 'gwei') const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -29,7 +27,7 @@ const { BRIDGEABLE_TOKEN_NAME, BRIDGEABLE_TOKEN_SYMBOL, BRIDGEABLE_TOKEN_DECIMALS -} = process.env +} = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) diff --git a/deploy/src/native_to_erc/home.js b/deploy/src/native_to_erc/home.js index d7c3b056e..24a68f263 100644 --- a/deploy/src/native_to_erc/home.js +++ b/deploy/src/native_to_erc/home.js @@ -1,7 +1,5 @@ const Web3Utils = require('web3-utils') -require('dotenv').config({ - path: `${__dirname}../../.env` -}) +const env = require('../loadEnv') const assert = require('assert') @@ -12,8 +10,8 @@ const EternalStorageProxy = require('../../../build/contracts/EternalStorageProx const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') const HomeBridge = require('../../../build/contracts/HomeBridgeNativeToErc.json') -const VALIDATORS = process.env.VALIDATORS.split(' ') -const HOME_GAS_PRICE = Web3Utils.toWei(process.env.HOME_GAS_PRICE, 'gwei') +const VALIDATORS = env.VALIDATORS.split(' ') +const HOME_GAS_PRICE = Web3Utils.toWei(env.HOME_GAS_PRICE, 'gwei') const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -25,7 +23,7 @@ const { HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX, HOME_REQUIRED_BLOCK_CONFIRMATIONS -} = process.env +} = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) diff --git a/deploy/src/web3.js b/deploy/src/web3.js index ef1acf639..b3ecc8dbc 100644 --- a/deploy/src/web3.js +++ b/deploy/src/web3.js @@ -1,15 +1,13 @@ -require('dotenv').config({ - path: `${__dirname}/../.env` -}) const Web3Utils = require('web3-utils') const Web3 = require('web3') +const env = require('./loadEnv') const { HOME_RPC_URL, FOREIGN_RPC_URL, GET_RECEIPT_INTERVAL_IN_MILLISECONDS, DEPLOYMENT_ACCOUNT_PRIVATE_KEY -} = process.env +} = env const homeProvider = new Web3.providers.HttpProvider(HOME_RPC_URL) const web3Home = new Web3(homeProvider) @@ -17,8 +15,8 @@ const web3Home = new Web3(homeProvider) const foreignProvider = new Web3.providers.HttpProvider(FOREIGN_RPC_URL) const web3Foreign = new Web3(foreignProvider) -const GAS_PRICE = Web3Utils.toWei(process.env.DEPLOYMENT_GAS_PRICE, 'gwei') -const GAS_LIMIT = process.env.DEPLOYMENT_GAS_LIMIT +const GAS_PRICE = Web3Utils.toWei(env.DEPLOYMENT_GAS_PRICE, 'gwei') +const GAS_LIMIT = env.DEPLOYMENT_GAS_LIMIT const deploymentPrivateKey = Buffer.from(DEPLOYMENT_ACCOUNT_PRIVATE_KEY, 'hex') From 4aa8f6ce4f4c27eeab99c2d1dd346ddc851c6748 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Thu, 20 Sep 2018 16:21:09 -0300 Subject: [PATCH 09/77] Improve environment variables validation --- deploy/src/loadEnv.js | 54 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index 5496882e8..a598f53d8 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -1,3 +1,4 @@ +const { isAddress, toBN } = require('web3').utils const path = require('path') const envalid = require('envalid') require('dotenv').config({ @@ -5,8 +6,59 @@ require('dotenv').config({ }) const validBridgeModes = ['NATIVE_TO_ERC', 'ERC_TO_ERC'] +const bigNumValidator = envalid.makeValidator(x => toBN(x)) +const validateAddress = address => { + if (isAddress(address)) { + return address + } + + throw new Error(`Invalid address: ${address}`) +} +const addressValidator = envalid.makeValidator(validateAddress) +const addressesValidator = envalid.makeValidator(addresses => { + addresses.split(' ').forEach(validateAddress) + return addresses +}) + const env = envalid.cleanEnv(process.env, { - BRIDGE_MODE: envalid.str(validBridgeModes) + BRIDGE_MODE: envalid.str(validBridgeModes), + DEPLOYMENT_ACCOUNT_PRIVATE_KEY: envalid.str(), + DEPLOYMENT_GAS_LIMIT: bigNumValidator(), + DEPLOYMENT_GAS_PRICE: bigNumValidator(), + GET_RECEIPT_INTERVAL_IN_MILLISECONDS: bigNumValidator(), + BRIDGEABLE_TOKEN_NAME: envalid.str(), + BRIDGEABLE_TOKEN_SYMBOL: envalid.str(), + BRIDGEABLE_TOKEN_DECIMALS: envalid.num(), + HOME_RPC_URL: envalid.str(), + HOME_OWNER_MULTISIG: addressValidator(), + HOME_UPGRADEABLE_ADMIN_VALIDATORS: addressesValidator(), + HOME_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), + HOME_DAILY_LIMIT: bigNumValidator(), + HOME_MAX_AMOUNT_PER_TX: bigNumValidator(), + HOME_MIN_AMOUNT_PER_TX: bigNumValidator(), + HOME_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), + HOME_GAS_PRICE: bigNumValidator(), + FOREIGN_RPC_URL: envalid.str(), + FOREIGN_OWNER_MULTISIG: addressValidator(), + FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS: addressValidator(), + FOREIGN_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), + FOREIGN_DAILY_LIMIT: bigNumValidator(), + FOREIGN_MAX_AMOUNT_PER_TX: bigNumValidator(), + FOREIGN_MIN_AMOUNT_PER_TX: bigNumValidator(), + FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), + FOREIGN_GAS_PRICE: bigNumValidator(), + REQUIRED_NUMBER_OF_VALIDATORS: envalid.num(), + VALIDATORS: addressesValidator(), + ERC20_TOKEN_ADDRESS: addressValidator({ + default: '0x0000000000000000000000000000000000000000' + }) }) +if ( + env.BRIDGE_MODE === 'ERC_TO_ERC' && + env.ERC20_TOKEN_ADDRESS === '0x0000000000000000000000000000000000000000' +) { + throw new Error('ERC_TO_ERC mode requires ERC20_TOKEN_ADDRESS to be set') +} + module.exports = env From 401a1dbeccfc45f8f9566a3cc44bf16e364ae19d Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Thu, 20 Sep 2018 17:06:21 -0300 Subject: [PATCH 10/77] Allow setting different gas price for each network --- deploy/.env.example | 3 ++- deploy/src/deploymentUtils.js | 29 ++++++++++++++++++++++++----- deploy/src/erc_to_erc/foreign.js | 17 ++++++++--------- deploy/src/erc_to_erc/home.js | 16 ++++++++-------- deploy/src/loadEnv.js | 3 ++- deploy/src/native_to_erc/foreign.js | 16 ++++++++-------- deploy/src/native_to_erc/home.js | 19 +++++++++---------- deploy/src/web3.js | 6 ++++-- 8 files changed, 65 insertions(+), 44 deletions(-) diff --git a/deploy/.env.example b/deploy/.env.example index 98a3a6386..8dc41a7bb 100644 --- a/deploy/.env.example +++ b/deploy/.env.example @@ -2,7 +2,8 @@ BRIDGE_MODE=NATIVE_TO_ERC DEPLOYMENT_ACCOUNT_PRIVATE_KEY=67..14 DEPLOYMENT_GAS_LIMIT=4000000 -DEPLOYMENT_GAS_PRICE=10 +HOME_DEPLOYMENT_GAS_PRICE=10 +FOREIGN_DEPLOYMENT_GAS_PRICE=10 GET_RECEIPT_INTERVAL_IN_MILLISECONDS=3000 BRIDGEABLE_TOKEN_NAME="Your New Bridged Token" diff --git a/deploy/src/deploymentUtils.js b/deploy/src/deploymentUtils.js index 915f1c4d5..61a538a6c 100644 --- a/deploy/src/deploymentUtils.js +++ b/deploy/src/deploymentUtils.js @@ -10,23 +10,27 @@ const { FOREIGN_RPC_URL, HOME_RPC_URL, GAS_LIMIT, - GAS_PRICE, + HOME_GAS_PRICE, + FOREIGN_GAS_PRICE, GET_RECEIPT_INTERVAL_IN_MILLISECONDS } = require('./web3') async function deployContract(contractJson, args, { from, network, nonce }) { let web3 let url + let gasPrice if (network === 'foreign') { web3 = web3Foreign url = FOREIGN_RPC_URL + gasPrice = FOREIGN_GAS_PRICE } else { web3 = web3Home url = HOME_RPC_URL + gasPrice = HOME_GAS_PRICE } const options = { from, - gasPrice: GAS_PRICE + gasPrice } const instance = new web3.eth.Contract(contractJson.abi, options) const result = await instance @@ -50,11 +54,25 @@ async function deployContract(contractJson, args, { from, network, nonce }) { return instance } -async function sendRawTx({ data, nonce, to, privateKey, url }) { +async function sendRawTxHome(options) { + return sendRawTx({ + ...options, + gasPrice: HOME_GAS_PRICE + }) +} + +async function sendRawTxForeign(options) { + return sendRawTx({ + ...options, + gasPrice: FOREIGN_GAS_PRICE + }) +} + +async function sendRawTx({ data, nonce, to, privateKey, url, gasPrice }) { try { const rawTx = { nonce, - gasPrice: Web3Utils.toHex(GAS_PRICE), + gasPrice: Web3Utils.toHex(gasPrice), gasLimit: Web3Utils.toHex(GAS_LIMIT), to, data @@ -125,6 +143,7 @@ module.exports = { deployContract, sendNodeRequest, getReceipt, - sendRawTx, + sendRawTxHome, + sendRawTxForeign, privateKeyToAddress } diff --git a/deploy/src/erc_to_erc/foreign.js b/deploy/src/erc_to_erc/foreign.js index a6dd2c935..91c1b0f68 100644 --- a/deploy/src/erc_to_erc/foreign.js +++ b/deploy/src/erc_to_erc/foreign.js @@ -1,9 +1,8 @@ +const assert = require('assert') const Web3Utils = require('web3-utils') const env = require('../loadEnv') -const assert = require('assert') - -const { deployContract, privateKeyToAddress, sendRawTx } = require('../deploymentUtils') +const { deployContract, privateKeyToAddress, sendRawTxForeign } = require('../deploymentUtils') const { web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL } = require('../web3') const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') @@ -58,7 +57,7 @@ async function deployForeign() { const upgradeToBridgeVForeignData = await storageValidatorsForeign.methods .upgradeTo('1', bridgeValidatorsForeign.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txUpgradeToBridgeVForeign = await sendRawTx({ + const txUpgradeToBridgeVForeign = await sendRawTxForeign({ data: upgradeToBridgeVForeignData, nonce: foreignNonce, to: storageValidatorsForeign.options.address, @@ -76,7 +75,7 @@ async function deployForeign() { const initializeForeignData = await bridgeValidatorsForeign.methods .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, FOREIGN_OWNER_MULTISIG) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txInitializeForeign = await sendRawTx({ + const txInitializeForeign = await sendRawTxForeign({ data: initializeForeignData, nonce: foreignNonce, to: bridgeValidatorsForeign.options.address, @@ -90,7 +89,7 @@ async function deployForeign() { const validatorsForeignOwnershipData = await storageValidatorsForeign.methods .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txValidatorsForeignOwnershipData = await sendRawTx({ + const txValidatorsForeignOwnershipData = await sendRawTxForeign({ data: validatorsForeignOwnershipData, nonce: foreignNonce, to: storageValidatorsForeign.options.address, @@ -125,7 +124,7 @@ async function deployForeign() { const upgradeToForeignBridgeData = await foreignBridgeStorage.methods .upgradeTo('1', foreignBridgeImplementation.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txUpgradeToForeignBridge = await sendRawTx({ + const txUpgradeToForeignBridge = await sendRawTxForeign({ data: upgradeToForeignBridgeData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, @@ -146,7 +145,7 @@ async function deployForeign() { FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS ) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txInitializeBridge = await sendRawTx({ + const txInitializeBridge = await sendRawTxForeign({ data: initializeFBridgeData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, @@ -159,7 +158,7 @@ async function deployForeign() { const bridgeOwnershipData = await foreignBridgeStorage.methods .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_BRIDGE) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txBridgeOwnershipData = await sendRawTx({ + const txBridgeOwnershipData = await sendRawTxForeign({ data: bridgeOwnershipData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, diff --git a/deploy/src/erc_to_erc/home.js b/deploy/src/erc_to_erc/home.js index b18357d36..46dad39a8 100644 --- a/deploy/src/erc_to_erc/home.js +++ b/deploy/src/erc_to_erc/home.js @@ -2,7 +2,7 @@ const assert = require('assert') const Web3Utils = require('web3-utils') const env = require('../loadEnv') -const { deployContract, privateKeyToAddress, sendRawTx } = require('../deploymentUtils') +const { deployContract, privateKeyToAddress, sendRawTxHome } = require('../deploymentUtils') const { web3Home, deploymentPrivateKey, HOME_RPC_URL } = require('../web3') const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') @@ -52,7 +52,7 @@ async function deployHome() { const upgradeToBridgeVHomeData = await storageValidatorsHome.methods .upgradeTo('1', bridgeValidatorsHome.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txUpgradeToBridgeVHome = await sendRawTx({ + const txUpgradeToBridgeVHome = await sendRawTxHome({ data: upgradeToBridgeVHomeData, nonce: homeNonce, to: storageValidatorsHome.options.address, @@ -70,7 +70,7 @@ async function deployHome() { const initializeData = await bridgeValidatorsHome.methods .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, HOME_OWNER_MULTISIG) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txInitialize = await sendRawTx({ + const txInitialize = await sendRawTxHome({ data: initializeData, nonce: homeNonce, to: bridgeValidatorsHome.options.address, @@ -84,7 +84,7 @@ async function deployHome() { const proxyDataTransfer = await storageValidatorsHome.methods .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_VALIDATORS) .encodeABI() - const txProxyDataTransfer = await sendRawTx({ + const txProxyDataTransfer = await sendRawTxHome({ data: proxyDataTransfer, nonce: homeNonce, to: storageValidatorsHome.options.address, @@ -114,7 +114,7 @@ async function deployHome() { const upgradeToHomeBridgeData = await homeBridgeStorage.methods .upgradeTo('1', homeBridgeImplementation.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txUpgradeToHomeBridge = await sendRawTx({ + const txUpgradeToHomeBridge = await sendRawTxHome({ data: upgradeToHomeBridgeData, nonce: homeNonce, to: homeBridgeStorage.options.address, @@ -137,7 +137,7 @@ async function deployHome() { const txOwnershipData = await erc677token.methods .transferOwnership(homeBridgeStorage.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txOwnership = await sendRawTx({ + const txOwnership = await sendRawTxHome({ data: txOwnershipData, nonce: homeNonce, to: erc677token.options.address, @@ -170,7 +170,7 @@ async function deployHome() { erc677token.options.address ) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txInitializeHomeBridge = await sendRawTx({ + const txInitializeHomeBridge = await sendRawTxHome({ data: initializeHomeBridgeData, nonce: homeNonce, to: homeBridgeStorage.options.address, @@ -184,7 +184,7 @@ async function deployHome() { const homeBridgeProxyData = await homeBridgeStorage.methods .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_BRIDGE) .encodeABI() - const txhomeBridgeProxyData = await sendRawTx({ + const txhomeBridgeProxyData = await sendRawTxHome({ data: homeBridgeProxyData, nonce: homeNonce, to: homeBridgeStorage.options.address, diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index a598f53d8..dad255487 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -24,7 +24,8 @@ const env = envalid.cleanEnv(process.env, { BRIDGE_MODE: envalid.str(validBridgeModes), DEPLOYMENT_ACCOUNT_PRIVATE_KEY: envalid.str(), DEPLOYMENT_GAS_LIMIT: bigNumValidator(), - DEPLOYMENT_GAS_PRICE: bigNumValidator(), + HOME_DEPLOYMENT_GAS_PRICE: bigNumValidator(), + FOREIGN_DEPLOYMENT_GAS_PRICE: bigNumValidator(), GET_RECEIPT_INTERVAL_IN_MILLISECONDS: bigNumValidator(), BRIDGEABLE_TOKEN_NAME: envalid.str(), BRIDGEABLE_TOKEN_SYMBOL: envalid.str(), diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index 11e8e496e..6ed2b864b 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -3,7 +3,7 @@ const env = require('../loadEnv') const assert = require('assert') -const { deployContract, privateKeyToAddress, sendRawTx } = require('../deploymentUtils') +const { deployContract, privateKeyToAddress, sendRawTxForeign } = require('../deploymentUtils') const { web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL } = require('../web3') const ERC677BridgeToken = require('../../../build/contracts/ERC677BridgeToken.json') @@ -71,7 +71,7 @@ async function deployForeign() { const upgradeToBridgeVForeignData = await storageValidatorsForeign.methods .upgradeTo('1', bridgeValidatorsForeign.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txUpgradeToBridgeVForeign = await sendRawTx({ + const txUpgradeToBridgeVForeign = await sendRawTxForeign({ data: upgradeToBridgeVForeignData, nonce: foreignNonce, to: storageValidatorsForeign.options.address, @@ -89,7 +89,7 @@ async function deployForeign() { const initializeForeignData = await bridgeValidatorsForeign.methods .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, FOREIGN_OWNER_MULTISIG) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txInitializeForeign = await sendRawTx({ + const txInitializeForeign = await sendRawTxForeign({ data: initializeForeignData, nonce: foreignNonce, to: bridgeValidatorsForeign.options.address, @@ -103,7 +103,7 @@ async function deployForeign() { const validatorsForeignOwnershipData = await storageValidatorsForeign.methods .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txValidatorsForeignOwnershipData = await sendRawTx({ + const txValidatorsForeignOwnershipData = await sendRawTxForeign({ data: validatorsForeignOwnershipData, nonce: foreignNonce, to: storageValidatorsForeign.options.address, @@ -138,7 +138,7 @@ async function deployForeign() { const upgradeToForeignBridgeData = await foreignBridgeStorage.methods .upgradeTo('1', foreignBridgeImplementation.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txUpgradeToForeignBridge = await sendRawTx({ + const txUpgradeToForeignBridge = await sendRawTxForeign({ data: upgradeToForeignBridgeData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, @@ -172,7 +172,7 @@ async function deployForeign() { FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS ) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txInitializeBridge = await sendRawTx({ + const txInitializeBridge = await sendRawTxForeign({ data: initializeFBridgeData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, @@ -186,7 +186,7 @@ async function deployForeign() { const txOwnershipData = await erc677bridgeToken.methods .transferOwnership(foreignBridgeStorage.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txOwnership = await sendRawTx({ + const txOwnership = await sendRawTxForeign({ data: txOwnershipData, nonce: foreignNonce, to: erc677bridgeToken.options.address, @@ -199,7 +199,7 @@ async function deployForeign() { const bridgeOwnershipData = await foreignBridgeStorage.methods .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_BRIDGE) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txBridgeOwnershipData = await sendRawTx({ + const txBridgeOwnershipData = await sendRawTxForeign({ data: bridgeOwnershipData, nonce: foreignNonce, to: foreignBridgeStorage.options.address, diff --git a/deploy/src/native_to_erc/home.js b/deploy/src/native_to_erc/home.js index 24a68f263..c085efe49 100644 --- a/deploy/src/native_to_erc/home.js +++ b/deploy/src/native_to_erc/home.js @@ -1,9 +1,8 @@ -const Web3Utils = require('web3-utils') -const env = require('../loadEnv') - const assert = require('assert') +const Web3Utils = require('web3-utils') -const { deployContract, privateKeyToAddress, sendRawTx } = require('../deploymentUtils') +const env = require('../loadEnv') +const { deployContract, privateKeyToAddress, sendRawTxHome } = require('../deploymentUtils') const { web3Home, deploymentPrivateKey, HOME_RPC_URL } = require('../web3') const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') @@ -49,7 +48,7 @@ async function deployHome() { const upgradeToBridgeVHomeData = await storageValidatorsHome.methods .upgradeTo('1', bridgeValidatorsHome.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txUpgradeToBridgeVHome = await sendRawTx({ + const txUpgradeToBridgeVHome = await sendRawTxHome({ data: upgradeToBridgeVHomeData, nonce: homeNonce, to: storageValidatorsHome.options.address, @@ -67,7 +66,7 @@ async function deployHome() { const initializeData = await bridgeValidatorsHome.methods .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, HOME_OWNER_MULTISIG) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txInitialize = await sendRawTx({ + const txInitialize = await sendRawTxHome({ data: initializeData, nonce: homeNonce, to: bridgeValidatorsHome.options.address, @@ -81,7 +80,7 @@ async function deployHome() { const proxyDataTransfer = await storageValidatorsHome.methods .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_VALIDATORS) .encodeABI() - const txProxyDataTransfer = await sendRawTx({ + const txProxyDataTransfer = await sendRawTxHome({ data: proxyDataTransfer, nonce: homeNonce, to: storageValidatorsHome.options.address, @@ -111,7 +110,7 @@ async function deployHome() { const upgradeToHomeBridgeData = await homeBridgeStorage.methods .upgradeTo('1', homeBridgeImplementation.options.address) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txUpgradeToHomeBridge = await sendRawTx({ + const txUpgradeToHomeBridge = await sendRawTxHome({ data: upgradeToHomeBridgeData, nonce: homeNonce, to: homeBridgeStorage.options.address, @@ -143,7 +142,7 @@ async function deployHome() { HOME_REQUIRED_BLOCK_CONFIRMATIONS ) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) - const txInitializeHomeBridge = await sendRawTx({ + const txInitializeHomeBridge = await sendRawTxHome({ data: initializeHomeBridgeData, nonce: homeNonce, to: homeBridgeStorage.options.address, @@ -157,7 +156,7 @@ async function deployHome() { const homeBridgeProxyData = await homeBridgeStorage.methods .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_BRIDGE) .encodeABI() - const txhomeBridgeProxyData = await sendRawTx({ + const txhomeBridgeProxyData = await sendRawTxHome({ data: homeBridgeProxyData, nonce: homeNonce, to: homeBridgeStorage.options.address, diff --git a/deploy/src/web3.js b/deploy/src/web3.js index b3ecc8dbc..bc31a1af8 100644 --- a/deploy/src/web3.js +++ b/deploy/src/web3.js @@ -15,7 +15,8 @@ const web3Home = new Web3(homeProvider) const foreignProvider = new Web3.providers.HttpProvider(FOREIGN_RPC_URL) const web3Foreign = new Web3(foreignProvider) -const GAS_PRICE = Web3Utils.toWei(env.DEPLOYMENT_GAS_PRICE, 'gwei') +const HOME_GAS_PRICE = Web3Utils.toWei(env.HOME_DEPLOYMENT_GAS_PRICE, 'gwei') +const FOREIGN_GAS_PRICE = Web3Utils.toWei(env.FOREIGN_DEPLOYMENT_GAS_PRICE, 'gwei') const GAS_LIMIT = env.DEPLOYMENT_GAS_LIMIT const deploymentPrivateKey = Buffer.from(DEPLOYMENT_ACCOUNT_PRIVATE_KEY, 'hex') @@ -27,6 +28,7 @@ module.exports = { HOME_RPC_URL, FOREIGN_RPC_URL, GAS_LIMIT, - GAS_PRICE, + HOME_GAS_PRICE, + FOREIGN_GAS_PRICE, GET_RECEIPT_INTERVAL_IN_MILLISECONDS } From c36af23bf2e3e670498c12dd96214d470af095eb Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 21 Sep 2018 16:33:33 -0300 Subject: [PATCH 11/77] Fix setBlockRewardContract method --- .../upgradeable_contracts/BasicBridge.sol | 7 +++++++ .../erc20_to_native/HomeBridgeErcToNative.sol | 7 ++++--- test/erc_to_native/home_bridge.test.js | 21 +++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/contracts/upgradeable_contracts/BasicBridge.sol b/contracts/upgradeable_contracts/BasicBridge.sol index 244b55c3e..cc0e06e8b 100644 --- a/contracts/upgradeable_contracts/BasicBridge.sol +++ b/contracts/upgradeable_contracts/BasicBridge.sol @@ -104,4 +104,11 @@ contract BasicBridge is EternalStorage, Validatable { require(token.transfer(_to, balance)); } + + function isContract(address _addr) internal view returns (bool) + { + uint length; + assembly { length := extcodesize(_addr) } + return length > 0; + } } diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index 3483ba55e..306e3b8ab 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -37,6 +37,7 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { require(_homeGasPrice > 0); require(_requiredBlockConfirmations > 0); require(_minPerTx > 0 && _maxPerTx > _minPerTx && _dailyLimit > _maxPerTx); + require(_blockReward != address(0) && isContract(_blockReward)); addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; uintStorage[keccak256(abi.encodePacked("deployedAtBlock"))] = block.number; uintStorage[keccak256(abi.encodePacked("dailyLimit"))] = _dailyLimit; @@ -44,7 +45,7 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { uintStorage[keccak256(abi.encodePacked("minPerTx"))] = _minPerTx; uintStorage[keccak256(abi.encodePacked("gasPrice"))] = _homeGasPrice; uintStorage[keccak256(abi.encodePacked("requiredBlockConfirmations"))] = _requiredBlockConfirmations; - setBlockRewardContract(_blockReward); + addressStorage[keccak256(abi.encodePacked("blockRewardContract"))] = _blockReward; setInitialize(true); return isInitialized(); @@ -62,8 +63,8 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { return uintStorage[keccak256(abi.encodePacked("totalBurntCoins"))]; } - function setBlockRewardContract(address _blockReward) internal { - require(_blockReward != address(0)); + function setBlockRewardContract(address _blockReward) public onlyOwner { + require(_blockReward != address(0) && isContract(_blockReward)); addressStorage[keccak256(abi.encodePacked("blockRewardContract"))] = _blockReward; } diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index b847eb820..1ffc29bea 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -50,6 +50,27 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { minor.should.be.bignumber.gte(0) patch.should.be.bignumber.gte(0) }) + + it('can update block reward contract', async () => { + ZERO_ADDRESS.should.be.equal(await homeContract.blockRewardContract()) + + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address).should.be.fulfilled + + blockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) + + const secondBlockRewardContract = await BlockReward.new() + await homeContract.setBlockRewardContract(secondBlockRewardContract.address) + secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) + + const thirdBlockRewardContract = await BlockReward.new() + await homeContract.setBlockRewardContract(thirdBlockRewardContract.address, {from: accounts[4]}).should.be.rejectedWith(ERROR_MSG) + secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) + + const notAContract = accounts[5] + await homeContract.setBlockRewardContract(notAContract).should.be.rejectedWith(ERROR_MSG) + secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) + }) + it('cant set maxPerTx > dailyLimit', async () => { false.should.be.equal(await homeContract.isInitialized()) From 195f23c613f89a643f8092885f9929dea6b344b9 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Fri, 21 Sep 2018 17:45:51 -0300 Subject: [PATCH 12/77] Add support for deploying ERC_TO_NATIVE mode --- deploy/deploy.js | 38 ++++++ deploy/src/deploymentUtils.js | 5 +- deploy/src/erc_to_native/foreign.js | 179 +++++++++++++++++++++++++ deploy/src/erc_to_native/home.js | 201 ++++++++++++++++++++++++++++ deploy/src/loadEnv.js | 5 +- deploy/src/native_to_erc/foreign.js | 3 +- 6 files changed, 426 insertions(+), 5 deletions(-) create mode 100644 deploy/src/erc_to_native/foreign.js create mode 100644 deploy/src/erc_to_native/home.js diff --git a/deploy/deploy.js b/deploy/deploy.js index b58bd464a..076ea33cf 100644 --- a/deploy/deploy.js +++ b/deploy/deploy.js @@ -75,6 +75,41 @@ async function deployErcToErc() { console.log('Contracts Deployment have been saved to `bridgeDeploymentResults.json`') } +async function deployErcToNative() { + const deployHome = require('./src/erc_to_native/home') + const deployForeign = require('./src/erc_to_native/foreign') + + const homeBridge = await deployHome() + const { foreignBridge } = await deployForeign() + console.log('\nDeployment has been completed.\n\n') + console.log( + `[ Home ] HomeBridge: ${homeBridge.homeBridgeAddress} at block ${ + homeBridge.deployedBlockNumber + }` + ) + console.log( + `[ Foreign ] ForeignBridge: ${foreignBridge.address} at block ${ + foreignBridge.deployedBlockNumber + }` + ) + fs.writeFileSync( + deployResultsPath, + JSON.stringify( + { + homeBridge: { + ...homeBridge + }, + foreignBridge: { + ...foreignBridge + } + }, + null, + 4 + ) + ) + console.log('Contracts Deployment have been saved to `bridgeDeploymentResults.json`') +} + async function main() { console.log(`Bridge mode: ${BRIDGE_MODE}`) switch (BRIDGE_MODE) { @@ -84,6 +119,9 @@ async function main() { case 'ERC_TO_ERC': await deployErcToErc() break + case 'ERC_TO_NATIVE': + await deployErcToNative() + break default: console.log(BRIDGE_MODE) throw new Error('Please specify BRIDGE_MODE: NATIVE_TO_ERC or ERC_TO_ERC') diff --git a/deploy/src/deploymentUtils.js b/deploy/src/deploymentUtils.js index 61a538a6c..0f30a9e74 100644 --- a/deploy/src/deploymentUtils.js +++ b/deploy/src/deploymentUtils.js @@ -68,14 +68,15 @@ async function sendRawTxForeign(options) { }) } -async function sendRawTx({ data, nonce, to, privateKey, url, gasPrice }) { +async function sendRawTx({ data, nonce, to, privateKey, url, gasPrice, value }) { try { const rawTx = { nonce, gasPrice: Web3Utils.toHex(gasPrice), gasLimit: Web3Utils.toHex(GAS_LIMIT), to, - data + data, + value } const tx = new Tx(rawTx) diff --git a/deploy/src/erc_to_native/foreign.js b/deploy/src/erc_to_native/foreign.js new file mode 100644 index 000000000..c2b52484f --- /dev/null +++ b/deploy/src/erc_to_native/foreign.js @@ -0,0 +1,179 @@ +const assert = require('assert') +const Web3Utils = require('web3-utils') +const env = require('../loadEnv') + +const { deployContract, privateKeyToAddress, sendRawTxForeign } = require('../deploymentUtils') +const { web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL } = require('../web3') + +const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') +const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') +const ForeignBridge = require('../../../build/contracts/ForeignBridgeErcToNative.json') + +const VALIDATORS = env.VALIDATORS.split(' ') + +const { + DEPLOYMENT_ACCOUNT_PRIVATE_KEY, + REQUIRED_NUMBER_OF_VALIDATORS, + FOREIGN_OWNER_MULTISIG, + FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS, + FOREIGN_UPGRADEABLE_ADMIN_BRIDGE, + FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, + ERC20_TOKEN_ADDRESS +} = env + +const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) + +async function deployForeign() { + if (!Web3Utils.isAddress(ERC20_TOKEN_ADDRESS)) { + throw new Error('ERC20_TOKEN_ADDRESS env var is not defined') + } + let foreignNonce = await web3Foreign.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) + console.log('========================================') + console.log('deploying ForeignBridge') + console.log('========================================\n') + + console.log('deploying storage for foreign validators') + const storageValidatorsForeign = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ + console.log('[Foreign] BridgeValidators Storage: ', storageValidatorsForeign.options.address) + + console.log('\ndeploying implementation for foreign validators') + const bridgeValidatorsForeign = await deployContract(BridgeValidators, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ + console.log( + '[Foreign] BridgeValidators Implementation: ', + bridgeValidatorsForeign.options.address + ) + + console.log('\nhooking up eternal storage to BridgeValidators') + const upgradeToBridgeVForeignData = await storageValidatorsForeign.methods + .upgradeTo('1', bridgeValidatorsForeign.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txUpgradeToBridgeVForeign = await sendRawTxForeign({ + data: upgradeToBridgeVForeignData, + nonce: foreignNonce, + to: storageValidatorsForeign.options.address, + privateKey: deploymentPrivateKey, + url: FOREIGN_RPC_URL + }) + assert.equal(txUpgradeToBridgeVForeign.status, '0x1', 'Transaction Failed') + foreignNonce++ + + console.log('\ninitializing Foreign Bridge Validators with following parameters:\n') + console.log( + `REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}` + ) + bridgeValidatorsForeign.options.address = storageValidatorsForeign.options.address + const initializeForeignData = await bridgeValidatorsForeign.methods + .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, FOREIGN_OWNER_MULTISIG) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txInitializeForeign = await sendRawTxForeign({ + data: initializeForeignData, + nonce: foreignNonce, + to: bridgeValidatorsForeign.options.address, + privateKey: deploymentPrivateKey, + url: FOREIGN_RPC_URL + }) + assert.equal(txInitializeForeign.status, '0x1', 'Transaction Failed') + foreignNonce++ + + console.log('\nTransferring ownership of ValidatorsProxy\n') + const validatorsForeignOwnershipData = await storageValidatorsForeign.methods + .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txValidatorsForeignOwnershipData = await sendRawTxForeign({ + data: validatorsForeignOwnershipData, + nonce: foreignNonce, + to: storageValidatorsForeign.options.address, + privateKey: deploymentPrivateKey, + url: FOREIGN_RPC_URL + }) + assert.equal(txValidatorsForeignOwnershipData.status, '0x1', 'Transaction Failed') + foreignNonce++ + + console.log('\ndeploying foreignBridge storage\n') + const foreignBridgeStorage = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ + console.log('[Foreign] ForeignBridge Storage: ', foreignBridgeStorage.options.address) + + console.log('\ndeploying foreignBridge implementation\n') + const foreignBridgeImplementation = await deployContract(ForeignBridge, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'foreign', + nonce: foreignNonce + }) + foreignNonce++ + console.log( + '[Foreign] ForeignBridge Implementation: ', + foreignBridgeImplementation.options.address + ) + + console.log('\nhooking up ForeignBridge storage to ForeignBridge implementation') + const upgradeToForeignBridgeData = await foreignBridgeStorage.methods + .upgradeTo('1', foreignBridgeImplementation.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txUpgradeToForeignBridge = await sendRawTxForeign({ + data: upgradeToForeignBridgeData, + nonce: foreignNonce, + to: foreignBridgeStorage.options.address, + privateKey: deploymentPrivateKey, + url: FOREIGN_RPC_URL + }) + assert.equal(txUpgradeToForeignBridge.status, '0x1', 'Transaction Failed') + foreignNonce++ + + console.log('\ninitializing Foreign Bridge with following parameters:\n') + console.log(`Foreign Validators: ${storageValidatorsForeign.options.address}, + `) + foreignBridgeImplementation.options.address = foreignBridgeStorage.options.address + const initializeFBridgeData = await foreignBridgeImplementation.methods + .initialize( + storageValidatorsForeign.options.address, + ERC20_TOKEN_ADDRESS, + FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS + ) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txInitializeBridge = await sendRawTxForeign({ + data: initializeFBridgeData, + nonce: foreignNonce, + to: foreignBridgeStorage.options.address, + privateKey: deploymentPrivateKey, + url: FOREIGN_RPC_URL + }) + assert.equal(txInitializeBridge.status, '0x1', 'Transaction Failed') + foreignNonce++ + + const bridgeOwnershipData = await foreignBridgeStorage.methods + .transferProxyOwnership(FOREIGN_UPGRADEABLE_ADMIN_BRIDGE) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txBridgeOwnershipData = await sendRawTxForeign({ + data: bridgeOwnershipData, + nonce: foreignNonce, + to: foreignBridgeStorage.options.address, + privateKey: deploymentPrivateKey, + url: FOREIGN_RPC_URL + }) + assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed') + foreignNonce++ + + return { + foreignBridge: { + address: foreignBridgeStorage.options.address, + deployedBlockNumber: Web3Utils.hexToNumber(foreignBridgeStorage.deployedBlockNumber) + } + } +} + +module.exports = deployForeign diff --git a/deploy/src/erc_to_native/home.js b/deploy/src/erc_to_native/home.js new file mode 100644 index 000000000..04d3e8e6b --- /dev/null +++ b/deploy/src/erc_to_native/home.js @@ -0,0 +1,201 @@ +const assert = require('assert') +const Web3Utils = require('web3-utils') +const env = require('../loadEnv') + +const { deployContract, privateKeyToAddress, sendRawTxHome } = require('../deploymentUtils') +const { web3Home, deploymentPrivateKey, HOME_RPC_URL } = require('../web3') + +const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') +const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') +const HomeBridge = require('../../../build/contracts/HomeBridgeErcToNative.json') +const BlockReward = require('../../../build/contracts/BlockReward.json') + +const VALIDATORS = env.VALIDATORS.split(' ') +const HOME_GAS_PRICE = Web3Utils.toWei(env.HOME_GAS_PRICE, 'gwei') + +const { + BLOCK_REWARD_ADDRESS, + DEPLOYMENT_ACCOUNT_PRIVATE_KEY, + REQUIRED_NUMBER_OF_VALIDATORS, + HOME_OWNER_MULTISIG, + HOME_UPGRADEABLE_ADMIN_VALIDATORS, + HOME_UPGRADEABLE_ADMIN_BRIDGE, + HOME_DAILY_LIMIT, + HOME_MAX_AMOUNT_PER_TX, + HOME_MIN_AMOUNT_PER_TX, + HOME_REQUIRED_BLOCK_CONFIRMATIONS +} = env + +const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) + +async function deployHome() { + let homeNonce = await web3Home.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) + console.log('deploying storage for home validators') + const storageValidatorsHome = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) + console.log('[Home] BridgeValidators Storage: ', storageValidatorsHome.options.address) + homeNonce++ + + console.log('\ndeploying implementation for home validators') + const bridgeValidatorsHome = await deployContract(BridgeValidators, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) + console.log('[Home] BridgeValidators Implementation: ', bridgeValidatorsHome.options.address) + homeNonce++ + + console.log('\nhooking up eternal storage to BridgeValidators') + const upgradeToBridgeVHomeData = await storageValidatorsHome.methods + .upgradeTo('1', bridgeValidatorsHome.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txUpgradeToBridgeVHome = await sendRawTxHome({ + data: upgradeToBridgeVHomeData, + nonce: homeNonce, + to: storageValidatorsHome.options.address, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL + }) + assert.equal(txUpgradeToBridgeVHome.status, '0x1', 'Transaction Failed') + homeNonce++ + + console.log('\ninitializing Home Bridge Validators with following parameters:\n') + console.log( + `REQUIRED_NUMBER_OF_VALIDATORS: ${REQUIRED_NUMBER_OF_VALIDATORS}, VALIDATORS: ${VALIDATORS}` + ) + bridgeValidatorsHome.options.address = storageValidatorsHome.options.address + const initializeData = await bridgeValidatorsHome.methods + .initialize(REQUIRED_NUMBER_OF_VALIDATORS, VALIDATORS, HOME_OWNER_MULTISIG) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txInitialize = await sendRawTxHome({ + data: initializeData, + nonce: homeNonce, + to: bridgeValidatorsHome.options.address, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL + }) + assert.equal(txInitialize.status, '0x1', 'Transaction Failed') + homeNonce++ + + console.log('transferring proxy ownership to multisig for Validators Proxy contract') + const proxyDataTransfer = await storageValidatorsHome.methods + .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_VALIDATORS) + .encodeABI() + const txProxyDataTransfer = await sendRawTxHome({ + data: proxyDataTransfer, + nonce: homeNonce, + to: storageValidatorsHome.options.address, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL + }) + assert.equal(txProxyDataTransfer.status, '0x1', 'Transaction Failed') + homeNonce++ + + console.log('\ndeploying homeBridge storage\n') + const homeBridgeStorage = await deployContract(EternalStorageProxy, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) + homeNonce++ + console.log('[Home] HomeBridge Storage: ', homeBridgeStorage.options.address) + + console.log('\ndeploying homeBridge implementation\n') + const homeBridgeImplementation = await deployContract(HomeBridge, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + nonce: homeNonce + }) + homeNonce++ + console.log('[Home] HomeBridge Implementation: ', homeBridgeImplementation.options.address) + + console.log('\nhooking up HomeBridge storage to HomeBridge implementation') + const upgradeToHomeBridgeData = await homeBridgeStorage.methods + .upgradeTo('1', homeBridgeImplementation.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txUpgradeToHomeBridge = await sendRawTxHome({ + data: upgradeToHomeBridgeData, + nonce: homeNonce, + to: homeBridgeStorage.options.address, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL + }) + assert.equal(txUpgradeToHomeBridge.status, '0x1', 'Transaction Failed') + homeNonce++ + + let blockRewardAddress = null + if (BLOCK_REWARD_ADDRESS) { + blockRewardAddress = BLOCK_REWARD_ADDRESS + } else { + console.log('\n[Home] deploying Block Reward contract (dev only)') + const blockReward = await deployContract(BlockReward, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'home', + nonce: homeNonce + }) + homeNonce++ + console.log('[Home] Block Reward: ', blockReward.options.address) + blockRewardAddress = blockReward.options.address + + const sendBalanceTx = await sendRawTxHome({ + to: blockRewardAddress, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL, + value: Web3Utils.toHex(Web3Utils.toWei('1000')), + nonce: homeNonce + }) + homeNonce++ + } + + console.log('\ninitializing Home Bridge with following parameters:\n') + console.log(`Home Validators: ${storageValidatorsHome.options.address}, + HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, + HOME_MAX_AMOUNT_PER_TX: ${HOME_MAX_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + HOME_MAX_AMOUNT_PER_TX + )} in eth, + HOME_MIN_AMOUNT_PER_TX: ${HOME_MIN_AMOUNT_PER_TX} which is ${Web3Utils.fromWei( + HOME_MIN_AMOUNT_PER_TX + )} in eth, + HOME_GAS_PRICE: ${HOME_GAS_PRICE}, HOME_REQUIRED_BLOCK_CONFIRMATIONS : ${HOME_REQUIRED_BLOCK_CONFIRMATIONS}`) + homeBridgeImplementation.options.address = homeBridgeStorage.options.address + const initializeHomeBridgeData = await homeBridgeImplementation.methods + .initialize( + storageValidatorsHome.options.address, + HOME_DAILY_LIMIT, + HOME_MAX_AMOUNT_PER_TX, + HOME_MIN_AMOUNT_PER_TX, + HOME_GAS_PRICE, + HOME_REQUIRED_BLOCK_CONFIRMATIONS, + blockRewardAddress + ) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txInitializeHomeBridge = await sendRawTxHome({ + data: initializeHomeBridgeData, + nonce: homeNonce, + to: homeBridgeStorage.options.address, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL + }) + assert.equal(txInitializeHomeBridge.status, '0x1', 'Transaction Failed') + homeNonce++ + + console.log('transferring proxy ownership to multisig for Home bridge Proxy contract') + const homeBridgeProxyData = await homeBridgeStorage.methods + .transferProxyOwnership(HOME_UPGRADEABLE_ADMIN_BRIDGE) + .encodeABI() + const txhomeBridgeProxyData = await sendRawTxHome({ + data: homeBridgeProxyData, + nonce: homeNonce, + to: homeBridgeStorage.options.address, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL + }) + assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed') + homeNonce++ + + console.log('\nHome Deployment Bridge is complete\n') + return { + homeBridgeAddress: homeBridgeStorage.options.address, + deployedBlockNumber: Web3Utils.hexToNumber(homeBridgeStorage.deployedBlockNumber) + } +} +module.exports = deployHome diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index dad255487..aeedffe20 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -5,7 +5,7 @@ require('dotenv').config({ path: path.join(__dirname, '', '.env') }) -const validBridgeModes = ['NATIVE_TO_ERC', 'ERC_TO_ERC'] +const validBridgeModes = ['NATIVE_TO_ERC', 'ERC_TO_ERC', 'ERC_TO_NATIVE'] const bigNumValidator = envalid.makeValidator(x => toBN(x)) const validateAddress = address => { if (isAddress(address)) { @@ -52,6 +52,9 @@ const env = envalid.cleanEnv(process.env, { VALIDATORS: addressesValidator(), ERC20_TOKEN_ADDRESS: addressValidator({ default: '0x0000000000000000000000000000000000000000' + }), + BLOCK_REWARD_ADDRESS: envalid.str({ + devDefault: '' }) }) diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index 6ed2b864b..8a3a90b47 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -1,8 +1,7 @@ +const assert = require('assert') const Web3Utils = require('web3-utils') const env = require('../loadEnv') -const assert = require('assert') - const { deployContract, privateKeyToAddress, sendRawTxForeign } = require('../deploymentUtils') const { web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL } = require('../web3') From fdf9d39abd564d604368cc5ec7a931868cc5027c Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 24 Sep 2018 09:09:53 -0300 Subject: [PATCH 13/77] Update BasicBridge version to 2.1.0 --- contracts/upgradeable_contracts/BasicBridge.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/upgradeable_contracts/BasicBridge.sol b/contracts/upgradeable_contracts/BasicBridge.sol index cc0e06e8b..51dc7b4fd 100644 --- a/contracts/upgradeable_contracts/BasicBridge.sol +++ b/contracts/upgradeable_contracts/BasicBridge.sol @@ -10,7 +10,7 @@ import "openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol"; contract BasicBridge is EternalStorage, Validatable { using SafeMath for uint256; - Version.Version public getBridgeInterfacesVersion = Version.Version(2, 0, 0); + Version.Version public getBridgeInterfacesVersion = Version.Version(2, 1, 0); event GasPriceChanged(uint256 gasPrice); event RequiredBlockConfirmationChanged(uint256 requiredBlockConfirmations); From 2a5a19915249f94a3e630cc448288fbe2bbaf045 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 24 Sep 2018 10:23:05 -0300 Subject: [PATCH 14/77] Add gasPrice on initialize foreign erc-to-native --- .../erc20_to_native/ForeignBridgeErcToNative.sol | 5 ++++- deploy/src/erc_to_native/foreign.js | 4 +++- test/erc_to_native/foreign_bridge.test.js | 15 +++++++++------ test/erc_to_native/home_bridge.test.js | 2 ++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol index a2a648612..3d4363e0a 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol @@ -14,15 +14,18 @@ contract ForeignBridgeErcToNative is BasicBridge, BasicForeignBridge { function initialize( address _validatorContract, address _erc20token, - uint256 _requiredBlockConfirmations + uint256 _requiredBlockConfirmations, + uint256 _gasPrice ) public returns(bool) { require(!isInitialized(), "already initialized"); require(_validatorContract != address(0), "address cannot be empty"); require(_requiredBlockConfirmations != 0, "requiredBlockConfirmations cannot be 0"); + require(_gasPrice > 0); addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; setErc20token(_erc20token); uintStorage[keccak256(abi.encodePacked("deployedAtBlock"))] = block.number; uintStorage[keccak256(abi.encodePacked("requiredBlockConfirmations"))] = _requiredBlockConfirmations; + uintStorage[keccak256(abi.encodePacked("gasPrice"))] = _gasPrice; setInitialize(true); return isInitialized(); } diff --git a/deploy/src/erc_to_native/foreign.js b/deploy/src/erc_to_native/foreign.js index c2b52484f..cd82fd24c 100644 --- a/deploy/src/erc_to_native/foreign.js +++ b/deploy/src/erc_to_native/foreign.js @@ -10,6 +10,7 @@ const BridgeValidators = require('../../../build/contracts/BridgeValidators.json const ForeignBridge = require('../../../build/contracts/ForeignBridgeErcToNative.json') const VALIDATORS = env.VALIDATORS.split(' ') +const FOREIGN_GAS_PRICE = Web3Utils.toWei(env.FOREIGN_GAS_PRICE, 'gwei') const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -142,7 +143,8 @@ async function deployForeign() { .initialize( storageValidatorsForeign.options.address, ERC20_TOKEN_ADDRESS, - FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS + FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, + FOREIGN_GAS_PRICE ) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitializeBridge = await sendRawTxForeign({ diff --git a/test/erc_to_native/foreign_bridge.test.js b/test/erc_to_native/foreign_bridge.test.js index 5505ba38f..e7673ec33 100644 --- a/test/erc_to_native/foreign_bridge.test.js +++ b/test/erc_to_native/foreign_bridge.test.js @@ -8,6 +8,7 @@ const { ERROR_MSG, ZERO_ADDRESS } = require('../setup'); const { createMessage, sign, signatureToVRS } = require('../helpers/helpers'); const halfEther = web3.toBigNumber(web3.toWei(0.5, "ether")); const requireBlockConfirmations = 8; +const gasPrice = web3.toWei('1', 'gwei'); contract('ForeignBridge_ERC20_to_Native', async (accounts) => { let validatorContract, authorities, owner, token; @@ -29,7 +30,7 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { false.should.be.equal(await foreignBridge.isInitialized()) '0'.should.be.bignumber.equal(await foreignBridge.requiredBlockConfirmations()) - await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); token.address.should.be.equal(await foreignBridge.erc20token()); true.should.be.equal(await foreignBridge.isInitialized()) @@ -37,6 +38,8 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { token.address.should.be.equal(await foreignBridge.erc20token()); (await foreignBridge.deployedAtBlock()).should.be.bignumber.above(0); requireBlockConfirmations.should.be.bignumber.equal(await foreignBridge.requiredBlockConfirmations()) + const contractGasPrice = await foreignBridge.gasPrice() + contractGasPrice.should.be.bignumber.equal(gasPrice) const bridgeMode = '0x18762d46' // 4 bytes of keccak256('erc-to-erc-core') const mode = await foreignBridge.getBridgeMode(); mode.should.be.equal(bridgeMode) @@ -53,7 +56,7 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { beforeEach(async () => { foreignBridge = await ForeignBridge.new() token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); - await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); await token.mint(foreignBridge.address,value); }) @@ -145,7 +148,7 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { ownerOfValidatorContract = accounts[3] await multisigValidatorContract.initialize(2, twoAuthorities, ownerOfValidatorContract, {from: ownerOfValidatorContract}) foreignBridgeWithMultiSignatures = await ForeignBridge.new() - await foreignBridgeWithMultiSignatures.initialize(multisigValidatorContract.address, token.address, requireBlockConfirmations, {from: ownerOfValidatorContract}); + await foreignBridgeWithMultiSignatures.initialize(multisigValidatorContract.address, token.address, requireBlockConfirmations, gasPrice, {from: ownerOfValidatorContract}); await token.mint(foreignBridgeWithMultiSignatures.address,value); }) @@ -207,7 +210,7 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { await foreignBridgeProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled; foreignBridgeProxy = await ForeignBridge.at(foreignBridgeProxy.address); - await foreignBridgeProxy.initialize(validatorsProxy.address, token.address, requireBlockConfirmations) + await foreignBridgeProxy.initialize(validatorsProxy.address, token.address, requireBlockConfirmations, gasPrice) // Deploy V2 let foreignImplV2 = await ForeignBridgeV2.new(); @@ -227,7 +230,7 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { const storageProxy = await EternalStorageProxy.new().should.be.fulfilled; const foreignBridge = await ForeignBridge.new(); - const data = foreignBridge.initialize.request(fakeValidatorsAddress, fakeTokenAddress, requireBlockConfirmations).params[0].data + const data = foreignBridge.initialize.request(fakeValidatorsAddress, fakeTokenAddress, requireBlockConfirmations, gasPrice).params[0].data await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; @@ -243,7 +246,7 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); const foreignBridge = await ForeignBridge.new(); - await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); const tokenSecond = await ERC677BridgeToken.new("Roman Token", "RST", 18); await tokenSecond.mint(accounts[0], halfEther).should.be.fulfilled; diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 1ffc29bea..572cdf5ea 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -42,6 +42,8 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { '3'.should.be.bignumber.equal(await homeContract.dailyLimit()) '2'.should.be.bignumber.equal(await homeContract.maxPerTx()) '1'.should.be.bignumber.equal(await homeContract.minPerTx()) + const contractGasPrice = await homeContract.gasPrice() + contractGasPrice.should.be.bignumber.equal(gasPrice) const bridgeMode = '0x18762d46' // 4 bytes of keccak256('erc-to-native-core') const mode = await homeContract.getBridgeMode(); mode.should.be.equal(bridgeMode) From ebcd752039f005000d1b946eac7c713422e04514 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 24 Sep 2018 11:12:51 -0300 Subject: [PATCH 15/77] Update README and deploy/README --- README.md | 9 +++-- deploy/.env.example | 3 ++ deploy/README.md | 89 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5e930158d..583ea7f13 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,10 @@ These contracts are the core of POA bridge functionality. They implement the logic to relay assests between two EVM-based blockchain networks by collecting bridge validators signatures to approve relay operations. -Currently, the contracts supports two types of relay operations: +Currently, the contracts supports three types of relay operations: * to tokenize native coins circulating in one blockchain network (Home) into an ERC20 token in another network (Foreign); -* to swap a token presented by an existing ERC20 contract in a Foreign network to an ERC20 token in the Home network, where one pair of bridge contracts correspond to one pair of ERC20 tokens. +* to swap a token presented by an existing ERC20 contract in a Foreign network to an ERC20 token in the Home network, where one pair of bridge contracts correspond to one pair of ERC20 tokens; +* to swap a token presented by an existing ERC20 contract in a Foreign network to a native coin circulating in Home blockchain network. This version of the contract is intended to be work with [the bridge process implemented on NodeJS](https://github.com/poanetwork/bridge-nodejs). Please refer to the bridge process documentation to deploy and configure it. @@ -17,6 +18,7 @@ POA bridge contracts consist of several main parts: * Depending on type of relay operations the following components are used as well: * in `NATIVE-TO-ERC` mode: the ERC20 token (in fact, ERC677 extension is used) should be deployed on Foreign network; * in `ERC-TO-ERC` mode: the ERC20 token (in fact, ERC677 extension is used) should be deployed on Home network; + * in `ERC-TO-NATIVE` mode: The home network nodes must support consensus engine that allows using a smart contract for block reward calculation. * Validators is a smart contract that should be deployed in both the POA.Network and the Ethereum Mainnet. Responsibilities and roles of the bridge: @@ -35,7 +37,8 @@ Responsibilities and roles of the bridge: - User role: - sends assets to Bridge contracts: - in `NATIVE-TO-ERC` mode: send native coins to the Home Bridge to receive ERC20 tokens from the Foreign Bridge, send ERC20 tokens to the Foreign Bridge to unlock native coins from the Home Bridge; - - in `ERC-TO-ERC` mode: transfer ERC20 tokens to the Foreign Bridge to mint ERC20 tokens on the Home Network, transfer ERC20 tokens to the Home Bridge to unlock ERC20 tokens on Foreign networks. + - in `ERC-TO-ERC` mode: transfer ERC20 tokens to the Foreign Bridge to mint ERC20 tokens on the Home Network, transfer ERC20 tokens to the Home Bridge to unlock ERC20 tokens on Foreign networks; + - in `ERC-TO-NATIVE` mode: send ERC20 tokens to the Foreign Bridge to receive native coins from the Home Bridge, send native coins to the Home Bridge to unlock ERC20 tokens from the Foreign Bridge. # Dependencies ```bash diff --git a/deploy/.env.example b/deploy/.env.example index 8dc41a7bb..09cca5eff 100644 --- a/deploy/.env.example +++ b/deploy/.env.example @@ -20,6 +20,9 @@ HOME_MIN_AMOUNT_PER_TX=500000000000000000 HOME_REQUIRED_BLOCK_CONFIRMATIONS=1 HOME_GAS_PRICE=1 +#for bridge erc to native mode +BLOCK_REWARD_ADDRESS= + FOREIGN_RPC_URL=https://sokol.poa.network FOREIGN_OWNER_MULTISIG=0x FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS=0x diff --git a/deploy/README.md b/deploy/README.md index 001f16fd6..6e44275a0 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -213,3 +213,92 @@ REQUIRED_NUMBER_OF_VALIDATORS=1 # correctly to the Foreign network. VALIDATORS="0x 0x 0x" ``` + +## Configuration for `ERC-TO-NATIVE` Bridge mode + +Here is an example of `.env` file for `erc-to-erc` bridge mode. + +```bash +# The type of bridge. Defines set of contracts to be deployed. +BRIDGE_MODE=ERC_TO_NATIVE + +# The private key hex value of the account responsible for contracts +# deployments and initial configuration. The account's balance must contain +# funds from both networks. +DEPLOYMENT_ACCOUNT_PRIVATE_KEY=67..14 +# The "gas" parameter set in every deployment/configuration transaction. +DEPLOYMENT_GAS_LIMIT=4000000 +# The "gasPrice" parameter set in every deployment/configuration transaction on +# both networks. +DEPLOYMENT_GAS_PRICE=10 +# The timeout limit to wait for receipt of the deployment/configuration +# transaction. +GET_RECEIPT_INTERVAL_IN_MILLISECONDS=3000 + +# The RPC channel to a Home node able to handle deployment/configuration +# transactions. +HOME_RPC_URL=https://poa.infura.io +# The address of an administrator on the Home network who can change bridge +# parameters and a validator's contract. For extra security we recommended using +# a multi-sig wallet contract address here. +HOME_OWNER_MULTISIG=0x +# The address from which a validator's contract can be upgraded on Home. +HOME_UPGRADEABLE_ADMIN_VALIDATORS=0x +# The address from which the bridge's contract can be upgraded on Home. +HOME_UPGRADEABLE_ADMIN_BRIDGE=0x +# The daily transaction limit in Wei. As soon as this limit is exceeded, any +# transaction which requests to relay assets will fail. +HOME_DAILY_LIMIT=30000000000000000000000000 +# The maximum limit for one transaction in Wei. If a single transaction tries to +# relay funds exceeding this limit it will fail. +HOME_MAX_AMOUNT_PER_TX=1500000000000000000000000 +# The minimum limit for one transaction in Wei. If a transaction tries to relay +# funds below this limit it will fail. This is required to prevent dryout +# validator accounts. +HOME_MIN_AMOUNT_PER_TX=500000000000000000 +# The finalization threshold. The number of blocks issued after the block with +# the corresponding deposit transaction to guarantee the transaction will not be +# rolled back. +HOME_REQUIRED_BLOCK_CONFIRMATIONS=1 +# The default gas price used to send Home Network signature transactions for +# deposit or withdrawl confirmations. This price is used if the Gas price oracle +# is unreachable. +HOME_GAS_PRICE=1 + +# The address of the existing smart contract for block reward calculation on Home network. +BLOCK_REWARD_ADDRESS=0x + +# The RPC channel to a Foreign node able to handle deployment/configuration +# transactions. +FOREIGN_RPC_URL=https://mainnet.infura.io +# The address of an administrator on the Foreign network who can change bridge +# parameters and the validator's contract. For extra security we recommended +# using a multi-sig wallet contract address here. +FOREIGN_OWNER_MULTISIG=0x +# The address from which a validator's contract can be upgraded on Foreign. +FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS=0x +# The address from which the bridge's contract can be upgraded on Foreign. +FOREIGN_UPGRADEABLE_ADMIN_BRIDGE=0x +# These three parameters are not used in this mode, but the deployment script +# requires it to be set to some value. +FOREIGN_DAILY_LIMIT=15000000000000000000000000 +FOREIGN_MAX_AMOUNT_PER_TX=750000000000000000000000 +FOREIGN_MIN_AMOUNT_PER_TX=500000000000000000 +# The finalization threshold. The number of blocks issued after the block with +# the corresponding deposit transaction to guarantee the transaction will not be +# rolled back. +FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS=8 +# The default gas price used to send Foreign network transactions finalizing +# asset deposits. This price is used if the Gas price oracle is unreachable. +FOREIGN_GAS_PRICE=10 + +# The minimum number of validators required to send their signatures confirming +# the relay of assets. The same number of validators is expected on both sides +# of the bridge. +REQUIRED_NUMBER_OF_VALIDATORS=1 +# The set of validators' addresses. It is assumed that signatures from these +# addresses are collected on the Home side. The same addresses will be used on +# the Foreign network to confirm that the finalized agreement was transferred +# correctly to the Foreign network. +VALIDATORS="0x 0x 0x" +``` From 1992d11ce90d7fee2e4925566e6bebc06a3a8758 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 24 Sep 2018 12:33:42 -0300 Subject: [PATCH 16/77] Update erc-to-native config deploy/README --- deploy/.env.example | 2 +- deploy/README.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy/.env.example b/deploy/.env.example index 09cca5eff..76ad1a836 100644 --- a/deploy/.env.example +++ b/deploy/.env.example @@ -32,7 +32,7 @@ FOREIGN_MAX_AMOUNT_PER_TX=750000000000000000000000 FOREIGN_MIN_AMOUNT_PER_TX=500000000000000000 FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS=8 FOREIGN_GAS_PRICE=10 -#for bridge erc to erc mode +#for bridge erc_to_erc and erc_to_native mode ERC20_TOKEN_ADDRESS= REQUIRED_NUMBER_OF_VALIDATORS=1 diff --git a/deploy/README.md b/deploy/README.md index 6e44275a0..63daaa424 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -292,6 +292,10 @@ FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS=8 # asset deposits. This price is used if the Gas price oracle is unreachable. FOREIGN_GAS_PRICE=10 +# The address of the existing ERC20 compatible token in the Foreign network to +# be exchanged to the native coins on Home. +ERC20_TOKEN_ADDRESS=0x + # The minimum number of validators required to send their signatures confirming # the relay of assets. The same number of validators is expected on both sides # of the bridge. From caf0b789427fadc09d49814b0ba6025e568b6115 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Mon, 24 Sep 2018 13:35:42 -0300 Subject: [PATCH 17/77] Set all env gas variables in wei --- deploy/.env.example | 8 ++-- deploy/README.md | 64 ++++++++++++++++------------- deploy/src/deploymentUtils.js | 12 +++--- deploy/src/erc_to_erc/home.js | 2 +- deploy/src/erc_to_native/foreign.js | 2 +- deploy/src/erc_to_native/home.js | 2 +- deploy/src/native_to_erc/foreign.js | 2 +- deploy/src/native_to_erc/home.js | 2 +- deploy/src/web3.js | 8 ++-- 9 files changed, 55 insertions(+), 47 deletions(-) diff --git a/deploy/.env.example b/deploy/.env.example index 76ad1a836..954064a0f 100644 --- a/deploy/.env.example +++ b/deploy/.env.example @@ -2,8 +2,8 @@ BRIDGE_MODE=NATIVE_TO_ERC DEPLOYMENT_ACCOUNT_PRIVATE_KEY=67..14 DEPLOYMENT_GAS_LIMIT=4000000 -HOME_DEPLOYMENT_GAS_PRICE=10 -FOREIGN_DEPLOYMENT_GAS_PRICE=10 +HOME_DEPLOYMENT_GAS_PRICE=10000000000 +FOREIGN_DEPLOYMENT_GAS_PRICE=10000000000 GET_RECEIPT_INTERVAL_IN_MILLISECONDS=3000 BRIDGEABLE_TOKEN_NAME="Your New Bridged Token" @@ -18,7 +18,7 @@ HOME_DAILY_LIMIT=30000000000000000000000000 HOME_MAX_AMOUNT_PER_TX=1500000000000000000000000 HOME_MIN_AMOUNT_PER_TX=500000000000000000 HOME_REQUIRED_BLOCK_CONFIRMATIONS=1 -HOME_GAS_PRICE=1 +HOME_GAS_PRICE=1000000000 #for bridge erc to native mode BLOCK_REWARD_ADDRESS= @@ -31,7 +31,7 @@ FOREIGN_DAILY_LIMIT=15000000000000000000000000 FOREIGN_MAX_AMOUNT_PER_TX=750000000000000000000000 FOREIGN_MIN_AMOUNT_PER_TX=500000000000000000 FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS=8 -FOREIGN_GAS_PRICE=10 +FOREIGN_GAS_PRICE=10000000000 #for bridge erc_to_erc and erc_to_native mode ERC20_TOKEN_ADDRESS= diff --git a/deploy/README.md b/deploy/README.md index 63daaa424..395ba54a6 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -12,13 +12,13 @@ npm run compile 3. if it is necessary, deploy and configure a multi-sig wallet contract which will be used to manage the bridge contracts after deployment. -4. adjust parameters in the `.env` file depending on the desired bridge mode +4. adjust parameters in the `.env` file depending on the desired bridge mode -5. fill the balance of the deployment account in Home and Foreign networks +5. fill the balance of the deployment account in Home and Foreign networks -6. run `node deploy.js` +6. run `node deploy.js` -## Configuration for `NATIVE-TO-ERC` Bridge mode +## Configuration for `NATIVE-TO-ERC` Bridge mode Here is an example of an `.env` file for `native-to-erc` bridge mode. @@ -33,8 +33,11 @@ DEPLOYMENT_ACCOUNT_PRIVATE_KEY=67..14 # The "gas" parameter set in every deployment/configuration transaction. DEPLOYMENT_GAS_LIMIT=4000000 # The "gasPrice" parameter set in every deployment/configuration transaction on -# both networks. -DEPLOYMENT_GAS_PRICE=10 +# Home network (in Wei). +HOME_DEPLOYMENT_GAS_PRICE=10000000000 +# The "gasPrice" parameter set in every deployment/configuration transaction on +# Foreign network (in Wei). +FOREIGN_DEPLOYMENT_GAS_PRICE=10000000000 # The timeout limit to wait for receipt of the deployment/configuration # transaction. GET_RECEIPT_INTERVAL_IN_MILLISECONDS=3000 @@ -57,7 +60,7 @@ HOME_OWNER_MULTISIG=0x # The address from which a validator's contract can be upgraded on Home. HOME_UPGRADEABLE_ADMIN_VALIDATORS=0x # The address from which the bridge's contract can be upgraded on Home. -HOME_UPGRADEABLE_ADMIN_BRIDGE=0x +HOME_UPGRADEABLE_ADMIN_BRIDGE=0x # The daily transaction limit in Wei. As soon as this limit is exceeded, any # transaction which requests to relay assets will fail. HOME_DAILY_LIMIT=30000000000000000000000000 @@ -72,10 +75,10 @@ HOME_MIN_AMOUNT_PER_TX=500000000000000000 # the corresponding deposit transaction to guarantee the transaction will not be # rolled back. HOME_REQUIRED_BLOCK_CONFIRMATIONS=1 -# The default gas price used to send Home Network signature transactions for -# deposit or withdrawl confirmations. This price is used if the Gas price oracle -# is unreachable. -HOME_GAS_PRICE=1 +# The default gas price (in Wei) used to send Home Network signature +# transactions for deposit or withdrawal confirmations. This price is used if +# the Gas price oracle is unreachable. +HOME_GAS_PRICE=1000000000 # The RPC channel to a Foreign node able to handle deployment/configuration # transactions. @@ -102,9 +105,10 @@ FOREIGN_MIN_AMOUNT_PER_TX=500000000000000000 # the corresponding deposit transaction to guarantee the transaction will not be # rolled back. FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS=8 -# The default gas price used to send Foreign network transactions finalizing -# asset deposits. This price is used if the Gas price oracle is unreachable. -FOREIGN_GAS_PRICE=10 +# The default gas price (in Wei) used to send Foreign network transactions +# finalizing asset deposits. This price is used if the Gas price oracle is +# unreachable. +FOREIGN_GAS_PRICE=10000000000 # The minimum number of validators required to send their signatures confirming # the relay of assets. The same number of validators is expected on both sides @@ -117,7 +121,7 @@ REQUIRED_NUMBER_OF_VALIDATORS=1 VALIDATORS="0x 0x 0x" ``` -## Configuration for `ERC-TO-ERC` Bridge mode +## Configuration for `ERC-TO-ERC` Bridge mode Here is an example of `.env` file for `erc-to-erc` bridge mode. @@ -132,8 +136,11 @@ DEPLOYMENT_ACCOUNT_PRIVATE_KEY=67..14 # The "gas" parameter set in every deployment/configuration transaction. DEPLOYMENT_GAS_LIMIT=4000000 # The "gasPrice" parameter set in every deployment/configuration transaction on -# both networks. -DEPLOYMENT_GAS_PRICE=10 +# Home network (in Wei). +HOME_DEPLOYMENT_GAS_PRICE=10000000000 +# The "gasPrice" parameter set in every deployment/configuration transaction on +# Foreign network (in Wei). +FOREIGN_DEPLOYMENT_GAS_PRICE=10000000000 # The timeout limit to wait for receipt of the deployment/configuration # transaction. GET_RECEIPT_INTERVAL_IN_MILLISECONDS=3000 @@ -156,7 +163,7 @@ HOME_OWNER_MULTISIG=0x # The address from which a validator's contract can be upgraded on Home. HOME_UPGRADEABLE_ADMIN_VALIDATORS=0x # The address from which the bridge's contract can be upgraded on Home. -HOME_UPGRADEABLE_ADMIN_BRIDGE=0x +HOME_UPGRADEABLE_ADMIN_BRIDGE=0x # The daily transaction limit in Wei. As soon as this limit is exceeded, any # transaction which requests to relay assets will fail. HOME_DAILY_LIMIT=30000000000000000000000000 @@ -171,10 +178,10 @@ HOME_MIN_AMOUNT_PER_TX=500000000000000000 # the corresponding deposit transaction to guarantee the transaction will not be # rolled back. HOME_REQUIRED_BLOCK_CONFIRMATIONS=1 -# The default gas price used to send Home Network signature transactions for -# deposit or withdrawl confirmations. This price is used if the Gas price oracle -# is unreachable. -HOME_GAS_PRICE=1 +# The default gas price (in Wei) used to send Home Network signature +# transactions for deposit or withdrawl confirmations. This price is used if +# the Gas price oracle is unreachable. +HOME_GAS_PRICE=1000000000 # The RPC channel to a Foreign node able to handle deployment/configuration # transactions. @@ -196,9 +203,10 @@ FOREIGN_MIN_AMOUNT_PER_TX=500000000000000000 # the corresponding deposit transaction to guarantee the transaction will not be # rolled back. FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS=8 -# The default gas price used to send Foreign network transactions finalizing -# asset deposits. This price is used if the Gas price oracle is unreachable. -FOREIGN_GAS_PRICE=10 +# The default gas price (in Wei) used to send Foreign network transactions +# finalizing asset deposits. This price is used if the Gas price oracle is +# unreachable. +FOREIGN_GAS_PRICE=10000000000 # The address of the existing ERC20 compatible token in the Foreign network to # be exchanged to the ERC20/ERC677 token deployed on Home. ERC20_TOKEN_ADDRESS=0x @@ -214,7 +222,7 @@ REQUIRED_NUMBER_OF_VALIDATORS=1 VALIDATORS="0x 0x 0x" ``` -## Configuration for `ERC-TO-NATIVE` Bridge mode +## Configuration for `ERC-TO-NATIVE` Bridge mode Here is an example of `.env` file for `erc-to-erc` bridge mode. @@ -245,7 +253,7 @@ HOME_OWNER_MULTISIG=0x # The address from which a validator's contract can be upgraded on Home. HOME_UPGRADEABLE_ADMIN_VALIDATORS=0x # The address from which the bridge's contract can be upgraded on Home. -HOME_UPGRADEABLE_ADMIN_BRIDGE=0x +HOME_UPGRADEABLE_ADMIN_BRIDGE=0x # The daily transaction limit in Wei. As soon as this limit is exceeded, any # transaction which requests to relay assets will fail. HOME_DAILY_LIMIT=30000000000000000000000000 @@ -262,7 +270,7 @@ HOME_MIN_AMOUNT_PER_TX=500000000000000000 HOME_REQUIRED_BLOCK_CONFIRMATIONS=1 # The default gas price used to send Home Network signature transactions for # deposit or withdrawl confirmations. This price is used if the Gas price oracle -# is unreachable. +# is unreachable. HOME_GAS_PRICE=1 # The address of the existing smart contract for block reward calculation on Home network. diff --git a/deploy/src/deploymentUtils.js b/deploy/src/deploymentUtils.js index 0f30a9e74..a94df7814 100644 --- a/deploy/src/deploymentUtils.js +++ b/deploy/src/deploymentUtils.js @@ -10,8 +10,8 @@ const { FOREIGN_RPC_URL, HOME_RPC_URL, GAS_LIMIT, - HOME_GAS_PRICE, - FOREIGN_GAS_PRICE, + HOME_DEPLOYMENT_GAS_PRICE, + FOREIGN_DEPLOYMENT_GAS_PRICE, GET_RECEIPT_INTERVAL_IN_MILLISECONDS } = require('./web3') @@ -22,11 +22,11 @@ async function deployContract(contractJson, args, { from, network, nonce }) { if (network === 'foreign') { web3 = web3Foreign url = FOREIGN_RPC_URL - gasPrice = FOREIGN_GAS_PRICE + gasPrice = FOREIGN_DEPLOYMENT_GAS_PRICE } else { web3 = web3Home url = HOME_RPC_URL - gasPrice = HOME_GAS_PRICE + gasPrice = HOME_DEPLOYMENT_GAS_PRICE } const options = { from, @@ -57,14 +57,14 @@ async function deployContract(contractJson, args, { from, network, nonce }) { async function sendRawTxHome(options) { return sendRawTx({ ...options, - gasPrice: HOME_GAS_PRICE + gasPrice: HOME_DEPLOYMENT_GAS_PRICE }) } async function sendRawTxForeign(options) { return sendRawTx({ ...options, - gasPrice: FOREIGN_GAS_PRICE + gasPrice: FOREIGN_DEPLOYMENT_GAS_PRICE }) } diff --git a/deploy/src/erc_to_erc/home.js b/deploy/src/erc_to_erc/home.js index 46dad39a8..42bae0a99 100644 --- a/deploy/src/erc_to_erc/home.js +++ b/deploy/src/erc_to_erc/home.js @@ -11,7 +11,7 @@ const HomeBridge = require('../../../build/contracts/HomeBridgeErcToErc.json') const ERC677BridgeToken = require('../../../build/contracts/ERC677BridgeToken.json') const VALIDATORS = env.VALIDATORS.split(' ') -const HOME_GAS_PRICE = Web3Utils.toWei(env.HOME_GAS_PRICE, 'gwei') +const HOME_GAS_PRICE = env.HOME_GAS_PRICE const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, diff --git a/deploy/src/erc_to_native/foreign.js b/deploy/src/erc_to_native/foreign.js index cd82fd24c..f36fa8df2 100644 --- a/deploy/src/erc_to_native/foreign.js +++ b/deploy/src/erc_to_native/foreign.js @@ -10,7 +10,7 @@ const BridgeValidators = require('../../../build/contracts/BridgeValidators.json const ForeignBridge = require('../../../build/contracts/ForeignBridgeErcToNative.json') const VALIDATORS = env.VALIDATORS.split(' ') -const FOREIGN_GAS_PRICE = Web3Utils.toWei(env.FOREIGN_GAS_PRICE, 'gwei') +const FOREIGN_GAS_PRICE = env.FOREIGN_GAS_PRICE const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, diff --git a/deploy/src/erc_to_native/home.js b/deploy/src/erc_to_native/home.js index 04d3e8e6b..03484673f 100644 --- a/deploy/src/erc_to_native/home.js +++ b/deploy/src/erc_to_native/home.js @@ -11,7 +11,7 @@ const HomeBridge = require('../../../build/contracts/HomeBridgeErcToNative.json' const BlockReward = require('../../../build/contracts/BlockReward.json') const VALIDATORS = env.VALIDATORS.split(' ') -const HOME_GAS_PRICE = Web3Utils.toWei(env.HOME_GAS_PRICE, 'gwei') +const HOME_GAS_PRICE = env.HOME_GAS_PRICE const { BLOCK_REWARD_ADDRESS, diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index 8a3a90b47..49d873962 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -11,7 +11,7 @@ const BridgeValidators = require('../../../build/contracts/BridgeValidators.json const ForeignBridge = require('../../../build/contracts/ForeignBridgeNativeToErc.json') const VALIDATORS = env.VALIDATORS.split(' ') -const FOREIGN_GAS_PRICE = Web3Utils.toWei(env.FOREIGN_GAS_PRICE, 'gwei') +const FOREIGN_GAS_PRICE = env.FOREIGN_GAS_PRICE const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, diff --git a/deploy/src/native_to_erc/home.js b/deploy/src/native_to_erc/home.js index c085efe49..811cb0e57 100644 --- a/deploy/src/native_to_erc/home.js +++ b/deploy/src/native_to_erc/home.js @@ -10,7 +10,7 @@ const BridgeValidators = require('../../../build/contracts/BridgeValidators.json const HomeBridge = require('../../../build/contracts/HomeBridgeNativeToErc.json') const VALIDATORS = env.VALIDATORS.split(' ') -const HOME_GAS_PRICE = Web3Utils.toWei(env.HOME_GAS_PRICE, 'gwei') +const HOME_GAS_PRICE = env.HOME_GAS_PRICE const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, diff --git a/deploy/src/web3.js b/deploy/src/web3.js index bc31a1af8..3cf44ea02 100644 --- a/deploy/src/web3.js +++ b/deploy/src/web3.js @@ -15,8 +15,8 @@ const web3Home = new Web3(homeProvider) const foreignProvider = new Web3.providers.HttpProvider(FOREIGN_RPC_URL) const web3Foreign = new Web3(foreignProvider) -const HOME_GAS_PRICE = Web3Utils.toWei(env.HOME_DEPLOYMENT_GAS_PRICE, 'gwei') -const FOREIGN_GAS_PRICE = Web3Utils.toWei(env.FOREIGN_DEPLOYMENT_GAS_PRICE, 'gwei') +const HOME_DEPLOYMENT_GAS_PRICE = env.HOME_DEPLOYMENT_GAS_PRICE +const FOREIGN_DEPLOYMENT_GAS_PRICE = env.FOREIGN_DEPLOYMENT_GAS_PRICE const GAS_LIMIT = env.DEPLOYMENT_GAS_LIMIT const deploymentPrivateKey = Buffer.from(DEPLOYMENT_ACCOUNT_PRIVATE_KEY, 'hex') @@ -28,7 +28,7 @@ module.exports = { HOME_RPC_URL, FOREIGN_RPC_URL, GAS_LIMIT, - HOME_GAS_PRICE, - FOREIGN_GAS_PRICE, + HOME_DEPLOYMENT_GAS_PRICE, + FOREIGN_DEPLOYMENT_GAS_PRICE, GET_RECEIPT_INTERVAL_IN_MILLISECONDS } From 2260da2384f01978b39295a9f9b11ccf101a76f1 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Mon, 24 Sep 2018 13:40:14 -0300 Subject: [PATCH 18/77] Make deploy script work from anywhere --- deploy/src/loadEnv.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index aeedffe20..d7f2e4a73 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -1,10 +1,8 @@ const { isAddress, toBN } = require('web3').utils const path = require('path') const envalid = require('envalid') -require('dotenv').config({ - path: path.join(__dirname, '', '.env') -}) +const dotEnvPath = path.join(__dirname, '..', '.env') const validBridgeModes = ['NATIVE_TO_ERC', 'ERC_TO_ERC', 'ERC_TO_NATIVE'] const bigNumValidator = envalid.makeValidator(x => toBN(x)) const validateAddress = address => { @@ -56,6 +54,8 @@ const env = envalid.cleanEnv(process.env, { BLOCK_REWARD_ADDRESS: envalid.str({ devDefault: '' }) +}, { + dotEnvPath }) if ( From bcacf21266b2a7ef4e0930dcba5db0ee3911ce6c Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Mon, 24 Sep 2018 14:18:15 -0300 Subject: [PATCH 19/77] Use gasPrice argument in sendRawTx --- deploy/src/deploymentUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy/src/deploymentUtils.js b/deploy/src/deploymentUtils.js index a94df7814..56cb0a90b 100644 --- a/deploy/src/deploymentUtils.js +++ b/deploy/src/deploymentUtils.js @@ -44,7 +44,8 @@ async function deployContract(contractJson, args, { from, network, nonce }) { nonce: Web3Utils.toHex(nonce), to: null, privateKey: deploymentPrivateKey, - url + url, + gasPrice: options.gasPrice }) if (tx.status !== '0x1') { throw new Error('Tx failed') From 51c98dc5f1aeaf86e43f0c55143167c51281150a Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Mon, 24 Sep 2018 15:15:01 -0300 Subject: [PATCH 20/77] Move block reward deploy to separate script --- deploy/src/erc_to_native/home.js | 27 +--------------------- deploy/src/loadEnv.js | 21 +++++++++++++---- deploy/src/utils/deployBlockReward.js | 33 +++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 31 deletions(-) create mode 100644 deploy/src/utils/deployBlockReward.js diff --git a/deploy/src/erc_to_native/home.js b/deploy/src/erc_to_native/home.js index 03484673f..4142fe0b1 100644 --- a/deploy/src/erc_to_native/home.js +++ b/deploy/src/erc_to_native/home.js @@ -8,7 +8,6 @@ const { web3Home, deploymentPrivateKey, HOME_RPC_URL } = require('../web3') const EternalStorageProxy = require('../../../build/contracts/EternalStorageProxy.json') const BridgeValidators = require('../../../build/contracts/BridgeValidators.json') const HomeBridge = require('../../../build/contracts/HomeBridgeErcToNative.json') -const BlockReward = require('../../../build/contracts/BlockReward.json') const VALIDATORS = env.VALIDATORS.split(' ') const HOME_GAS_PRICE = env.HOME_GAS_PRICE @@ -122,30 +121,6 @@ async function deployHome() { assert.equal(txUpgradeToHomeBridge.status, '0x1', 'Transaction Failed') homeNonce++ - let blockRewardAddress = null - if (BLOCK_REWARD_ADDRESS) { - blockRewardAddress = BLOCK_REWARD_ADDRESS - } else { - console.log('\n[Home] deploying Block Reward contract (dev only)') - const blockReward = await deployContract(BlockReward, [], { - from: DEPLOYMENT_ACCOUNT_ADDRESS, - network: 'home', - nonce: homeNonce - }) - homeNonce++ - console.log('[Home] Block Reward: ', blockReward.options.address) - blockRewardAddress = blockReward.options.address - - const sendBalanceTx = await sendRawTxHome({ - to: blockRewardAddress, - privateKey: deploymentPrivateKey, - url: HOME_RPC_URL, - value: Web3Utils.toHex(Web3Utils.toWei('1000')), - nonce: homeNonce - }) - homeNonce++ - } - console.log('\ninitializing Home Bridge with following parameters:\n') console.log(`Home Validators: ${storageValidatorsHome.options.address}, HOME_DAILY_LIMIT : ${HOME_DAILY_LIMIT} which is ${Web3Utils.fromWei(HOME_DAILY_LIMIT)} in eth, @@ -165,7 +140,7 @@ async function deployHome() { HOME_MIN_AMOUNT_PER_TX, HOME_GAS_PRICE, HOME_REQUIRED_BLOCK_CONFIRMATIONS, - blockRewardAddress + BLOCK_REWARD_ADDRESS ) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitializeHomeBridge = await sendRawTxHome({ diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index d7f2e4a73..d98373c26 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -3,7 +3,10 @@ const path = require('path') const envalid = require('envalid') const dotEnvPath = path.join(__dirname, '..', '.env') + +// Validations and constants const validBridgeModes = ['NATIVE_TO_ERC', 'ERC_TO_ERC', 'ERC_TO_NATIVE'] +const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' const bigNumValidator = envalid.makeValidator(x => toBN(x)) const validateAddress = address => { if (isAddress(address)) { @@ -49,20 +52,28 @@ const env = envalid.cleanEnv(process.env, { REQUIRED_NUMBER_OF_VALIDATORS: envalid.num(), VALIDATORS: addressesValidator(), ERC20_TOKEN_ADDRESS: addressValidator({ - default: '0x0000000000000000000000000000000000000000' + default: ZERO_ADDRESS }), - BLOCK_REWARD_ADDRESS: envalid.str({ - devDefault: '' + BLOCK_REWARD_ADDRESS: addressValidator({ + default: ZERO_ADDRESS }) }, { dotEnvPath -}) +} +) if ( env.BRIDGE_MODE === 'ERC_TO_ERC' && - env.ERC20_TOKEN_ADDRESS === '0x0000000000000000000000000000000000000000' + env.ERC20_TOKEN_ADDRESS === ZERO_ADDRESS ) { throw new Error('ERC_TO_ERC mode requires ERC20_TOKEN_ADDRESS to be set') } +if ( + env.BRIDGE_MODE === 'ERC_TO_NATIVE' && + env.BLOCK_REWARD_ADDRESS === ZERO_ADDRESS +) { + throw new Error('ERC_TO_NATIVE mode requires BLOCK_REWARD_ADDRESS to be set') +} + module.exports = env diff --git a/deploy/src/utils/deployBlockReward.js b/deploy/src/utils/deployBlockReward.js new file mode 100644 index 000000000..4c0d9a3dc --- /dev/null +++ b/deploy/src/utils/deployBlockReward.js @@ -0,0 +1,33 @@ +const Web3Utils = require('web3-utils') +const { web3Home, deploymentPrivateKey, HOME_RPC_URL } = require('../web3') +const { deployContract, privateKeyToAddress, sendRawTxHome } = require('../deploymentUtils') +const BlockReward = require('../../../build/contracts/BlockReward.json') +const env = require('../loadEnv') + +const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY } = env + +const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) + +async function deployBlockReward() { + let homeNonce = await web3Home.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) + const blockReward = await deployContract(BlockReward, [], { + from: DEPLOYMENT_ACCOUNT_ADDRESS, + network: 'home', + nonce: homeNonce + }) + homeNonce++ + + const blockRewardAddress = blockReward.options.address + + await sendRawTxHome({ + to: blockRewardAddress, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL, + value: Web3Utils.toHex(Web3Utils.toWei('1000')), + nonce: homeNonce + }) + + console.log(blockRewardAddress) +} + +deployBlockReward().catch(console.error) From bf6a0d923c72f12e610ebeab12c51ab357ef2983 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Mon, 24 Sep 2018 15:31:45 -0300 Subject: [PATCH 21/77] Fix linter errors --- deploy/src/erc_to_erc/home.js | 2 +- deploy/src/erc_to_native/foreign.js | 2 +- deploy/src/erc_to_native/home.js | 2 +- deploy/src/loadEnv.js | 91 ++++++++++++++--------------- deploy/src/native_to_erc/foreign.js | 2 +- deploy/src/native_to_erc/home.js | 2 +- deploy/src/web3.js | 4 +- 7 files changed, 50 insertions(+), 55 deletions(-) diff --git a/deploy/src/erc_to_erc/home.js b/deploy/src/erc_to_erc/home.js index 42bae0a99..50ba3ca77 100644 --- a/deploy/src/erc_to_erc/home.js +++ b/deploy/src/erc_to_erc/home.js @@ -11,7 +11,6 @@ const HomeBridge = require('../../../build/contracts/HomeBridgeErcToErc.json') const ERC677BridgeToken = require('../../../build/contracts/ERC677BridgeToken.json') const VALIDATORS = env.VALIDATORS.split(' ') -const HOME_GAS_PRICE = env.HOME_GAS_PRICE const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, @@ -23,6 +22,7 @@ const { HOME_MAX_AMOUNT_PER_TX, HOME_MIN_AMOUNT_PER_TX, HOME_REQUIRED_BLOCK_CONFIRMATIONS, + HOME_GAS_PRICE, BRIDGEABLE_TOKEN_NAME, BRIDGEABLE_TOKEN_SYMBOL, BRIDGEABLE_TOKEN_DECIMALS diff --git a/deploy/src/erc_to_native/foreign.js b/deploy/src/erc_to_native/foreign.js index f36fa8df2..b7bc4d203 100644 --- a/deploy/src/erc_to_native/foreign.js +++ b/deploy/src/erc_to_native/foreign.js @@ -10,11 +10,11 @@ const BridgeValidators = require('../../../build/contracts/BridgeValidators.json const ForeignBridge = require('../../../build/contracts/ForeignBridgeErcToNative.json') const VALIDATORS = env.VALIDATORS.split(' ') -const FOREIGN_GAS_PRICE = env.FOREIGN_GAS_PRICE const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, REQUIRED_NUMBER_OF_VALIDATORS, + FOREIGN_GAS_PRICE, FOREIGN_OWNER_MULTISIG, FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS, FOREIGN_UPGRADEABLE_ADMIN_BRIDGE, diff --git a/deploy/src/erc_to_native/home.js b/deploy/src/erc_to_native/home.js index 4142fe0b1..2c08abbb6 100644 --- a/deploy/src/erc_to_native/home.js +++ b/deploy/src/erc_to_native/home.js @@ -10,12 +10,12 @@ const BridgeValidators = require('../../../build/contracts/BridgeValidators.json const HomeBridge = require('../../../build/contracts/HomeBridgeErcToNative.json') const VALIDATORS = env.VALIDATORS.split(' ') -const HOME_GAS_PRICE = env.HOME_GAS_PRICE const { BLOCK_REWARD_ADDRESS, DEPLOYMENT_ACCOUNT_PRIVATE_KEY, REQUIRED_NUMBER_OF_VALIDATORS, + HOME_GAS_PRICE, HOME_OWNER_MULTISIG, HOME_UPGRADEABLE_ADMIN_VALIDATORS, HOME_UPGRADEABLE_ADMIN_BRIDGE, diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index d98373c26..531dcaf91 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -21,58 +21,55 @@ const addressesValidator = envalid.makeValidator(addresses => { return addresses }) -const env = envalid.cleanEnv(process.env, { - BRIDGE_MODE: envalid.str(validBridgeModes), - DEPLOYMENT_ACCOUNT_PRIVATE_KEY: envalid.str(), - DEPLOYMENT_GAS_LIMIT: bigNumValidator(), - HOME_DEPLOYMENT_GAS_PRICE: bigNumValidator(), - FOREIGN_DEPLOYMENT_GAS_PRICE: bigNumValidator(), - GET_RECEIPT_INTERVAL_IN_MILLISECONDS: bigNumValidator(), - BRIDGEABLE_TOKEN_NAME: envalid.str(), - BRIDGEABLE_TOKEN_SYMBOL: envalid.str(), - BRIDGEABLE_TOKEN_DECIMALS: envalid.num(), - HOME_RPC_URL: envalid.str(), - HOME_OWNER_MULTISIG: addressValidator(), - HOME_UPGRADEABLE_ADMIN_VALIDATORS: addressesValidator(), - HOME_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), - HOME_DAILY_LIMIT: bigNumValidator(), - HOME_MAX_AMOUNT_PER_TX: bigNumValidator(), - HOME_MIN_AMOUNT_PER_TX: bigNumValidator(), - HOME_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), - HOME_GAS_PRICE: bigNumValidator(), - FOREIGN_RPC_URL: envalid.str(), - FOREIGN_OWNER_MULTISIG: addressValidator(), - FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS: addressValidator(), - FOREIGN_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), - FOREIGN_DAILY_LIMIT: bigNumValidator(), - FOREIGN_MAX_AMOUNT_PER_TX: bigNumValidator(), - FOREIGN_MIN_AMOUNT_PER_TX: bigNumValidator(), - FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), - FOREIGN_GAS_PRICE: bigNumValidator(), - REQUIRED_NUMBER_OF_VALIDATORS: envalid.num(), - VALIDATORS: addressesValidator(), - ERC20_TOKEN_ADDRESS: addressValidator({ - default: ZERO_ADDRESS - }), - BLOCK_REWARD_ADDRESS: addressValidator({ - default: ZERO_ADDRESS - }) -}, { - dotEnvPath -} +const env = envalid.cleanEnv( + process.env, + { + BRIDGE_MODE: envalid.str(validBridgeModes), + DEPLOYMENT_ACCOUNT_PRIVATE_KEY: envalid.str(), + DEPLOYMENT_GAS_LIMIT: bigNumValidator(), + HOME_DEPLOYMENT_GAS_PRICE: bigNumValidator(), + FOREIGN_DEPLOYMENT_GAS_PRICE: bigNumValidator(), + GET_RECEIPT_INTERVAL_IN_MILLISECONDS: bigNumValidator(), + BRIDGEABLE_TOKEN_NAME: envalid.str(), + BRIDGEABLE_TOKEN_SYMBOL: envalid.str(), + BRIDGEABLE_TOKEN_DECIMALS: envalid.num(), + HOME_RPC_URL: envalid.str(), + HOME_OWNER_MULTISIG: addressValidator(), + HOME_UPGRADEABLE_ADMIN_VALIDATORS: addressesValidator(), + HOME_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), + HOME_DAILY_LIMIT: bigNumValidator(), + HOME_MAX_AMOUNT_PER_TX: bigNumValidator(), + HOME_MIN_AMOUNT_PER_TX: bigNumValidator(), + HOME_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), + HOME_GAS_PRICE: bigNumValidator(), + FOREIGN_RPC_URL: envalid.str(), + FOREIGN_OWNER_MULTISIG: addressValidator(), + FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS: addressValidator(), + FOREIGN_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), + FOREIGN_DAILY_LIMIT: bigNumValidator(), + FOREIGN_MAX_AMOUNT_PER_TX: bigNumValidator(), + FOREIGN_MIN_AMOUNT_PER_TX: bigNumValidator(), + FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), + FOREIGN_GAS_PRICE: bigNumValidator(), + REQUIRED_NUMBER_OF_VALIDATORS: envalid.num(), + VALIDATORS: addressesValidator(), + ERC20_TOKEN_ADDRESS: addressValidator({ + default: ZERO_ADDRESS + }), + BLOCK_REWARD_ADDRESS: addressValidator({ + default: ZERO_ADDRESS + }) + }, + { + dotEnvPath + } ) -if ( - env.BRIDGE_MODE === 'ERC_TO_ERC' && - env.ERC20_TOKEN_ADDRESS === ZERO_ADDRESS -) { +if (env.BRIDGE_MODE === 'ERC_TO_ERC' && env.ERC20_TOKEN_ADDRESS === ZERO_ADDRESS) { throw new Error('ERC_TO_ERC mode requires ERC20_TOKEN_ADDRESS to be set') } -if ( - env.BRIDGE_MODE === 'ERC_TO_NATIVE' && - env.BLOCK_REWARD_ADDRESS === ZERO_ADDRESS -) { +if (env.BRIDGE_MODE === 'ERC_TO_NATIVE' && env.BLOCK_REWARD_ADDRESS === ZERO_ADDRESS) { throw new Error('ERC_TO_NATIVE mode requires BLOCK_REWARD_ADDRESS to be set') } diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index 49d873962..dc3009541 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -11,11 +11,11 @@ const BridgeValidators = require('../../../build/contracts/BridgeValidators.json const ForeignBridge = require('../../../build/contracts/ForeignBridgeNativeToErc.json') const VALIDATORS = env.VALIDATORS.split(' ') -const FOREIGN_GAS_PRICE = env.FOREIGN_GAS_PRICE const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, REQUIRED_NUMBER_OF_VALIDATORS, + FOREIGN_GAS_PRICE, FOREIGN_OWNER_MULTISIG, FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS, FOREIGN_UPGRADEABLE_ADMIN_BRIDGE, diff --git a/deploy/src/native_to_erc/home.js b/deploy/src/native_to_erc/home.js index 811cb0e57..fa524f5e3 100644 --- a/deploy/src/native_to_erc/home.js +++ b/deploy/src/native_to_erc/home.js @@ -10,11 +10,11 @@ const BridgeValidators = require('../../../build/contracts/BridgeValidators.json const HomeBridge = require('../../../build/contracts/HomeBridgeNativeToErc.json') const VALIDATORS = env.VALIDATORS.split(' ') -const HOME_GAS_PRICE = env.HOME_GAS_PRICE const { DEPLOYMENT_ACCOUNT_PRIVATE_KEY, REQUIRED_NUMBER_OF_VALIDATORS, + HOME_GAS_PRICE, HOME_OWNER_MULTISIG, HOME_UPGRADEABLE_ADMIN_VALIDATORS, HOME_UPGRADEABLE_ADMIN_BRIDGE, diff --git a/deploy/src/web3.js b/deploy/src/web3.js index 3cf44ea02..b475a1646 100644 --- a/deploy/src/web3.js +++ b/deploy/src/web3.js @@ -1,4 +1,3 @@ -const Web3Utils = require('web3-utils') const Web3 = require('web3') const env = require('./loadEnv') @@ -15,8 +14,7 @@ const web3Home = new Web3(homeProvider) const foreignProvider = new Web3.providers.HttpProvider(FOREIGN_RPC_URL) const web3Foreign = new Web3(foreignProvider) -const HOME_DEPLOYMENT_GAS_PRICE = env.HOME_DEPLOYMENT_GAS_PRICE -const FOREIGN_DEPLOYMENT_GAS_PRICE = env.FOREIGN_DEPLOYMENT_GAS_PRICE +const { HOME_DEPLOYMENT_GAS_PRICE, FOREIGN_DEPLOYMENT_GAS_PRICE } = env const GAS_LIMIT = env.DEPLOYMENT_GAS_LIMIT const deploymentPrivateKey = Buffer.from(DEPLOYMENT_ACCOUNT_PRIVATE_KEY, 'hex') From 1aba9481ed48c13e7177ae49f035aec28aabc31f Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Tue, 25 Sep 2018 07:51:59 -0300 Subject: [PATCH 22/77] Expose sendRawTx again --- deploy/src/deploymentUtils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/src/deploymentUtils.js b/deploy/src/deploymentUtils.js index 56cb0a90b..6016d3c98 100644 --- a/deploy/src/deploymentUtils.js +++ b/deploy/src/deploymentUtils.js @@ -145,6 +145,7 @@ module.exports = { deployContract, sendNodeRequest, getReceipt, + sendRawTx, sendRawTxHome, sendRawTxForeign, privateKeyToAddress From a7bcd083cd35930855da0b306bbaca51ef6ea848 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 25 Sep 2018 12:31:25 -0300 Subject: [PATCH 23/77] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 583ea7f13..8b17a5891 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ two EVM-based blockchain networks by collecting bridge validators signatures to Currently, the contracts supports three types of relay operations: * to tokenize native coins circulating in one blockchain network (Home) into an ERC20 token in another network (Foreign); * to swap a token presented by an existing ERC20 contract in a Foreign network to an ERC20 token in the Home network, where one pair of bridge contracts correspond to one pair of ERC20 tokens; -* to swap a token presented by an existing ERC20 contract in a Foreign network to a native coin circulating in Home blockchain network. +* to mint new native coins in Home blockchain network from a token presented by an existing ERC20 contract in a Foreign network. This version of the contract is intended to be work with [the bridge process implemented on NodeJS](https://github.com/poanetwork/bridge-nodejs). Please refer to the bridge process documentation to deploy and configure it. From 30f328a3c1b3e6f042d8ed9e293b917d3aac4c75 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 25 Sep 2018 12:32:07 -0300 Subject: [PATCH 24/77] Update deployment gas price on deploy/README --- deploy/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deploy/README.md b/deploy/README.md index 395ba54a6..532741dec 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -237,8 +237,11 @@ DEPLOYMENT_ACCOUNT_PRIVATE_KEY=67..14 # The "gas" parameter set in every deployment/configuration transaction. DEPLOYMENT_GAS_LIMIT=4000000 # The "gasPrice" parameter set in every deployment/configuration transaction on -# both networks. -DEPLOYMENT_GAS_PRICE=10 +# home network. +HOME_DEPLOYMENT_GAS_PRICE=10000000000 +# The "gasPrice" parameter set in every deployment/configuration transaction on +# foreign network. +FOREIGN_DEPLOYMENT_GAS_PRICE=10000000000 # The timeout limit to wait for receipt of the deployment/configuration # transaction. GET_RECEIPT_INTERVAL_IN_MILLISECONDS=3000 From 817d1c73c919dc950aa99303d1e52e7f3605cce8 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Tue, 25 Sep 2018 13:06:45 -0300 Subject: [PATCH 25/77] Add totalMintedCoins to IBlockReward --- contracts/IBlockReward.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/IBlockReward.sol b/contracts/IBlockReward.sol index 3ff89456d..1df78ce4f 100644 --- a/contracts/IBlockReward.sol +++ b/contracts/IBlockReward.sol @@ -3,4 +3,5 @@ pragma solidity 0.4.24; interface IBlockReward { function addExtraReceiver(uint256 _amount, address _receiver) external; + function totalMintedCoins() public view returns (uint256); } From 2b071da2cb5e2c8c3bbdf3054c3865139c0d2d32 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 25 Sep 2018 13:26:47 -0300 Subject: [PATCH 26/77] Fix erc-to-native deploy/README --- deploy/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/README.md b/deploy/README.md index 85c3b7923..74c2bff05 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -229,9 +229,9 @@ REQUIRED_NUMBER_OF_VALIDATORS=1 VALIDATORS="0x 0x 0x" ``` -## Configuration for `ERC-TO-NATIVE` Bridge mode +## `ERC-TO-NATIVE` Bridge Mode Configuration Example. -Here is an example of `.env` file for `erc-to-erc` bridge mode. +This example of an `.env` file for the `erc-to-native` bridge mode includes comments describing each parameter. ```bash # The type of bridge. Defines set of contracts to be deployed. From 353a429831936329e90f2482f1560d1f07dbde4e Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 25 Sep 2018 14:59:11 -0300 Subject: [PATCH 27/77] Add totalMintedCoins method on BlockReward contract --- contracts/test/BlockReward.sol | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contracts/test/BlockReward.sol b/contracts/test/BlockReward.sol index 636ced2c3..b3ea4ed5a 100644 --- a/contracts/test/BlockReward.sol +++ b/contracts/test/BlockReward.sol @@ -7,7 +7,7 @@ import "../libraries/SafeMath.sol"; contract BlockReward is IBlockReward { using SafeMath for uint256; - uint256 public totalMintedCoins = 0; + uint256 public mintedCoins = 0; function () external payable { } @@ -15,7 +15,11 @@ contract BlockReward is IBlockReward { function addExtraReceiver(uint256 _amount, address _receiver) external { require(_amount > 0); require(_receiver != address(0)); - totalMintedCoins = totalMintedCoins.add(_amount); + mintedCoins = mintedCoins.add(_amount); _receiver.transfer(_amount); } + + function totalMintedCoins() public view returns (uint256) { + return mintedCoins; + } } From 2f29a1e6733aa56b371737b361864f5dd0cb7bd7 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 25 Sep 2018 15:41:34 -0300 Subject: [PATCH 28/77] Remove gasPrice from options on deploymentUtils --- deploy/src/deploymentUtils.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deploy/src/deploymentUtils.js b/deploy/src/deploymentUtils.js index 6016d3c98..1d111bd50 100644 --- a/deploy/src/deploymentUtils.js +++ b/deploy/src/deploymentUtils.js @@ -29,8 +29,7 @@ async function deployContract(contractJson, args, { from, network, nonce }) { gasPrice = HOME_DEPLOYMENT_GAS_PRICE } const options = { - from, - gasPrice + from } const instance = new web3.eth.Contract(contractJson.abi, options) const result = await instance @@ -45,7 +44,7 @@ async function deployContract(contractJson, args, { from, network, nonce }) { to: null, privateKey: deploymentPrivateKey, url, - gasPrice: options.gasPrice + gasPrice: gasPrice }) if (tx.status !== '0x1') { throw new Error('Tx failed') From 985b48deaed4b035ff1b0274f6b1f1fb139c9b03 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 25 Sep 2018 15:46:24 -0300 Subject: [PATCH 29/77] Update env var checks for ERC_TO_NATIVE --- deploy/src/loadEnv.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index 531dcaf91..7bafded02 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -65,7 +65,10 @@ const env = envalid.cleanEnv( } ) -if (env.BRIDGE_MODE === 'ERC_TO_ERC' && env.ERC20_TOKEN_ADDRESS === ZERO_ADDRESS) { +if ( + (env.BRIDGE_MODE === 'ERC_TO_ERC' || env.BRIDGE_MODE === 'ERC_TO_NATIVE') && + env.ERC20_TOKEN_ADDRESS === ZERO_ADDRESS +) { throw new Error('ERC_TO_ERC mode requires ERC20_TOKEN_ADDRESS to be set') } From 89bd60c4692067a8fe6771cad0cd87f375bbaa5b Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 25 Sep 2018 15:47:33 -0300 Subject: [PATCH 30/77] Add eslint plugin missing dependencies --- deploy/package-lock.json | 345 +++++++++++++++++++++++++++++++++++++++ deploy/package.json | 2 + 2 files changed, 347 insertions(+) diff --git a/deploy/package-lock.json b/deploy/package-lock.json index 8757c3596..a63423650 100644 --- a/deploy/package-lock.json +++ b/deploy/package-lock.json @@ -371,6 +371,12 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, "byline": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", @@ -486,6 +492,12 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", @@ -897,6 +909,15 @@ } } }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, "es-abstract": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", @@ -1056,6 +1077,117 @@ "get-stdin": "^6.0.0" } }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.5.0" + }, + "dependencies": { + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + } + } + }, + "eslint-module-utils": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz", + "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=", + "dev": true, + "requires": { + "debug": "^2.6.8", + "pkg-dir": "^1.0.0" + } + }, + "eslint-plugin-es": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.3.1.tgz", + "integrity": "sha512-9XcVyZiQRVeFjqHw8qHNDAZcQLqaHlOGGpeYqzYh8S4JYCWTCO3yzyen8yVmA5PratfzTRWDwCOFphtDEG+w/w==", + "dev": true, + "requires": { + "eslint-utils": "^1.3.0", + "regexpp": "^2.0.0" + } + }, + "eslint-plugin-import": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz", + "integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==", + "dev": true, + "requires": { + "contains-path": "^0.1.0", + "debug": "^2.6.8", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.1", + "eslint-module-utils": "^2.2.0", + "has": "^1.0.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.3", + "read-pkg-up": "^2.0.0", + "resolve": "^1.6.0" + }, + "dependencies": { + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + } + } + }, + "eslint-plugin-node": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz", + "integrity": "sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw==", + "dev": true, + "requires": { + "eslint-plugin-es": "^1.3.1", + "eslint-utils": "^1.3.1", + "ignore": "^4.0.2", + "minimatch": "^3.0.4", + "resolve": "^1.8.1", + "semver": "^5.5.0" + }, + "dependencies": { + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "dev": true + } + } + }, "eslint-plugin-prettier": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz", @@ -1415,6 +1547,16 @@ } } }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, "flat-cache": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", @@ -1688,6 +1830,12 @@ "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, "http-errors": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", @@ -1788,6 +1936,21 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", @@ -2045,6 +2208,36 @@ "type-check": "~0.3.2" } }, + "load-json-file": { + "version": "2.0.0", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", @@ -2268,6 +2461,18 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=" }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "number-to-bn": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", @@ -2385,6 +2590,24 @@ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, "p-timeout": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", @@ -2393,6 +2616,12 @@ "p-finally": "^1.0.0" } }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "parse-asn1": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", @@ -2414,11 +2643,29 @@ "trim": "0.0.1" } }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -2446,6 +2693,15 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, "pbkdf2": { "version": "3.0.14", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", @@ -2532,6 +2788,15 @@ } } }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "^1.0.0" + } + }, "pkg-fetch": { "version": "2.5.4", "resolved": "https://registry.npmjs.org/pkg-fetch/-/pkg-fetch-2.5.4.tgz", @@ -2824,6 +3089,38 @@ "unpipe": "1.0.0" } }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + } + } + }, "readable-stream": { "version": "2.3.5", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", @@ -3168,6 +3465,38 @@ "amdefine": ">=0.0.4" } }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", + "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==", + "dev": true + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -3239,6 +3568,12 @@ "ansi-regex": "^3.0.0" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, "strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", @@ -3589,6 +3924,16 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "validator": { "version": "9.4.1", "resolved": "http://registry.npmjs.org/validator/-/validator-9.4.1.tgz", diff --git a/deploy/package.json b/deploy/package.json index 121aa3d6c..ecace1df5 100644 --- a/deploy/package.json +++ b/deploy/package.json @@ -21,6 +21,8 @@ "eslint": "^5.6.0", "eslint-config-airbnb-base": "^13.1.0", "eslint-config-prettier": "^3.0.1", + "eslint-plugin-import": "^2.14.0", + "eslint-plugin-node": "^7.0.1", "eslint-plugin-prettier": "^2.6.2", "prettier": "^1.14.3" }, From 750d2e2b9f8af73830d73dbb19bf619dd4dde131 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 25 Sep 2018 15:50:58 -0300 Subject: [PATCH 31/77] Update mintedTotally method name on block reward contract --- contracts/IBlockReward.sol | 2 +- contracts/test/BlockReward.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/IBlockReward.sol b/contracts/IBlockReward.sol index 1df78ce4f..ffe6c7a24 100644 --- a/contracts/IBlockReward.sol +++ b/contracts/IBlockReward.sol @@ -3,5 +3,5 @@ pragma solidity 0.4.24; interface IBlockReward { function addExtraReceiver(uint256 _amount, address _receiver) external; - function totalMintedCoins() public view returns (uint256); + function mintedTotally() public view returns (uint256); } diff --git a/contracts/test/BlockReward.sol b/contracts/test/BlockReward.sol index b3ea4ed5a..8467cb2d0 100644 --- a/contracts/test/BlockReward.sol +++ b/contracts/test/BlockReward.sol @@ -19,7 +19,7 @@ contract BlockReward is IBlockReward { _receiver.transfer(_amount); } - function totalMintedCoins() public view returns (uint256) { + function mintedTotally() public view returns (uint256) { return mintedCoins; } } From e80fe122800c14479a1c3887559c04550b829bc6 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Tue, 25 Sep 2018 17:12:06 -0300 Subject: [PATCH 32/77] Move dependent env checks to deploy script --- deploy/deploy.js | 14 +++++++++++++- deploy/src/constants.js | 5 +++++ deploy/src/loadEnv.js | 13 +------------ 3 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 deploy/src/constants.js diff --git a/deploy/deploy.js b/deploy/deploy.js index 076ea33cf..ef74f60d9 100644 --- a/deploy/deploy.js +++ b/deploy/deploy.js @@ -1,8 +1,9 @@ const fs = require('fs') const path = require('path') const env = require('./src/loadEnv') +const { ZERO_ADDRESS } = require('./src/constants') -const { BRIDGE_MODE, ERC20_TOKEN_ADDRESS } = env +const { BRIDGE_MODE, BLOCK_REWARD_ADDRESS, ERC20_TOKEN_ADDRESS } = env const deployResultsPath = path.join(__dirname, './bridgeDeploymentResults.json') @@ -42,6 +43,10 @@ async function deployNativeToErc() { } async function deployErcToErc() { + if (ERC20_TOKEN_ADDRESS === ZERO_ADDRESS) { + throw new Error('ERC_TO_ERC mode requires ERC20_TOKEN_ADDRESS to be set') + } + const deployHome = require('./src/erc_to_erc/home') const deployForeign = require('./src/erc_to_erc/foreign') @@ -76,6 +81,13 @@ async function deployErcToErc() { } async function deployErcToNative() { + if (ERC20_TOKEN_ADDRESS === ZERO_ADDRESS) { + throw new Error('ERC_TO_NATIVE mode requires ERC20_TOKEN_ADDRESS to be set') + } + if (BLOCK_REWARD_ADDRESS === ZERO_ADDRESS) { + throw new Error('ERC_TO_NATIVE mode requires BLOCK_REWARD_ADDRESS to be set') + } + const deployHome = require('./src/erc_to_native/home') const deployForeign = require('./src/erc_to_native/foreign') diff --git a/deploy/src/constants.js b/deploy/src/constants.js new file mode 100644 index 000000000..362c403bb --- /dev/null +++ b/deploy/src/constants.js @@ -0,0 +1,5 @@ +const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' + +module.exports = { + ZERO_ADDRESS +} diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index 7bafded02..2004d77fe 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -1,12 +1,12 @@ const { isAddress, toBN } = require('web3').utils const path = require('path') const envalid = require('envalid') +const { ZERO_ADDRESS } = require('./constants') const dotEnvPath = path.join(__dirname, '..', '.env') // Validations and constants const validBridgeModes = ['NATIVE_TO_ERC', 'ERC_TO_ERC', 'ERC_TO_NATIVE'] -const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' const bigNumValidator = envalid.makeValidator(x => toBN(x)) const validateAddress = address => { if (isAddress(address)) { @@ -65,15 +65,4 @@ const env = envalid.cleanEnv( } ) -if ( - (env.BRIDGE_MODE === 'ERC_TO_ERC' || env.BRIDGE_MODE === 'ERC_TO_NATIVE') && - env.ERC20_TOKEN_ADDRESS === ZERO_ADDRESS -) { - throw new Error('ERC_TO_ERC mode requires ERC20_TOKEN_ADDRESS to be set') -} - -if (env.BRIDGE_MODE === 'ERC_TO_NATIVE' && env.BLOCK_REWARD_ADDRESS === ZERO_ADDRESS) { - throw new Error('ERC_TO_NATIVE mode requires BLOCK_REWARD_ADDRESS to be set') -} - module.exports = env From 5892b3792959e5dfc0379a7fb71fa383971c7388 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Thu, 27 Sep 2018 11:39:29 -0300 Subject: [PATCH 33/77] Fix bridge mode choices not being correctly passed --- deploy/src/loadEnv.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index 2004d77fe..301090e74 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -24,7 +24,7 @@ const addressesValidator = envalid.makeValidator(addresses => { const env = envalid.cleanEnv( process.env, { - BRIDGE_MODE: envalid.str(validBridgeModes), + BRIDGE_MODE: envalid.str({ choices: validBridgeModes }), DEPLOYMENT_ACCOUNT_PRIVATE_KEY: envalid.str(), DEPLOYMENT_GAS_LIMIT: bigNumValidator(), HOME_DEPLOYMENT_GAS_PRICE: bigNumValidator(), From ac473ca5dcc98b89ca9502f295a3477d062a398d Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 27 Sep 2018 16:39:06 -0300 Subject: [PATCH 34/77] Add bridge contract reference on ERC677BridgeToken --- contracts/ERC677BridgeToken.sol | 5 +++++ deploy/src/erc_to_erc/home.js | 14 ++++++++++++++ deploy/src/native_to_erc/foreign.js | 14 ++++++++++++++ test/poa20_test.js | 25 ++++++++++++++++++++++++- 4 files changed, 57 insertions(+), 1 deletion(-) diff --git a/contracts/ERC677BridgeToken.sol b/contracts/ERC677BridgeToken.sol index 91bf79f95..6c88fd17e 100644 --- a/contracts/ERC677BridgeToken.sol +++ b/contracts/ERC677BridgeToken.sol @@ -15,6 +15,7 @@ contract ERC677BridgeToken is MintableToken { Version.Version public getTokenInterfacesVersion = Version.Version(2, 0, 0); + address public bridgeContract; constructor( string _name, @@ -22,6 +23,10 @@ contract ERC677BridgeToken is uint8 _decimals) public DetailedERC20(_name, _symbol, _decimals) {} + function setBridgeContract(address _bridgeContract) onlyOwner public { + bridgeContract = _bridgeContract; + } + modifier validRecipient(address _recipient) { require(_recipient != address(0) && _recipient != address(this)); _; diff --git a/deploy/src/erc_to_erc/home.js b/deploy/src/erc_to_erc/home.js index 50ba3ca77..db8a040ff 100644 --- a/deploy/src/erc_to_erc/home.js +++ b/deploy/src/erc_to_erc/home.js @@ -133,6 +133,20 @@ async function deployHome() { homeNonce++ console.log('[Home] Bridgeble Token: ', erc677token.options.address) + console.log('\nset bridge contract on ERC677BridgeToken') + const setBridgeContractData = await erc677token.methods + .setBridgeContract(homeBridgeStorage.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const setBridgeContract = await sendRawTxHome({ + data: setBridgeContractData, + nonce: homeNonce, + to: erc677token.options.address, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL + }) + assert.equal(setBridgeContract.status, '0x1', 'Transaction Failed') + homeNonce++ + console.log('transferring ownership of Bridgeble token to homeBridge contract') const txOwnershipData = await erc677token.methods .transferOwnership(homeBridgeStorage.options.address) diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index dc3009541..52d1cfc7b 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -181,6 +181,20 @@ async function deployForeign() { assert.equal(txInitializeBridge.status, '0x1', 'Transaction Failed') foreignNonce++ + console.log('\nset bridge contract on ERC677BridgeToken') + const setBridgeContractData = await erc677bridgeToken.methods + .setBridgeContract(foreignBridgeStorage.options.address) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const setBridgeContract = await sendRawTxForeign({ + data: setBridgeContractData, + nonce: foreignNonce, + to: erc677bridgeToken.options.address, + privateKey: deploymentPrivateKey, + url: FOREIGN_RPC_URL + }) + assert.equal(setBridgeContract.status, '0x1', 'Transaction Failed') + foreignNonce++ + console.log('transferring ownership of ERC677BridgeToken token to foreignBridge contract') const txOwnershipData = await erc677bridgeToken.methods .transferOwnership(foreignBridgeStorage.options.address) diff --git a/test/poa20_test.js b/test/poa20_test.js index b073bfd2e..cd803893e 100644 --- a/test/poa20_test.js +++ b/test/poa20_test.js @@ -1,6 +1,6 @@ const POA20 = artifacts.require("ERC677BridgeToken.sol"); const ERC677ReceiverTest = artifacts.require("ERC677ReceiverTest.sol") -const {ERROR_MSG} = require('./setup'); +const { ERROR_MSG, ZERO_ADDRESS} = require('./setup'); contract('ERC677BridgeToken', async (accounts) => { let token @@ -31,6 +31,29 @@ contract('ERC677BridgeToken', async (accounts) => { minor.should.be.bignumber.gte(0) patch.should.be.bignumber.gte(0) }) + + describe('#bridgeContract', async() => { + it('can set bridge contract', async () => { + const bridgeAddress = '0x630d2c61234224fd9705457be61b830a0ea81822'; + (await token.bridgeContract()).should.be.equal(ZERO_ADDRESS); + + await token.setBridgeContract(bridgeAddress).should.be.fulfilled; + + (await token.bridgeContract()).should.be.equal(bridgeAddress); + }) + + it('only owner can set bridge contract', async () => { + const bridgeAddress = '0x630d2c61234224fd9705457be61b830a0ea81822'; + (await token.bridgeContract()).should.be.equal(ZERO_ADDRESS); + + await token.setBridgeContract(bridgeAddress, {from: user }).should.be.rejectedWith(ERROR_MSG); + (await token.bridgeContract()).should.be.equal(ZERO_ADDRESS); + + await token.setBridgeContract(bridgeAddress, {from: owner }).should.be.fulfilled; + (await token.bridgeContract()).should.be.equal(bridgeAddress); + }) + }) + describe('#mint', async() => { it('can mint by owner', async () => { (await token.totalSupply()).should.be.bignumber.equal(0); From 45db0ff5aeae5d5177b0dcc564102314db96ba05 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 27 Sep 2018 17:22:30 -0300 Subject: [PATCH 35/77] Revert token transfer if bridge method call fails --- contracts/ERC677BridgeToken.sol | 4 +- test/poa20_test.js | 65 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/contracts/ERC677BridgeToken.sol b/contracts/ERC677BridgeToken.sol index 6c88fd17e..0e37a8eb8 100644 --- a/contracts/ERC677BridgeToken.sol +++ b/contracts/ERC677BridgeToken.sol @@ -52,8 +52,8 @@ contract ERC677BridgeToken is function transfer(address _to, uint256 _value) public returns (bool) { require(superTransfer(_to, _value)); - if (isContract(_to)) { - contractFallback(_to, _value, new bytes(0)); + if (isContract(_to) && !contractFallback(_to, _value, new bytes(0)) && _to == bridgeContract) { + revert(); } return true; } diff --git a/test/poa20_test.js b/test/poa20_test.js index cd803893e..806e13bb0 100644 --- a/test/poa20_test.js +++ b/test/poa20_test.js @@ -1,6 +1,15 @@ const POA20 = artifacts.require("ERC677BridgeToken.sol"); const ERC677ReceiverTest = artifacts.require("ERC677ReceiverTest.sol") const { ERROR_MSG, ZERO_ADDRESS} = require('./setup'); +const Web3Utils = require('web3-utils'); +const HomeErcToErcBridge = artifacts.require("HomeBridgeErcToErc.sol"); +const ForeignNativeToErcBridge = artifacts.require("ForeignBridgeNativeToErc.sol"); +const BridgeValidators = artifacts.require("BridgeValidators.sol"); +const minPerTx = web3.toBigNumber(web3.toWei(0.01, "ether")); +const requireBlockConfirmations = 8; +const gasPrice = Web3Utils.toWei('1', 'gwei'); +const oneEther = web3.toBigNumber(web3.toWei(1, "ether")); +const halfEther = web3.toBigNumber(web3.toWei(0.5, "ether")); contract('ERC677BridgeToken', async (accounts) => { let token @@ -75,6 +84,16 @@ contract('ERC677BridgeToken', async (accounts) => { }) describe('#transfer', async() => { + let homeErcToErcContract, foreignNativeToErcBridge, validatorContract + beforeEach(async () => { + validatorContract = await BridgeValidators.new() + const authorities = [accounts[2]]; + await validatorContract.initialize(1, authorities, owner) + homeErcToErcContract = await HomeErcToErcBridge.new() + await homeErcToErcContract.initialize(validatorContract.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, token.address) + foreignNativeToErcBridge = await ForeignNativeToErcBridge.new() + await foreignNativeToErcBridge.initialize(validatorContract.address, token.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations); + }) it('sends tokens to recipient', async () => { await token.mint(user, 1, {from: owner }).should.be.fulfilled; await token.transfer(user, 1, {from: owner}).should.be.rejectedWith(ERROR_MSG); @@ -88,6 +107,52 @@ contract('ERC677BridgeToken', async (accounts) => { value: new web3.BigNumber(1) }) }) + + it('sends tokens to bridge contract', async () => { + await token.setBridgeContract(homeErcToErcContract.address).should.be.fulfilled; + await token.mint(user, web3.toWei(1, "ether"), {from: owner }).should.be.fulfilled; + + const result = await token.transfer(homeErcToErcContract.address, minPerTx, {from: user}).should.be.fulfilled; + result.logs[0].event.should.be.equal("Transfer") + result.logs[0].args.should.be.deep.equal({ + from: user, + to: homeErcToErcContract.address, + value: minPerTx + }) + + await token.setBridgeContract(foreignNativeToErcBridge.address).should.be.fulfilled; + const result2 = await token.transfer(foreignNativeToErcBridge.address, minPerTx, {from: user}).should.be.fulfilled; + result2.logs[0].event.should.be.equal("Transfer") + result2.logs[0].args.should.be.deep.equal({ + from: user, + to: foreignNativeToErcBridge.address, + value: minPerTx + }) + }) + + it('sends tokens to contract that does not contains onTokenTransfer method', async () => { + await token.setBridgeContract(homeErcToErcContract.address).should.be.fulfilled; + await token.mint(user, web3.toWei(1, "ether"), {from: owner }).should.be.fulfilled; + + const result = await token.transfer(validatorContract.address, minPerTx, {from: user}).should.be.fulfilled; + result.logs[0].event.should.be.equal("Transfer") + result.logs[0].args.should.be.deep.equal({ + from: user, + to: validatorContract.address, + value: minPerTx + }) + }) + + it('fail to send tokens to bridge contract out of limits', async () => { + const lessThanMin = web3.toBigNumber(web3.toWei(0.0001, "ether")) + await token.mint(user, web3.toWei(1, "ether"), {from: owner }).should.be.fulfilled; + + await token.setBridgeContract(homeErcToErcContract.address).should.be.fulfilled; + await token.transfer(homeErcToErcContract.address, lessThanMin, {from: user}).should.be.rejectedWith(ERROR_MSG); + + await token.setBridgeContract(foreignNativeToErcBridge.address).should.be.fulfilled; + await token.transfer(foreignNativeToErcBridge.address, lessThanMin, {from: user}).should.be.rejectedWith(ERROR_MSG); + }) }) describe("#burn", async () => { From 7b629ea7a3d2af9243b3c0a7161212569ec932c2 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 28 Sep 2018 10:28:33 -0300 Subject: [PATCH 36/77] Add bridge contract checks on ERC677BridgeToken --- contracts/ERC677BridgeToken.sol | 1 + test/poa20_test.js | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/contracts/ERC677BridgeToken.sol b/contracts/ERC677BridgeToken.sol index 0e37a8eb8..be39dfa88 100644 --- a/contracts/ERC677BridgeToken.sol +++ b/contracts/ERC677BridgeToken.sol @@ -24,6 +24,7 @@ contract ERC677BridgeToken is public DetailedERC20(_name, _symbol, _decimals) {} function setBridgeContract(address _bridgeContract) onlyOwner public { + require(_bridgeContract != address(0) && isContract(_bridgeContract)); bridgeContract = _bridgeContract; } diff --git a/test/poa20_test.js b/test/poa20_test.js index 806e13bb0..97b0a0ff5 100644 --- a/test/poa20_test.js +++ b/test/poa20_test.js @@ -43,23 +43,34 @@ contract('ERC677BridgeToken', async (accounts) => { describe('#bridgeContract', async() => { it('can set bridge contract', async () => { - const bridgeAddress = '0x630d2c61234224fd9705457be61b830a0ea81822'; + const homeErcToErcContract = await HomeErcToErcBridge.new(); (await token.bridgeContract()).should.be.equal(ZERO_ADDRESS); - await token.setBridgeContract(bridgeAddress).should.be.fulfilled; + await token.setBridgeContract(homeErcToErcContract.address).should.be.fulfilled; - (await token.bridgeContract()).should.be.equal(bridgeAddress); + (await token.bridgeContract()).should.be.equal(homeErcToErcContract.address); }) it('only owner can set bridge contract', async () => { - const bridgeAddress = '0x630d2c61234224fd9705457be61b830a0ea81822'; + const homeErcToErcContract = await HomeErcToErcBridge.new(); + (await token.bridgeContract()).should.be.equal(ZERO_ADDRESS); + + await token.setBridgeContract(homeErcToErcContract.address, {from: user }).should.be.rejectedWith(ERROR_MSG); + (await token.bridgeContract()).should.be.equal(ZERO_ADDRESS); + + await token.setBridgeContract(homeErcToErcContract.address, {from: owner }).should.be.fulfilled; + (await token.bridgeContract()).should.be.equal(homeErcToErcContract.address); + }) + + it('fail to set invalid bridge contract address', async () => { + const invalidContractAddress = '0xaaB52d66283F7A1D5978bcFcB55721ACB467384b'; (await token.bridgeContract()).should.be.equal(ZERO_ADDRESS); - await token.setBridgeContract(bridgeAddress, {from: user }).should.be.rejectedWith(ERROR_MSG); + await token.setBridgeContract(invalidContractAddress).should.be.rejectedWith(ERROR_MSG); (await token.bridgeContract()).should.be.equal(ZERO_ADDRESS); - await token.setBridgeContract(bridgeAddress, {from: owner }).should.be.fulfilled; - (await token.bridgeContract()).should.be.equal(bridgeAddress); + await token.setBridgeContract(ZERO_ADDRESS).should.be.rejectedWith(ERROR_MSG); + (await token.bridgeContract()).should.be.equal(ZERO_ADDRESS); }) }) From f50c9892393ab6ecd1ad17764f04d6158e604c2f Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 28 Sep 2018 11:24:05 -0300 Subject: [PATCH 37/77] Add transferAndCall tests for ERC677BridgeToken --- test/poa20_test.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/test/poa20_test.js b/test/poa20_test.js index 97b0a0ff5..f884bd116 100644 --- a/test/poa20_test.js +++ b/test/poa20_test.js @@ -177,6 +177,16 @@ contract('ERC677BridgeToken', async (accounts) => { }) describe('#transferAndCall', () => { + let homeErcToErcContract, foreignNativeToErcBridge, validatorContract + beforeEach(async () => { + validatorContract = await BridgeValidators.new() + const authorities = [accounts[2]]; + await validatorContract.initialize(1, authorities, owner) + homeErcToErcContract = await HomeErcToErcBridge.new() + await homeErcToErcContract.initialize(validatorContract.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, token.address) + foreignNativeToErcBridge = await ForeignNativeToErcBridge.new() + await foreignNativeToErcBridge.initialize(validatorContract.address, token.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations); + }) it('calls contractFallback', async () => { const receiver = await ERC677ReceiverTest.new(); (await receiver.from()).should.be.equal('0x0000000000000000000000000000000000000000'); @@ -199,6 +209,46 @@ contract('ERC677BridgeToken', async (accounts) => { (await receiver.data()).should.be.equal(callDoSomething123); (await receiver.someVar()).should.be.bignumber.equal('123'); }) + + it('sends tokens to bridge contract', async () => { + await token.setBridgeContract(homeErcToErcContract.address).should.be.fulfilled; + await token.mint(user, web3.toWei(1, "ether"), {from: owner }).should.be.fulfilled; + + const result = await token.transferAndCall(homeErcToErcContract.address, minPerTx, '0x', {from: user}).should.be.fulfilled; + result.logs[0].event.should.be.equal("Transfer") + result.logs[0].args.should.be.deep.equal({ + from: user, + to: homeErcToErcContract.address, + value: minPerTx + }) + + await token.setBridgeContract(foreignNativeToErcBridge.address).should.be.fulfilled; + const result2 = await token.transferAndCall(foreignNativeToErcBridge.address, minPerTx, '0x', {from: user}).should.be.fulfilled; + result2.logs[0].event.should.be.equal("Transfer") + result2.logs[0].args.should.be.deep.equal({ + from: user, + to: foreignNativeToErcBridge.address, + value: minPerTx + }) + }) + + it('fail to sends tokens to contract that does not contains onTokenTransfer method', async () => { + await token.setBridgeContract(homeErcToErcContract.address).should.be.fulfilled; + await token.mint(user, web3.toWei(1, "ether"), {from: owner }).should.be.fulfilled; + + await token.transferAndCall(validatorContract.address, minPerTx, '0x', {from: user}).should.be.rejectedWith(ERROR_MSG); + }) + + it('fail to send tokens to bridge contract out of limits', async () => { + const lessThanMin = web3.toBigNumber(web3.toWei(0.0001, "ether")) + await token.mint(user, web3.toWei(1, "ether"), {from: owner }).should.be.fulfilled; + + await token.setBridgeContract(homeErcToErcContract.address).should.be.fulfilled; + await token.transferAndCall(homeErcToErcContract.address, lessThanMin, '0x', {from: user}).should.be.rejectedWith(ERROR_MSG); + + await token.setBridgeContract(foreignNativeToErcBridge.address).should.be.fulfilled; + await token.transferAndCall(foreignNativeToErcBridge.address, lessThanMin, '0x', {from: user}).should.be.rejectedWith(ERROR_MSG); + }) }) describe('#claimtokens', async () => { it('can take send ERC20 tokens', async ()=> { From bcde71f34125a4db94b1d311223ec2e9de979be4 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Fri, 28 Sep 2018 11:28:17 -0300 Subject: [PATCH 38/77] Use different env variables validations for each mode --- deploy/deploy.js | 7 ---- deploy/src/loadEnv.js | 94 ++++++++++++++++++++++++++----------------- 2 files changed, 57 insertions(+), 44 deletions(-) diff --git a/deploy/deploy.js b/deploy/deploy.js index ef74f60d9..e2e0451bb 100644 --- a/deploy/deploy.js +++ b/deploy/deploy.js @@ -43,10 +43,6 @@ async function deployNativeToErc() { } async function deployErcToErc() { - if (ERC20_TOKEN_ADDRESS === ZERO_ADDRESS) { - throw new Error('ERC_TO_ERC mode requires ERC20_TOKEN_ADDRESS to be set') - } - const deployHome = require('./src/erc_to_erc/home') const deployForeign = require('./src/erc_to_erc/foreign') @@ -81,9 +77,6 @@ async function deployErcToErc() { } async function deployErcToNative() { - if (ERC20_TOKEN_ADDRESS === ZERO_ADDRESS) { - throw new Error('ERC_TO_NATIVE mode requires ERC20_TOKEN_ADDRESS to be set') - } if (BLOCK_REWARD_ADDRESS === ZERO_ADDRESS) { throw new Error('ERC_TO_NATIVE mode requires BLOCK_REWARD_ADDRESS to be set') } diff --git a/deploy/src/loadEnv.js b/deploy/src/loadEnv.js index 301090e74..2645a0568 100644 --- a/deploy/src/loadEnv.js +++ b/deploy/src/loadEnv.js @@ -1,10 +1,11 @@ -const { isAddress, toBN } = require('web3').utils const path = require('path') +require('dotenv').config({ + path: path.join(__dirname, '..', '.env') +}) +const { isAddress, toBN } = require('web3').utils const envalid = require('envalid') const { ZERO_ADDRESS } = require('./constants') -const dotEnvPath = path.join(__dirname, '..', '.env') - // Validations and constants const validBridgeModes = ['NATIVE_TO_ERC', 'ERC_TO_ERC', 'ERC_TO_NATIVE'] const bigNumValidator = envalid.makeValidator(x => toBN(x)) @@ -21,48 +22,67 @@ const addressesValidator = envalid.makeValidator(addresses => { return addresses }) -const env = envalid.cleanEnv( - process.env, - { - BRIDGE_MODE: envalid.str({ choices: validBridgeModes }), - DEPLOYMENT_ACCOUNT_PRIVATE_KEY: envalid.str(), - DEPLOYMENT_GAS_LIMIT: bigNumValidator(), - HOME_DEPLOYMENT_GAS_PRICE: bigNumValidator(), - FOREIGN_DEPLOYMENT_GAS_PRICE: bigNumValidator(), - GET_RECEIPT_INTERVAL_IN_MILLISECONDS: bigNumValidator(), +const { BRIDGE_MODE } = process.env + +if (!validBridgeModes.includes(BRIDGE_MODE)) { + throw new Error(`Invalid bridge mode: ${BRIDGE_MODE}`) +} + +let validations = { + DEPLOYMENT_ACCOUNT_PRIVATE_KEY: envalid.str(), + DEPLOYMENT_GAS_LIMIT: bigNumValidator(), + HOME_DEPLOYMENT_GAS_PRICE: bigNumValidator(), + FOREIGN_DEPLOYMENT_GAS_PRICE: bigNumValidator(), + GET_RECEIPT_INTERVAL_IN_MILLISECONDS: bigNumValidator(), + HOME_RPC_URL: envalid.str(), + HOME_OWNER_MULTISIG: addressValidator(), + HOME_UPGRADEABLE_ADMIN_VALIDATORS: addressesValidator(), + HOME_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), + HOME_DAILY_LIMIT: bigNumValidator(), + HOME_MAX_AMOUNT_PER_TX: bigNumValidator(), + HOME_MIN_AMOUNT_PER_TX: bigNumValidator(), + HOME_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), + HOME_GAS_PRICE: bigNumValidator(), + FOREIGN_RPC_URL: envalid.str(), + FOREIGN_OWNER_MULTISIG: addressValidator(), + FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS: addressValidator(), + FOREIGN_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), + FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), + FOREIGN_GAS_PRICE: bigNumValidator(), + REQUIRED_NUMBER_OF_VALIDATORS: envalid.num(), + VALIDATORS: addressesValidator() +} + +if (BRIDGE_MODE === 'NATIVE_TO_ERC') { + validations = { + ...validations, BRIDGEABLE_TOKEN_NAME: envalid.str(), BRIDGEABLE_TOKEN_SYMBOL: envalid.str(), BRIDGEABLE_TOKEN_DECIMALS: envalid.num(), - HOME_RPC_URL: envalid.str(), - HOME_OWNER_MULTISIG: addressValidator(), - HOME_UPGRADEABLE_ADMIN_VALIDATORS: addressesValidator(), - HOME_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), - HOME_DAILY_LIMIT: bigNumValidator(), - HOME_MAX_AMOUNT_PER_TX: bigNumValidator(), - HOME_MIN_AMOUNT_PER_TX: bigNumValidator(), - HOME_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), - HOME_GAS_PRICE: bigNumValidator(), - FOREIGN_RPC_URL: envalid.str(), - FOREIGN_OWNER_MULTISIG: addressValidator(), - FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS: addressValidator(), - FOREIGN_UPGRADEABLE_ADMIN_BRIDGE: addressValidator(), FOREIGN_DAILY_LIMIT: bigNumValidator(), FOREIGN_MAX_AMOUNT_PER_TX: bigNumValidator(), - FOREIGN_MIN_AMOUNT_PER_TX: bigNumValidator(), - FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS: envalid.num(), - FOREIGN_GAS_PRICE: bigNumValidator(), - REQUIRED_NUMBER_OF_VALIDATORS: envalid.num(), - VALIDATORS: addressesValidator(), - ERC20_TOKEN_ADDRESS: addressValidator({ - default: ZERO_ADDRESS - }), + FOREIGN_MIN_AMOUNT_PER_TX: bigNumValidator() + } +} +if (BRIDGE_MODE === 'ERC_TO_ERC') { + validations = { + ...validations, + ERC20_TOKEN_ADDRESS: addressValidator(), + BRIDGEABLE_TOKEN_NAME: envalid.str(), + BRIDGEABLE_TOKEN_SYMBOL: envalid.str(), + BRIDGEABLE_TOKEN_DECIMALS: envalid.num() + } +} +if (BRIDGE_MODE === 'ERC_TO_NATIVE') { + validations = { + ...validations, + ERC20_TOKEN_ADDRESS: addressValidator(), BLOCK_REWARD_ADDRESS: addressValidator({ default: ZERO_ADDRESS }) - }, - { - dotEnvPath } -) +} + +const env = envalid.cleanEnv(process.env, validations) module.exports = env From 2b7f2b855a528c40b6ef689819d9bb57ee7b8fc3 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Fri, 28 Sep 2018 11:30:56 -0300 Subject: [PATCH 39/77] Remove gas price validation in home erc-to-native contract --- .../erc20_to_native/HomeBridgeErcToNative.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index 306e3b8ab..04cabed0b 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -34,7 +34,6 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { { require(!isInitialized()); require(_validatorContract != address(0)); - require(_homeGasPrice > 0); require(_requiredBlockConfirmations > 0); require(_minPerTx > 0 && _maxPerTx > _minPerTx && _dailyLimit > _maxPerTx); require(_blockReward != address(0) && isContract(_blockReward)); From ae48ece3327aff19d47ae120d14ffc0efffa2785 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 28 Sep 2018 12:45:49 -0300 Subject: [PATCH 40/77] Add ContractFallbackCallFailed event --- contracts/ERC677BridgeToken.sol | 10 ++++++++-- test/poa20_test.js | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/contracts/ERC677BridgeToken.sol b/contracts/ERC677BridgeToken.sol index be39dfa88..43dd22ed2 100644 --- a/contracts/ERC677BridgeToken.sol +++ b/contracts/ERC677BridgeToken.sol @@ -17,6 +17,8 @@ contract ERC677BridgeToken is Version.Version public getTokenInterfacesVersion = Version.Version(2, 0, 0); address public bridgeContract; + event ContractFallbackCallFailed(address from, address to, uint value); + constructor( string _name, string _symbol, @@ -53,8 +55,12 @@ contract ERC677BridgeToken is function transfer(address _to, uint256 _value) public returns (bool) { require(superTransfer(_to, _value)); - if (isContract(_to) && !contractFallback(_to, _value, new bytes(0)) && _to == bridgeContract) { - revert(); + if (isContract(_to) && !contractFallback(_to, _value, new bytes(0))) { + if (_to == bridgeContract) { + revert(); + } else { + emit ContractFallbackCallFailed(msg.sender, _to, _value); + } } return true; } diff --git a/test/poa20_test.js b/test/poa20_test.js index f884bd116..f4d1d4c82 100644 --- a/test/poa20_test.js +++ b/test/poa20_test.js @@ -152,6 +152,12 @@ contract('ERC677BridgeToken', async (accounts) => { to: validatorContract.address, value: minPerTx }) + result.logs[1].event.should.be.equal("ContractFallbackCallFailed") + result.logs[1].args.should.be.deep.equal({ + from: user, + to: validatorContract.address, + value: minPerTx + }) }) it('fail to send tokens to bridge contract out of limits', async () => { From decc4fc83931997fe460ab8710718fb2aa808878 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Fri, 28 Sep 2018 15:00:43 -0300 Subject: [PATCH 41/77] Allow initializing bridge without block reward contract --- .../erc20_to_native/HomeBridgeErcToNative.sol | 6 ++++-- test/erc_to_native/home_bridge.test.js | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index 04cabed0b..e54801229 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -36,7 +36,7 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { require(_validatorContract != address(0)); require(_requiredBlockConfirmations > 0); require(_minPerTx > 0 && _maxPerTx > _minPerTx && _dailyLimit > _maxPerTx); - require(_blockReward != address(0) && isContract(_blockReward)); + require(_blockReward == address(0) || isContract(_blockReward)); addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; uintStorage[keccak256(abi.encodePacked("deployedAtBlock"))] = block.number; uintStorage[keccak256(abi.encodePacked("dailyLimit"))] = _dailyLimit; @@ -68,7 +68,9 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { } function onExecuteAffirmation(address _recipient, uint256 _value) internal returns(bool) { - blockRewardContract().addExtraReceiver(_value, _recipient); + IBlockReward blockReward = blockRewardContract(); + require(blockReward != address(0)); + blockReward.addExtraReceiver(_value, _recipient); return true; } diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 572cdf5ea..b94c96c71 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -297,6 +297,16 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; await homeBridge.executeAffirmation(recipient, value, transactionHash, {from: accounts[7]}).should.be.rejectedWith(ERROR_MSG); }) + + it('should fail if the block reward contract is not set', async () => { + homeBridge = await HomeBridge.new(); + await homeBridge.initialize(validatorContract.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, ZERO_ADDRESS); + + const recipient = accounts[5]; + const value = halfEther; + const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; + await homeBridge.executeAffirmation(recipient, value, transactionHash, {from: authorities[0]}).should.be.rejectedWith(ERROR_MSG) + }) }) describe('#submitSignature', async () => { From ef8a7d850deb277d99810d11be31aabf519b7310 Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Fri, 28 Sep 2018 15:20:03 -0300 Subject: [PATCH 42/77] Add script for setting block reward address --- deploy/deploy.js | 4 ---- deploy/src/utils/setBlockReward.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 deploy/src/utils/setBlockReward.js diff --git a/deploy/deploy.js b/deploy/deploy.js index e2e0451bb..76a76aff4 100644 --- a/deploy/deploy.js +++ b/deploy/deploy.js @@ -77,10 +77,6 @@ async function deployErcToErc() { } async function deployErcToNative() { - if (BLOCK_REWARD_ADDRESS === ZERO_ADDRESS) { - throw new Error('ERC_TO_NATIVE mode requires BLOCK_REWARD_ADDRESS to be set') - } - const deployHome = require('./src/erc_to_native/home') const deployForeign = require('./src/erc_to_native/foreign') diff --git a/deploy/src/utils/setBlockReward.js b/deploy/src/utils/setBlockReward.js new file mode 100644 index 000000000..4709361c8 --- /dev/null +++ b/deploy/src/utils/setBlockReward.js @@ -0,0 +1,28 @@ +const { web3Home, deploymentPrivateKey, HOME_RPC_URL } = require('../web3') +const { privateKeyToAddress, sendRawTxHome } = require('../deploymentUtils') +const HomeBridge = require('../../../build/contracts/HomeBridgeErcToNative.json') +const env = require('../loadEnv') + +const { BLOCK_REWARD_ADDRESS, DEPLOYMENT_ACCOUNT_PRIVATE_KEY, HOME_BRIDGE_ADDRESS } = env + +const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) + +async function setBlockReward() { + const homeNonce = await web3Home.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) + + const homeBridge = new web3Home.eth.Contract(HomeBridge.abi, HOME_BRIDGE_ADDRESS) + + const setBlockRewardAddressData = await homeBridge.methods + .setBlockRewardContract(BLOCK_REWARD_ADDRESS) + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + + await sendRawTxHome({ + data: setBlockRewardAddressData, + to: homeBridge.options.address, + privateKey: deploymentPrivateKey, + url: HOME_RPC_URL, + nonce: homeNonce + }) +} + +setBlockReward().catch(console.error) From 38565d20501979cd2b451f3eb8a9e6c630f135a1 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Wed, 3 Oct 2018 14:08:51 -0300 Subject: [PATCH 43/77] Add gas price on initialize foreign erc-to-erc --- .../erc20_to_erc20/ForeignBridgeErcToErc.sol | 5 ++++- deploy/src/erc_to_erc/foreign.js | 6 ++++-- test/erc_to_erc/foreign_bridge.test.js | 15 +++++++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol index 091c086b3..768eceb91 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol @@ -15,15 +15,18 @@ contract ForeignBridgeErcToErc is BasicBridge, BasicForeignBridge { function initialize( address _validatorContract, address _erc20token, - uint256 _requiredBlockConfirmations + uint256 _requiredBlockConfirmations, + uint256 _gasPrice ) public returns(bool) { require(!isInitialized(), "already initialized"); require(_validatorContract != address(0), "address cannot be empty"); require(_requiredBlockConfirmations != 0, "requiredBlockConfirmations cannot be 0"); + require(_gasPrice > 0); addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; setErc20token(_erc20token); uintStorage[keccak256(abi.encodePacked("deployedAtBlock"))] = block.number; uintStorage[keccak256(abi.encodePacked("requiredBlockConfirmations"))] = _requiredBlockConfirmations; + uintStorage[keccak256(abi.encodePacked("gasPrice"))] = _gasPrice; setInitialize(true); return isInitialized(); } diff --git a/deploy/src/erc_to_erc/foreign.js b/deploy/src/erc_to_erc/foreign.js index 91c1b0f68..9127d5f1e 100644 --- a/deploy/src/erc_to_erc/foreign.js +++ b/deploy/src/erc_to_erc/foreign.js @@ -18,7 +18,8 @@ const { FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS, FOREIGN_UPGRADEABLE_ADMIN_BRIDGE, FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, - ERC20_TOKEN_ADDRESS + ERC20_TOKEN_ADDRESS, + FOREIGN_GAS_PRICE } = env const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) @@ -142,7 +143,8 @@ async function deployForeign() { .initialize( storageValidatorsForeign.options.address, ERC20_TOKEN_ADDRESS, - FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS + FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS, + FOREIGN_GAS_PRICE ) .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) const txInitializeBridge = await sendRawTxForeign({ diff --git a/test/erc_to_erc/foreign_bridge.test.js b/test/erc_to_erc/foreign_bridge.test.js index 4d5ba7adf..d3b95ac1d 100644 --- a/test/erc_to_erc/foreign_bridge.test.js +++ b/test/erc_to_erc/foreign_bridge.test.js @@ -8,6 +8,7 @@ const {ERROR_MSG, ZERO_ADDRESS} = require('../setup'); const {createMessage, sign, signatureToVRS} = require('../helpers/helpers'); const halfEther = web3.toBigNumber(web3.toWei(0.5, "ether")); const requireBlockConfirmations = 8; +const gasPrice = web3.toWei('1', 'gwei') contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { let validatorContract, authorities, owner, token; @@ -28,7 +29,7 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { '0'.should.be.bignumber.equal(await foreignBridge.deployedAtBlock()) false.should.be.equal(await foreignBridge.isInitialized()) '0'.should.be.bignumber.equal(await foreignBridge.requiredBlockConfirmations()) - await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); token.address.should.be.equal(await foreignBridge.erc20token()); true.should.be.equal(await foreignBridge.isInitialized()) @@ -36,6 +37,8 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { token.address.should.be.equal(await foreignBridge.erc20token()); (await foreignBridge.deployedAtBlock()).should.be.bignumber.above(0); requireBlockConfirmations.should.be.bignumber.equal(await foreignBridge.requiredBlockConfirmations()) + const contractGasPrice = await foreignBridge.gasPrice() + contractGasPrice.should.be.bignumber.equal(gasPrice) const bridgeMode = '0xba4690f5' // 4 bytes of keccak256('erc-to-erc-core') const mode = await foreignBridge.getBridgeMode(); mode.should.be.equal(bridgeMode) @@ -50,7 +53,7 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { beforeEach(async () => { foreignBridge = await ForeignBridge.new() token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); - await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); await token.mint(foreignBridge.address,value); }) it('should allow to executeSignatures', async () => { @@ -134,7 +137,7 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { await multisigValidatorContract.initialize(2, twoAuthorities, ownerOfValidatorContract, {from: ownerOfValidatorContract}) foreignBridgeWithMultiSignatures = await ForeignBridge.new() const oneEther = web3.toBigNumber(web3.toWei(1, "ether")); - await foreignBridgeWithMultiSignatures.initialize(multisigValidatorContract.address, token.address, requireBlockConfirmations, {from: ownerOfValidatorContract}); + await foreignBridgeWithMultiSignatures.initialize(multisigValidatorContract.address, token.address, requireBlockConfirmations, gasPrice, {from: ownerOfValidatorContract}); await token.mint(foreignBridgeWithMultiSignatures.address,value); }) it('withdraw should fail if not enough signatures are provided', async () => { @@ -191,7 +194,7 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { await foreignBridgeProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled; foreignBridgeProxy = await ForeignBridge.at(foreignBridgeProxy.address); - await foreignBridgeProxy.initialize(validatorsProxy.address, token.address, requireBlockConfirmations) + await foreignBridgeProxy.initialize(validatorsProxy.address, token.address, requireBlockConfirmations, gasPrice) // Deploy V2 let foreignImplV2 = await ForeignBridgeV2.new(); @@ -211,7 +214,7 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { let storageProxy = await EternalStorageProxy.new().should.be.fulfilled; let foreignBridge = await ForeignBridge.new(); let data = foreignBridge.initialize.request( - fakeValidatorsAddress, fakeTokenAddress, requireBlockConfirmations).params[0].data + fakeValidatorsAddress, fakeTokenAddress, requireBlockConfirmations, gasPrice).params[0].data await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; let finalContract = await ForeignBridge.at(storageProxy.address); true.should.be.equal(await finalContract.isInitialized()); @@ -224,7 +227,7 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { const owner = accounts[0]; token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); foreignBridge = await ForeignBridge.new(); - await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); let tokenSecond = await ERC677BridgeToken.new("Roman Token", "RST", 18); From 4f30ca81adb521f37f33d0b1fdb4cf4695124e0c Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 4 Oct 2018 10:54:27 -0300 Subject: [PATCH 44/77] Test initialize fails if incorrect number of parameters --- test/erc_to_erc/foreign_bridge.test.js | 5 ++++- test/setup.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/erc_to_erc/foreign_bridge.test.js b/test/erc_to_erc/foreign_bridge.test.js index d3b95ac1d..b53f76074 100644 --- a/test/erc_to_erc/foreign_bridge.test.js +++ b/test/erc_to_erc/foreign_bridge.test.js @@ -4,7 +4,7 @@ const BridgeValidators = artifacts.require("BridgeValidators.sol"); const EternalStorageProxy = artifacts.require("EternalStorageProxy.sol"); const ERC677BridgeToken = artifacts.require("ERC677BridgeToken.sol"); -const {ERROR_MSG, ZERO_ADDRESS} = require('../setup'); +const {ERROR_MSG, ZERO_ADDRESS, INVALID_ARGUMENTS} = require('../setup'); const {createMessage, sign, signatureToVRS} = require('../helpers/helpers'); const halfEther = web3.toBigNumber(web3.toWei(0.5, "ether")); const requireBlockConfirmations = 8; @@ -29,6 +29,9 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { '0'.should.be.bignumber.equal(await foreignBridge.deployedAtBlock()) false.should.be.equal(await foreignBridge.isInitialized()) '0'.should.be.bignumber.equal(await foreignBridge.requiredBlockConfirmations()) + + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations).should.be.rejectedWith(INVALID_ARGUMENTS); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); token.address.should.be.equal(await foreignBridge.erc20token()); diff --git a/test/setup.js b/test/setup.js index cf96cdf10..c8f0382ab 100644 --- a/test/setup.js +++ b/test/setup.js @@ -8,3 +8,4 @@ require('chai') exports.ERROR_MSG = 'VM Exception while processing transaction: revert'; exports.ERROR_MSG_OPCODE = 'VM Exception while processing transaction: invalid opcode'; exports.ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' +exports.INVALID_ARGUMENTS = 'Invalid number of arguments to Solidity function' From 8b9858cd9be35a768bb0a2d8a6055777946a9da3 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 8 Oct 2018 16:05:53 -0300 Subject: [PATCH 45/77] Check amount of token available on fallback HomeBridgeErcToNative --- contracts/IBlockReward.sol | 1 + contracts/test/BlockReward.sol | 14 +++++++ .../erc20_to_native/HomeBridgeErcToNative.sol | 6 +++ test/erc_to_native/home_bridge.test.js | 42 +++++++++++++++++++ 4 files changed, 63 insertions(+) diff --git a/contracts/IBlockReward.sol b/contracts/IBlockReward.sol index ffe6c7a24..dfff214a3 100644 --- a/contracts/IBlockReward.sol +++ b/contracts/IBlockReward.sol @@ -4,4 +4,5 @@ pragma solidity 0.4.24; interface IBlockReward { function addExtraReceiver(uint256 _amount, address _receiver) external; function mintedTotally() public view returns (uint256); + function mintedTotallyByBridge(address _bridge) public view returns(uint256); } diff --git a/contracts/test/BlockReward.sol b/contracts/test/BlockReward.sol index 8467cb2d0..70ebb2f95 100644 --- a/contracts/test/BlockReward.sol +++ b/contracts/test/BlockReward.sol @@ -8,6 +8,8 @@ contract BlockReward is IBlockReward { using SafeMath for uint256; uint256 public mintedCoins = 0; + mapping(bytes32 => uint256) internal uintStorage; + bytes32 internal constant MINTED_TOTALLY_BY_BRIDGE = "mintedTotallyByBridge"; function () external payable { } @@ -16,10 +18,22 @@ contract BlockReward is IBlockReward { require(_amount > 0); require(_receiver != address(0)); mintedCoins = mintedCoins.add(_amount); + this.addMintedTotallyByBridge(_amount, msg.sender); _receiver.transfer(_amount); } function mintedTotally() public view returns (uint256) { return mintedCoins; } + + function mintedTotallyByBridge(address _bridge) public view returns(uint256) { + return uintStorage[ + keccak256(abi.encode(MINTED_TOTALLY_BY_BRIDGE, _bridge)) + ]; + } + + function addMintedTotallyByBridge(uint256 _amount, address _bridge) external { + bytes32 hash = keccak256(abi.encode(MINTED_TOTALLY_BY_BRIDGE, _bridge)); + uintStorage[hash] = uintStorage[hash].add(_amount); + } } diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index e54801229..21844552c 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -15,6 +15,12 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { require(msg.value > 0); require(msg.data.length == 0); require(withinLimit(msg.value)); + address blockRewardAddress = blockRewardContract(); + if(blockRewardAddress.call(abi.encodeWithSignature("mintedTotallyByBridge(address)", address(this)))) { + IBlockReward blockReward = IBlockReward(blockRewardAddress); + uint256 totalMinted = blockReward.mintedTotallyByBridge(address(this)); + require(msg.value <= totalMinted.sub(totalBurntCoins())); + } setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(msg.value)); setTotalBurntCoins(totalBurntCoins().add(msg.value)); address(0).transfer(msg.value); diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index b94c96c71..0e8fb6c76 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -108,6 +108,10 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { const currentDay = await homeContract.getCurrentDay() '0'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) + await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) + minted.should.be.bignumber.equal(10) + const {logs} = await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled logs[0].event.should.be.equal('UserRequestForSignature') @@ -119,6 +123,8 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { }) it('should accumulate burnt coins', async () => { + await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + const currentDay = await homeContract.getCurrentDay() '0'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) @@ -136,6 +142,8 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { }) it('doesnt let you send more than daily limit', async () => { + await blockRewardContract.addMintedTotallyByBridge(10, homeContract.address) + const currentDay = await homeContract.getCurrentDay() '0'.should.be.bignumber.equal(await homeContract.totalSpentPerDay(currentDay)) @@ -156,6 +164,8 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { }) it('doesnt let you send more than max amount per tx', async () => { + await blockRewardContract.addMintedTotallyByBridge(200, homeContract.address) + await homeContract.sendTransaction({ from: accounts[1], value: 1 @@ -185,6 +195,8 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { const newMaxPerTx = 50; const newMinPerTx = 20; + await blockRewardContract.addMintedTotallyByBridge(200, homeContract.address) + await homeContract.setDailyLimit(newDailyLimit).should.be.fulfilled; await homeContract.setMaxPerTx(newMaxPerTx).should.be.fulfilled; await homeContract.setMinPerTx(newMinPerTx).should.be.fulfilled; @@ -192,6 +204,36 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { await homeContract.sendTransaction({ from: accounts[1], value: newMinPerTx }).should.be.fulfilled await homeContract.sendTransaction({ from: accounts[1], value: newMinPerTx - 1 }).should.be.rejectedWith(ERROR_MSG) }) + + it('should fail if not enough bridged tokens', async () => { + + const initiallyMinted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) + initiallyMinted.should.be.bignumber.equal(0) + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) + + await blockRewardContract.addMintedTotallyByBridge(2, homeContract.address) + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.rejectedWith(ERROR_MSG) + + const minted = await blockRewardContract.mintedTotallyByBridge(homeContract.address) + const burnt = await homeContract.totalBurntCoins() + + minted.should.be.bignumber.equal(2) + burnt.should.be.bignumber.equal(2) + }) + + it('should work if mintedTotallyByBridge does not exists', async () => { + + await homeContract.setBlockRewardContract(validatorContract.address) + validatorContract.address.should.be.equal(await homeContract.blockRewardContract()) + + await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled + }) }) describe('#setting limits', async () => { From 205a7c3d1277958137fedf16569d03eac67bf4bb Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 8 Oct 2018 17:19:44 -0300 Subject: [PATCH 46/77] Remove revert reason ForeignBridgeErcToErc --- .../erc20_to_erc20/ForeignBridgeErcToErc.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol index 768eceb91..24f24a352 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol @@ -18,9 +18,9 @@ contract ForeignBridgeErcToErc is BasicBridge, BasicForeignBridge { uint256 _requiredBlockConfirmations, uint256 _gasPrice ) public returns(bool) { - require(!isInitialized(), "already initialized"); - require(_validatorContract != address(0), "address cannot be empty"); - require(_requiredBlockConfirmations != 0, "requiredBlockConfirmations cannot be 0"); + require(!isInitialized()); + require(_validatorContract != address(0)); + require(_requiredBlockConfirmations != 0); require(_gasPrice > 0); addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; setErc20token(_erc20token); From a4beb533483c29c8ebba50473fbd074693f55428 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 8 Oct 2018 17:20:03 -0300 Subject: [PATCH 47/77] Remove revert reason ForeignBridgeErcToNative --- .../erc20_to_native/ForeignBridgeErcToNative.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol index 3d4363e0a..eaa408b99 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol @@ -17,9 +17,9 @@ contract ForeignBridgeErcToNative is BasicBridge, BasicForeignBridge { uint256 _requiredBlockConfirmations, uint256 _gasPrice ) public returns(bool) { - require(!isInitialized(), "already initialized"); - require(_validatorContract != address(0), "address cannot be empty"); - require(_requiredBlockConfirmations != 0, "requiredBlockConfirmations cannot be 0"); + require(!isInitialized()); + require(_validatorContract != address(0)); + require(_requiredBlockConfirmations != 0); require(_gasPrice > 0); addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; setErc20token(_erc20token); From 31de52fe6b1152958fb4da5f2a686edc895cc84f Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 8 Oct 2018 17:27:35 -0300 Subject: [PATCH 48/77] Update initialize tests ForeignBridgeErcToErc --- test/erc_to_erc/foreign_bridge.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/erc_to_erc/foreign_bridge.test.js b/test/erc_to_erc/foreign_bridge.test.js index b53f76074..d7f2a30d3 100644 --- a/test/erc_to_erc/foreign_bridge.test.js +++ b/test/erc_to_erc/foreign_bridge.test.js @@ -32,6 +32,11 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations).should.be.rejectedWith(INVALID_ARGUMENTS); + await foreignBridge.initialize(ZERO_ADDRESS, token.address, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, ZERO_ADDRESS, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, token.address, 0, gasPrice).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, 0).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); token.address.should.be.equal(await foreignBridge.erc20token()); From 6d4c9939e8ccf1b2e45c67a5b826e1e61dd5f6e3 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 11 Oct 2018 14:31:21 -0300 Subject: [PATCH 49/77] Remove mintedTotallyByBridge check on HomeBridgeErcToNative --- .../erc20_to_native/HomeBridgeErcToNative.sol | 9 +++------ test/erc_to_native/home_bridge.test.js | 8 -------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index 21844552c..463f4dfcc 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -15,12 +15,9 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { require(msg.value > 0); require(msg.data.length == 0); require(withinLimit(msg.value)); - address blockRewardAddress = blockRewardContract(); - if(blockRewardAddress.call(abi.encodeWithSignature("mintedTotallyByBridge(address)", address(this)))) { - IBlockReward blockReward = IBlockReward(blockRewardAddress); - uint256 totalMinted = blockReward.mintedTotallyByBridge(address(this)); - require(msg.value <= totalMinted.sub(totalBurntCoins())); - } + IBlockReward blockReward = blockRewardContract(); + uint256 totalMinted = blockReward.mintedTotallyByBridge(address(this)); + require(msg.value <= totalMinted.sub(totalBurntCoins())); setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(msg.value)); setTotalBurntCoins(totalBurntCoins().add(msg.value)); address(0).transfer(msg.value); diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 0e8fb6c76..1abf2d983 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -226,14 +226,6 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { minted.should.be.bignumber.equal(2) burnt.should.be.bignumber.equal(2) }) - - it('should work if mintedTotallyByBridge does not exists', async () => { - - await homeContract.setBlockRewardContract(validatorContract.address) - validatorContract.address.should.be.equal(await homeContract.blockRewardContract()) - - await homeContract.sendTransaction({ from: accounts[1], value: 1 }).should.be.fulfilled - }) }) describe('#setting limits', async () => { From ad9ac7c7a4c8794fede7e66aac5aaa0c4346e8c8 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 11 Oct 2018 16:24:16 -0300 Subject: [PATCH 50/77] Add check for bridge address on setBlockRewardContract --- contracts/IBlockReward.sol | 1 + contracts/test/BlockReward.sol | 9 +++++++++ .../erc20_to_native/HomeBridgeErcToNative.sol | 13 +++++++++++++ test/erc_to_native/home_bridge.test.js | 15 +++++++++++++++ 4 files changed, 38 insertions(+) diff --git a/contracts/IBlockReward.sol b/contracts/IBlockReward.sol index dfff214a3..e027e7f04 100644 --- a/contracts/IBlockReward.sol +++ b/contracts/IBlockReward.sol @@ -5,4 +5,5 @@ interface IBlockReward { function addExtraReceiver(uint256 _amount, address _receiver) external; function mintedTotally() public view returns (uint256); function mintedTotallyByBridge(address _bridge) public view returns(uint256); + function bridgesAllowed() public pure returns(address[3]); } diff --git a/contracts/test/BlockReward.sol b/contracts/test/BlockReward.sol index 70ebb2f95..94f36756d 100644 --- a/contracts/test/BlockReward.sol +++ b/contracts/test/BlockReward.sol @@ -10,6 +10,7 @@ contract BlockReward is IBlockReward { uint256 public mintedCoins = 0; mapping(bytes32 => uint256) internal uintStorage; bytes32 internal constant MINTED_TOTALLY_BY_BRIDGE = "mintedTotallyByBridge"; + uint256 public constant bridgesAllowedLength = 3; function () external payable { } @@ -36,4 +37,12 @@ contract BlockReward is IBlockReward { bytes32 hash = keccak256(abi.encode(MINTED_TOTALLY_BY_BRIDGE, _bridge)); uintStorage[hash] = uintStorage[hash].add(_amount); } + + function bridgesAllowed() public pure returns(address[bridgesAllowedLength]) { + return([ + 0x0cDEE95B0Ed18FccEB4c344Df4dd1C1642798a8b, + 0x320051BbD4eeE344Bb86F0A858d03595837463eF, + 0xce42bdB34189a93c55De250E011c68FaeE374Dd3 + ]); + } } diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index 463f4dfcc..9f810664f 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -67,6 +67,7 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { function setBlockRewardContract(address _blockReward) public onlyOwner { require(_blockReward != address(0) && isContract(_blockReward)); + require(_isBridgeAllowed(_blockReward, this)); addressStorage[keccak256(abi.encodePacked("blockRewardContract"))] = _blockReward; } @@ -84,4 +85,16 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { function setTotalBurntCoins(uint256 _amount) internal { uintStorage[keccak256(abi.encodePacked("totalBurntCoins"))] = _amount; } + + function _isBridgeAllowed(address _blockReward, address _addr) private pure returns(bool) { + IBlockReward RewardContract = IBlockReward(_blockReward); + address[3] memory bridges = RewardContract.bridgesAllowed(); + + for (uint256 i = 0; i < bridges.length; i++) { + if (_addr == bridges[i]) { + return true; + } + } + return false; + } } diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 1abf2d983..5e0504be6 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -73,6 +73,21 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) }) + it('can update block reward contract only if bridge is allowed', async () => { + ZERO_ADDRESS.should.be.equal(await homeContract.blockRewardContract()) + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address).should.be.fulfilled + blockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) + + await homeContract.setBlockRewardContract(blockRewardContract.address) + blockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) + + const notAllowedHomeBridge = await HomeBridge.new() + + await notAllowedHomeBridge.setBlockRewardContract(blockRewardContract.address).should.be.rejectedWith(ERROR_MSG) + + ZERO_ADDRESS.should.be.equal(await notAllowedHomeBridge.blockRewardContract()) + }) + it('cant set maxPerTx > dailyLimit', async () => { false.should.be.equal(await homeContract.isInitialized()) From 00b4976937698887cba56f25bcc2f5335a05798c Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 12 Oct 2018 10:29:00 -0300 Subject: [PATCH 51/77] Revert "Add check for bridge address on setBlockRewardContract" This reverts commit ad9ac7c --- contracts/IBlockReward.sol | 1 - contracts/test/BlockReward.sol | 9 --------- .../erc20_to_native/HomeBridgeErcToNative.sol | 13 ------------- test/erc_to_native/home_bridge.test.js | 15 --------------- 4 files changed, 38 deletions(-) diff --git a/contracts/IBlockReward.sol b/contracts/IBlockReward.sol index e027e7f04..dfff214a3 100644 --- a/contracts/IBlockReward.sol +++ b/contracts/IBlockReward.sol @@ -5,5 +5,4 @@ interface IBlockReward { function addExtraReceiver(uint256 _amount, address _receiver) external; function mintedTotally() public view returns (uint256); function mintedTotallyByBridge(address _bridge) public view returns(uint256); - function bridgesAllowed() public pure returns(address[3]); } diff --git a/contracts/test/BlockReward.sol b/contracts/test/BlockReward.sol index 94f36756d..70ebb2f95 100644 --- a/contracts/test/BlockReward.sol +++ b/contracts/test/BlockReward.sol @@ -10,7 +10,6 @@ contract BlockReward is IBlockReward { uint256 public mintedCoins = 0; mapping(bytes32 => uint256) internal uintStorage; bytes32 internal constant MINTED_TOTALLY_BY_BRIDGE = "mintedTotallyByBridge"; - uint256 public constant bridgesAllowedLength = 3; function () external payable { } @@ -37,12 +36,4 @@ contract BlockReward is IBlockReward { bytes32 hash = keccak256(abi.encode(MINTED_TOTALLY_BY_BRIDGE, _bridge)); uintStorage[hash] = uintStorage[hash].add(_amount); } - - function bridgesAllowed() public pure returns(address[bridgesAllowedLength]) { - return([ - 0x0cDEE95B0Ed18FccEB4c344Df4dd1C1642798a8b, - 0x320051BbD4eeE344Bb86F0A858d03595837463eF, - 0xce42bdB34189a93c55De250E011c68FaeE374Dd3 - ]); - } } diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index 9f810664f..463f4dfcc 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -67,7 +67,6 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { function setBlockRewardContract(address _blockReward) public onlyOwner { require(_blockReward != address(0) && isContract(_blockReward)); - require(_isBridgeAllowed(_blockReward, this)); addressStorage[keccak256(abi.encodePacked("blockRewardContract"))] = _blockReward; } @@ -85,16 +84,4 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { function setTotalBurntCoins(uint256 _amount) internal { uintStorage[keccak256(abi.encodePacked("totalBurntCoins"))] = _amount; } - - function _isBridgeAllowed(address _blockReward, address _addr) private pure returns(bool) { - IBlockReward RewardContract = IBlockReward(_blockReward); - address[3] memory bridges = RewardContract.bridgesAllowed(); - - for (uint256 i = 0; i < bridges.length; i++) { - if (_addr == bridges[i]) { - return true; - } - } - return false; - } } diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 5e0504be6..1abf2d983 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -73,21 +73,6 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) }) - it('can update block reward contract only if bridge is allowed', async () => { - ZERO_ADDRESS.should.be.equal(await homeContract.blockRewardContract()) - await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address).should.be.fulfilled - blockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - - await homeContract.setBlockRewardContract(blockRewardContract.address) - blockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) - - const notAllowedHomeBridge = await HomeBridge.new() - - await notAllowedHomeBridge.setBlockRewardContract(blockRewardContract.address).should.be.rejectedWith(ERROR_MSG) - - ZERO_ADDRESS.should.be.equal(await notAllowedHomeBridge.blockRewardContract()) - }) - it('cant set maxPerTx > dailyLimit', async () => { false.should.be.equal(await homeContract.isInitialized()) From 339bd4ab0411b83f093af33d1d6a00a39af79654 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 12 Oct 2018 10:56:13 -0300 Subject: [PATCH 52/77] Add bridgesAllowedLength method check on setBlockRewardContract --- contracts/IBlockReward.sol | 1 + contracts/test/BlockReward.sol | 4 ++++ .../erc20_to_native/HomeBridgeErcToNative.sol | 2 +- test/erc_to_native/home_bridge.test.js | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/contracts/IBlockReward.sol b/contracts/IBlockReward.sol index dfff214a3..2d9e1b89a 100644 --- a/contracts/IBlockReward.sol +++ b/contracts/IBlockReward.sol @@ -5,4 +5,5 @@ interface IBlockReward { function addExtraReceiver(uint256 _amount, address _receiver) external; function mintedTotally() public view returns (uint256); function mintedTotallyByBridge(address _bridge) public view returns(uint256); + function bridgesAllowedLength() external view returns(uint256); } diff --git a/contracts/test/BlockReward.sol b/contracts/test/BlockReward.sol index 70ebb2f95..ea5c4cfa9 100644 --- a/contracts/test/BlockReward.sol +++ b/contracts/test/BlockReward.sol @@ -14,6 +14,10 @@ contract BlockReward is IBlockReward { function () external payable { } + function bridgesAllowedLength() external view returns(uint256) { + return 3; + } + function addExtraReceiver(uint256 _amount, address _receiver) external { require(_amount > 0); require(_receiver != address(0)); diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index 463f4dfcc..7fc21aa37 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -66,7 +66,7 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { } function setBlockRewardContract(address _blockReward) public onlyOwner { - require(_blockReward != address(0) && isContract(_blockReward)); + require(_blockReward != address(0) && isContract(_blockReward) && (IBlockReward(_blockReward).bridgesAllowedLength() != 0)); addressStorage[keccak256(abi.encodePacked("blockRewardContract"))] = _blockReward; } diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 1abf2d983..e6f20512b 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -71,6 +71,9 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { const notAContract = accounts[5] await homeContract.setBlockRewardContract(notAContract).should.be.rejectedWith(ERROR_MSG) secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) + + await homeContract.setBlockRewardContract(validatorContract.address).should.be.rejectedWith(ERROR_MSG) + secondBlockRewardContract.address.should.be.equal(await homeContract.blockRewardContract()) }) it('cant set maxPerTx > dailyLimit', async () => { From e4888ff3d920365c95122f4381f0f52632eea99f Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 19 Oct 2018 10:49:14 -0300 Subject: [PATCH 53/77] Fix interface version methods --- contracts/ERC677BridgeToken.sol | 7 ++++--- contracts/libraries/Version.sol | 12 ------------ contracts/upgradeable_contracts/BasicBridge.sol | 7 ++++--- contracts/upgradeable_contracts/BridgeValidators.sol | 7 ++++--- 4 files changed, 12 insertions(+), 21 deletions(-) delete mode 100644 contracts/libraries/Version.sol diff --git a/contracts/ERC677BridgeToken.sol b/contracts/ERC677BridgeToken.sol index 91bf79f95..ba2a0d334 100644 --- a/contracts/ERC677BridgeToken.sol +++ b/contracts/ERC677BridgeToken.sol @@ -5,7 +5,6 @@ import "openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol"; import "openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol"; import "./IBurnableMintableERC677Token.sol"; import "./ERC677Receiver.sol"; -import "./libraries/Version.sol"; contract ERC677BridgeToken is @@ -14,8 +13,6 @@ contract ERC677BridgeToken is BurnableToken, MintableToken { - Version.Version public getTokenInterfacesVersion = Version.Version(2, 0, 0); - constructor( string _name, string _symbol, @@ -39,6 +36,10 @@ contract ERC677BridgeToken is return true; } + function getTokenInterfacesVersion() public pure returns(uint64 major, uint64 minor, uint64 patch) { + return (2, 0, 0); + } + function superTransfer(address _to, uint256 _value) internal returns(bool) { return super.transfer(_to, _value); diff --git a/contracts/libraries/Version.sol b/contracts/libraries/Version.sol deleted file mode 100644 index 7e22b5100..000000000 --- a/contracts/libraries/Version.sol +++ /dev/null @@ -1,12 +0,0 @@ -pragma solidity 0.4.24; - - -library Version { - - struct Version { - uint64 major; - uint64 minor; - uint64 patch; - } - -} diff --git a/contracts/upgradeable_contracts/BasicBridge.sol b/contracts/upgradeable_contracts/BasicBridge.sol index 244b55c3e..6e6188060 100644 --- a/contracts/upgradeable_contracts/BasicBridge.sol +++ b/contracts/upgradeable_contracts/BasicBridge.sol @@ -2,7 +2,6 @@ pragma solidity 0.4.24; import "../IBridgeValidators.sol"; import "../upgradeability/EternalStorage.sol"; import "../libraries/SafeMath.sol"; -import "../libraries/Version.sol"; import "./Validatable.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol"; @@ -10,12 +9,14 @@ import "openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol"; contract BasicBridge is EternalStorage, Validatable { using SafeMath for uint256; - Version.Version public getBridgeInterfacesVersion = Version.Version(2, 0, 0); - event GasPriceChanged(uint256 gasPrice); event RequiredBlockConfirmationChanged(uint256 requiredBlockConfirmations); event DailyLimitChanged(uint256 newLimit); + function getBridgeInterfacesVersion() public pure returns(uint64 major, uint64 minor, uint64 patch) { + return (2, 0, 0); + } + function setGasPrice(uint256 _gasPrice) public onlyOwner { require(_gasPrice > 0); uintStorage[keccak256(abi.encodePacked("gasPrice"))] = _gasPrice; diff --git a/contracts/upgradeable_contracts/BridgeValidators.sol b/contracts/upgradeable_contracts/BridgeValidators.sol index c15393511..d3ee1edba 100644 --- a/contracts/upgradeable_contracts/BridgeValidators.sol +++ b/contracts/upgradeable_contracts/BridgeValidators.sol @@ -4,14 +4,11 @@ import "./Ownable.sol"; import "../IBridgeValidators.sol"; import "../libraries/SafeMath.sol"; import "../upgradeability/EternalStorage.sol"; -import "../libraries/Version.sol"; contract BridgeValidators is IBridgeValidators, EternalStorage, Ownable { using SafeMath for uint256; - Version.Version public getBridgeValidatorsInterfacesVersion = Version.Version(2, 0, 0); - event ValidatorAdded (address indexed validator); event ValidatorRemoved (address indexed validator); event RequiredSignaturesChanged (uint256 requiredSignatures); @@ -61,6 +58,10 @@ contract BridgeValidators is IBridgeValidators, EternalStorage, Ownable { emit RequiredSignaturesChanged(_requiredSignatures); } + function getBridgeValidatorsInterfacesVersion() public pure returns(uint64 major, uint64 minor, uint64 patch) { + return (2, 0, 0); + } + function requiredSignatures() public view returns(uint256) { return uintStorage[keccak256(abi.encodePacked("requiredSignatures"))]; } From f97ef501dedf28a63438e6485eb031d9bd76f642 Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Sat, 20 Oct 2018 09:44:10 +0300 Subject: [PATCH 54/77] Add erc20-to-native contracts to the flattening script --- flatten.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flatten.sh b/flatten.sh index 7f490dbab..1f1fe20da 100755 --- a/flatten.sh +++ b/flatten.sh @@ -1,13 +1,22 @@ #!/usr/bin/env bash -rm -rf flats/* +if [ -d flats ]; then + rm -rf flats +fi + mkdir -p flats/native_to_erc20 mkdir -p flats/erc20_to_erc20 +mkdir -p flats/erc20_to_native ./node_modules/.bin/truffle-flattener contracts/upgradeable_contracts/native_to_erc20/ForeignBridgeNativeToErc.sol > flats/native_to_erc20/ForeignBridgeNativeToErc_flat.sol ./node_modules/.bin/truffle-flattener contracts/upgradeable_contracts/native_to_erc20/HomeBridgeNativeToErc.sol > flats/native_to_erc20/HomeBridgeNativeToErc_flat.sol ./node_modules/.bin/truffle-flattener contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErc.sol > flats/erc20_to_erc20/HomeBridgeErcToErc_flat.sol ./node_modules/.bin/truffle-flattener contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol > flats/erc20_to_erc20/ForeignBridgeErcToErc_flat.sol + +./node_modules/.bin/truffle-flattener contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol > flats/erc20_to_native/HomeBridgeErcToNative_flat.sol +./node_modules/.bin/truffle-flattener contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol > flats/erc20_to_native/ForeignBridgeErcToNative_flat.sol + ./node_modules/.bin/truffle-flattener contracts/upgradeability/EternalStorageProxy.sol > flats/EternalStorageProxy_flat.sol +./node_modules/.bin/truffle-flattener contracts/upgradeable_contracts/BridgeValidators.sol > flats/BridgeValidators_flat.sol ./node_modules/.bin/truffle-flattener contracts/ERC677BridgeToken.sol > flats/ERC677BridgeToken_flat.sol From 8605f8949f8dda2904da931963fad76dad0824cb Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Sat, 20 Oct 2018 09:50:00 +0300 Subject: [PATCH 55/77] README with a note to update the flattening script added --- contracts/upgradeable_contracts/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 contracts/upgradeable_contracts/README.md diff --git a/contracts/upgradeable_contracts/README.md b/contracts/upgradeable_contracts/README.md new file mode 100644 index 000000000..41d2c8d52 --- /dev/null +++ b/contracts/upgradeable_contracts/README.md @@ -0,0 +1,3 @@ +Solidity contracts implemeting core bridge functionality. + +**Do not forget to update the flattening script when a new bridge mode is being implemented** From f4eb0f83b54fb959c79b534c2cd3e15cb8630465 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 18 Oct 2018 14:09:33 -0300 Subject: [PATCH 56/77] Add eth-gas-reporter for unit tests --- package-lock.json | 3399 +++++++++++++++++++++++++-------------------- package.json | 1 + truffle.js | 7 + 3 files changed, 1873 insertions(+), 1534 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb6e4eaba..37f350ac1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,18 +9,77 @@ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==" }, + "@types/concat-stream": { + "version": "1.6.0", + "resolved": "http://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-OU2+C7X+5Gs42JZzXoto7yOQ0A0=", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/form-data": { + "version": "0.0.33", + "resolved": "http://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha1-yayFsqX9GENbjIXZ7LUObWyJP/g=", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "9.6.35", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.35.tgz", + "integrity": "sha512-h5zvHS8wXHGa+Gcqs9K8vqCgOtqjr0+NqG/DDJmQIX1wpR9HivAfgV8bjcD3mGM4bPfQw5Aneb2Pn8355L83jA==", + "dev": true + }, + "@types/qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-mNhVdZHdtKHMMxbqzNK3RzkBcN1cux3AvuCYGTvjEIQT2uheH3eCAyYsbMbh2Bq8nXkeOWs1kyDiF7geWRFQ4Q==", + "dev": true + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "abi-decoder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/abi-decoder/-/abi-decoder-1.2.0.tgz", + "integrity": "sha512-y2OKSEW4gf2838Eavc56vQY9V46zaXkf3Jl1WpTfUBbzAVrXSr4JRZAAWv55Tv9s5WNz1rVgBgz5d2aJIL1QCg==", + "dev": true, + "requires": { + "web3": "^0.18.4" + }, + "dependencies": { + "bignumber.js": { + "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "from": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "dev": true + }, + "web3": { + "version": "0.18.4", + "resolved": "https://registry.npmjs.org/web3/-/web3-0.18.4.tgz", + "integrity": "sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0=", + "dev": true, + "requires": { + "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "crypto-js": "^3.1.4", + "utf8": "^2.1.1", + "xhr2": "*", + "xmlhttprequest": "*" + } + } + } + }, "accepts": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "requires": { - "mime-types": "2.1.18", + "mime-types": "~2.1.18", "negotiator": "0.6.1" } }, @@ -29,10 +88,10 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "align-text": { @@ -41,9 +100,9 @@ "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" }, "dependencies": { "kind-of": { @@ -52,7 +111,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -69,7 +128,7 @@ "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", "dev": true, "requires": { - "string-width": "2.1.1" + "string-width": "^2.0.0" }, "dependencies": { "ansi-regex": { @@ -90,8 +149,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -100,7 +159,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -120,7 +179,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { - "color-convert": "1.9.1" + "color-convert": "^1.9.0" } }, "any-observable": { @@ -134,8 +193,8 @@ "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, "requires": { - "micromatch": "3.1.10", - "normalize-path": "2.1.1" + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" } }, "argparse": { @@ -144,7 +203,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "arr-diff": { @@ -179,7 +238,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -198,6 +257,12 @@ "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, "asn1": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", @@ -230,7 +295,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", "requires": { - "lodash": "4.17.5" + "lodash": "^4.14.0" } }, "async-each": { @@ -270,9 +335,9 @@ "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" }, "dependencies": { "ansi-styles": { @@ -285,11 +350,11 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "supports-color": { @@ -304,25 +369,25 @@ "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", "requires": { - "babel-code-frame": "6.26.0", - "babel-generator": "6.26.1", - "babel-helpers": "6.24.1", - "babel-messages": "6.23.0", - "babel-register": "6.26.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "convert-source-map": "1.5.1", - "debug": "2.6.8", - "json5": "0.5.1", - "lodash": "4.17.5", - "minimatch": "3.0.4", - "path-is-absolute": "1.0.1", - "private": "0.1.8", - "slash": "1.0.0", - "source-map": "0.5.7" + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.0", + "debug": "^2.6.8", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.7", + "slash": "^1.0.0", + "source-map": "^0.5.6" }, "dependencies": { "babylon": { @@ -337,14 +402,14 @@ "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.5", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" }, "dependencies": { "jsesc": { @@ -359,9 +424,9 @@ "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz", "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=", "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-builder-binary-assignment-operator-visitor": { @@ -369,9 +434,9 @@ "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", "requires": { - "babel-helper-explode-assignable-expression": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-call-delegate": { @@ -379,10 +444,10 @@ "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-define-map": { @@ -390,10 +455,10 @@ "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.5" + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" } }, "babel-helper-explode-assignable-expression": { @@ -401,9 +466,9 @@ "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-explode-class": { @@ -411,10 +476,10 @@ "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz", "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=", "requires": { - "babel-helper-bindify-decorators": "6.24.1", - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-bindify-decorators": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-function-name": { @@ -422,11 +487,11 @@ "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", "requires": { - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-get-function-arity": { @@ -434,8 +499,8 @@ "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-hoist-variables": { @@ -443,8 +508,8 @@ "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-optimise-call-expression": { @@ -452,8 +517,8 @@ "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-regex": { @@ -461,9 +526,9 @@ "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.5" + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" } }, "babel-helper-remap-async-to-generator": { @@ -471,11 +536,11 @@ "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-replace-supers": { @@ -483,12 +548,12 @@ "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", "requires": { - "babel-helper-optimise-call-expression": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helpers": { @@ -496,8 +561,8 @@ "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-messages": { @@ -505,7 +570,7 @@ "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-check-es2015-constants": { @@ -513,7 +578,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-syntax-async-functions": { @@ -576,9 +641,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz", "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=", "requires": { - "babel-helper-remap-async-to-generator": "6.24.1", - "babel-plugin-syntax-async-generators": "6.13.0", - "babel-runtime": "6.26.0" + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-generators": "^6.5.0", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-async-to-generator": { @@ -586,9 +651,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", "requires": { - "babel-helper-remap-async-to-generator": "6.24.1", - "babel-plugin-syntax-async-functions": "6.13.0", - "babel-runtime": "6.26.0" + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-class-constructor-call": { @@ -596,9 +661,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz", "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=", "requires": { - "babel-plugin-syntax-class-constructor-call": "6.18.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-plugin-syntax-class-constructor-call": "^6.18.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-plugin-transform-class-properties": { @@ -606,10 +671,10 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", "requires": { - "babel-helper-function-name": "6.24.1", - "babel-plugin-syntax-class-properties": "6.13.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-helper-function-name": "^6.24.1", + "babel-plugin-syntax-class-properties": "^6.8.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-plugin-transform-decorators": { @@ -617,11 +682,11 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz", "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=", "requires": { - "babel-helper-explode-class": "6.24.1", - "babel-plugin-syntax-decorators": "6.13.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-explode-class": "^6.24.1", + "babel-plugin-syntax-decorators": "^6.13.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-arrow-functions": { @@ -629,7 +694,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-block-scoped-functions": { @@ -637,7 +702,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-block-scoping": { @@ -645,11 +710,11 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.5" + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" } }, "babel-plugin-transform-es2015-classes": { @@ -657,15 +722,15 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", "requires": { - "babel-helper-define-map": "6.26.0", - "babel-helper-function-name": "6.24.1", - "babel-helper-optimise-call-expression": "6.24.1", - "babel-helper-replace-supers": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-computed-properties": { @@ -673,8 +738,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-plugin-transform-es2015-destructuring": { @@ -682,7 +747,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-duplicate-keys": { @@ -690,8 +755,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-for-of": { @@ -699,7 +764,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-function-name": { @@ -707,9 +772,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-literals": { @@ -717,7 +782,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-modules-amd": { @@ -725,9 +790,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-plugin-transform-es2015-modules-commonjs": { @@ -735,10 +800,10 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", "requires": { - "babel-plugin-transform-strict-mode": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-types": "6.26.0" + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" } }, "babel-plugin-transform-es2015-modules-systemjs": { @@ -746,9 +811,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-plugin-transform-es2015-modules-umd": { @@ -756,9 +821,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", "requires": { - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-plugin-transform-es2015-object-super": { @@ -766,8 +831,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", "requires": { - "babel-helper-replace-supers": "6.24.1", - "babel-runtime": "6.26.0" + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-parameters": { @@ -775,12 +840,12 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", "requires": { - "babel-helper-call-delegate": "6.24.1", - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-shorthand-properties": { @@ -788,8 +853,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-spread": { @@ -797,7 +862,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-sticky-regex": { @@ -805,9 +870,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-template-literals": { @@ -815,7 +880,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-typeof-symbol": { @@ -823,7 +888,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-unicode-regex": { @@ -831,9 +896,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "regexpu-core": "2.0.0" + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" } }, "babel-plugin-transform-exponentiation-operator": { @@ -841,9 +906,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1", - "babel-plugin-syntax-exponentiation-operator": "6.13.0", - "babel-runtime": "6.26.0" + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-export-extensions": { @@ -851,8 +916,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz", "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=", "requires": { - "babel-plugin-syntax-export-extensions": "6.13.0", - "babel-runtime": "6.26.0" + "babel-plugin-syntax-export-extensions": "^6.8.0", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-flow-strip-types": { @@ -860,8 +925,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", "requires": { - "babel-plugin-syntax-flow": "6.18.0", - "babel-runtime": "6.26.0" + "babel-plugin-syntax-flow": "^6.18.0", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-object-rest-spread": { @@ -869,8 +934,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", "requires": { - "babel-plugin-syntax-object-rest-spread": "6.13.0", - "babel-runtime": "6.26.0" + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-runtime": "^6.26.0" } }, "babel-plugin-transform-regenerator": { @@ -878,7 +943,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", "requires": { - "regenerator-transform": "0.10.1" + "regenerator-transform": "^0.10.0" } }, "babel-plugin-transform-strict-mode": { @@ -886,8 +951,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-preset-es2015": { @@ -895,30 +960,30 @@ "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", "requires": { - "babel-plugin-check-es2015-constants": "6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoping": "6.26.0", - "babel-plugin-transform-es2015-classes": "6.24.1", - "babel-plugin-transform-es2015-computed-properties": "6.24.1", - "babel-plugin-transform-es2015-destructuring": "6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", - "babel-plugin-transform-es2015-for-of": "6.23.0", - "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-literals": "6.22.0", - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", - "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", - "babel-plugin-transform-es2015-modules-umd": "6.24.1", - "babel-plugin-transform-es2015-object-super": "6.24.1", - "babel-plugin-transform-es2015-parameters": "6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", - "babel-plugin-transform-es2015-spread": "6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "6.24.1", - "babel-plugin-transform-es2015-template-literals": "6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "babel-plugin-transform-regenerator": "6.26.0" + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.24.1", + "babel-plugin-transform-es2015-classes": "^6.24.1", + "babel-plugin-transform-es2015-computed-properties": "^6.24.1", + "babel-plugin-transform-es2015-destructuring": "^6.22.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1", + "babel-plugin-transform-es2015-for-of": "^6.22.0", + "babel-plugin-transform-es2015-function-name": "^6.24.1", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-transform-es2015-object-super": "^6.24.1", + "babel-plugin-transform-es2015-parameters": "^6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.24.1", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.24.1", + "babel-plugin-transform-regenerator": "^6.24.1" } }, "babel-preset-stage-1": { @@ -926,9 +991,9 @@ "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz", "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=", "requires": { - "babel-plugin-transform-class-constructor-call": "6.24.1", - "babel-plugin-transform-export-extensions": "6.22.0", - "babel-preset-stage-2": "6.24.1" + "babel-plugin-transform-class-constructor-call": "^6.24.1", + "babel-plugin-transform-export-extensions": "^6.22.0", + "babel-preset-stage-2": "^6.24.1" } }, "babel-preset-stage-2": { @@ -936,10 +1001,10 @@ "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz", "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=", "requires": { - "babel-plugin-syntax-dynamic-import": "6.18.0", - "babel-plugin-transform-class-properties": "6.24.1", - "babel-plugin-transform-decorators": "6.24.1", - "babel-preset-stage-3": "6.24.1" + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-decorators": "^6.24.1", + "babel-preset-stage-3": "^6.24.1" } }, "babel-preset-stage-3": { @@ -947,11 +1012,11 @@ "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz", "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=", "requires": { - "babel-plugin-syntax-trailing-function-commas": "6.22.0", - "babel-plugin-transform-async-generator-functions": "6.24.1", - "babel-plugin-transform-async-to-generator": "6.24.1", - "babel-plugin-transform-exponentiation-operator": "6.24.1", - "babel-plugin-transform-object-rest-spread": "6.26.0" + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-generator-functions": "^6.24.1", + "babel-plugin-transform-async-to-generator": "^6.24.1", + "babel-plugin-transform-exponentiation-operator": "^6.24.1", + "babel-plugin-transform-object-rest-spread": "^6.22.0" } }, "babel-register": { @@ -959,13 +1024,13 @@ "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "requires": { - "babel-core": "6.26.0", - "babel-runtime": "6.26.0", - "core-js": "2.5.3", - "home-or-tmp": "2.0.0", - "lodash": "4.17.5", - "mkdirp": "0.5.1", - "source-map-support": "0.4.18" + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" }, "dependencies": { "source-map-support": { @@ -973,7 +1038,7 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } } } @@ -983,8 +1048,8 @@ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "requires": { - "core-js": "2.5.3", - "regenerator-runtime": "0.11.1" + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" } }, "babel-template": { @@ -992,11 +1057,11 @@ "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "lodash": "4.17.5" + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" }, "dependencies": { "babylon": { @@ -1011,15 +1076,15 @@ "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "requires": { - "babel-code-frame": "6.26.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "debug": "2.6.8", - "globals": "9.18.0", - "invariant": "2.2.4", - "lodash": "4.17.5" + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" }, "dependencies": { "babylon": { @@ -1034,10 +1099,10 @@ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "requires": { - "babel-runtime": "6.26.0", - "esutils": "2.0.2", - "lodash": "4.17.5", - "to-fast-properties": "1.0.3" + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" } }, "babylon": { @@ -1056,13 +1121,13 @@ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { "define-property": { @@ -1071,7 +1136,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -1080,7 +1145,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -1089,7 +1154,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -1098,9 +1163,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -1111,7 +1176,7 @@ "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "big.js": { @@ -1121,6 +1186,7 @@ }, "bignumber.js": { "version": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", + "from": "bignumber.js@git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", "dev": true }, "binary-extensions": { @@ -1145,15 +1211,15 @@ "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", "requires": { "bytes": "3.0.0", - "content-type": "1.0.4", + "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "1.1.2", - "http-errors": "1.6.3", + "depd": "~1.1.1", + "http-errors": "~1.6.2", "iconv-lite": "0.4.19", - "on-finished": "2.3.0", + "on-finished": "~2.3.0", "qs": "6.5.1", "raw-body": "2.3.2", - "type-is": "1.6.16" + "type-is": "~1.6.15" }, "dependencies": { "debug": { @@ -1171,7 +1237,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } }, "boxen": { @@ -1180,13 +1246,13 @@ "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", "dev": true, "requires": { - "ansi-align": "2.0.0", - "camelcase": "4.1.0", - "chalk": "2.3.2", - "cli-boxes": "1.0.0", - "string-width": "2.1.1", - "term-size": "1.2.0", - "widest-line": "2.0.0" + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" }, "dependencies": { "ansi-regex": { @@ -1213,8 +1279,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -1223,7 +1289,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -1233,7 +1299,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -1243,16 +1309,16 @@ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -1261,7 +1327,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -1281,7 +1347,7 @@ "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.1.tgz", "integrity": "sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE=", "requires": { - "js-sha3": "0.3.1" + "js-sha3": "^0.3.1" }, "dependencies": { "js-sha3": { @@ -1291,6 +1357,12 @@ } } }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, "buffer-to-arraybuffer": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", @@ -1312,15 +1384,15 @@ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" } }, "cacheable-request": { @@ -1360,8 +1432,8 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "chai": { @@ -1370,12 +1442,12 @@ "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", "dev": true, "requires": { - "assertion-error": "1.1.0", - "check-error": "1.0.2", - "deep-eql": "3.0.1", - "get-func-name": "2.0.0", - "pathval": "1.1.0", - "type-detect": "4.0.8" + "assertion-error": "^1.0.1", + "check-error": "^1.0.1", + "deep-eql": "^3.0.0", + "get-func-name": "^2.0.0", + "pathval": "^1.0.0", + "type-detect": "^4.0.0" } }, "chai-as-promised": { @@ -1384,7 +1456,7 @@ "integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==", "dev": true, "requires": { - "check-error": "1.0.2" + "check-error": "^1.0.2" } }, "chai-bignumber": { @@ -1398,9 +1470,9 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.3.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "dependencies": { "has-flag": { @@ -1413,7 +1485,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -1423,6 +1495,12 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=" }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", + "dev": true + }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -1435,18 +1513,18 @@ "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==", "dev": true, "requires": { - "anymatch": "2.0.0", - "async-each": "1.0.1", - "braces": "2.3.2", - "fsevents": "1.2.3", - "glob-parent": "3.1.0", - "inherits": "2.0.3", - "is-binary-path": "1.0.1", - "is-glob": "4.0.0", - "normalize-path": "2.1.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.1.0", - "upath": "1.0.5" + "anymatch": "^2.0.0", + "async-each": "^1.0.0", + "braces": "^2.3.0", + "fsevents": "^1.1.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^2.1.1", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0", + "upath": "^1.0.0" } }, "ci-info": { @@ -1461,10 +1539,10 @@ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "define-property": { @@ -1473,7 +1551,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -1489,7 +1567,7 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "requires": { - "restore-cursor": "2.0.0" + "restore-cursor": "^2.0.0" } }, "cli-spinners": { @@ -1512,13 +1590,57 @@ } } }, + "cli-table3": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", + "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", + "dev": true, + "requires": { + "colors": "^1.1.2", + "object-assign": "^4.1.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, "cli-truncate": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz", "integrity": "sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ=", "requires": { "slice-ansi": "0.0.4", - "string-width": "1.0.2" + "string-width": "^1.0.1" } }, "cli-width": { @@ -1531,9 +1653,9 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" } }, "clone": { @@ -1551,7 +1673,7 @@ "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", "requires": { - "mimic-response": "1.0.0" + "mimic-response": "^1.0.0" } }, "clone-stats": { @@ -1564,9 +1686,9 @@ "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", "requires": { - "inherits": "2.0.3", - "process-nextick-args": "2.0.0", - "readable-stream": "2.3.5" + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" } }, "co": { @@ -1585,8 +1707,8 @@ "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, "color-convert": { @@ -1594,7 +1716,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "requires": { - "color-name": "1.1.3" + "color-name": "^1.1.1" } }, "color-name": { @@ -1612,7 +1734,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "commander": { @@ -1636,18 +1758,30 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, "configstore": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", "dev": true, "requires": { - "dot-prop": "4.2.0", - "graceful-fs": "4.1.11", - "make-dir": "1.2.0", - "unique-string": "1.0.0", - "write-file-atomic": "2.3.0", - "xdg-basedir": "3.0.0" + "dot-prop": "^4.1.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "unique-string": "^1.0.0", + "write-file-atomic": "^2.0.0", + "xdg-basedir": "^3.0.0" } }, "content-disposition": { @@ -1696,8 +1830,8 @@ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", "requires": { - "object-assign": "4.1.1", - "vary": "1.1.2" + "object-assign": "^4", + "vary": "^1" } }, "create-error-class": { @@ -1706,7 +1840,7 @@ "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", "dev": true, "requires": { - "capture-stack-trace": "1.0.0" + "capture-stack-trace": "^1.0.0" } }, "cross-spawn": { @@ -1714,9 +1848,9 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "requires": { - "lru-cache": "4.1.2", - "shebang-command": "1.2.0", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" }, "dependencies": { "lru-cache": { @@ -1724,18 +1858,24 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } } } }, + "crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", + "dev": true + }, "cryptiles": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", "requires": { - "boom": "5.2.0" + "boom": "5.x.x" }, "dependencies": { "boom": { @@ -1743,7 +1883,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } } } @@ -1770,7 +1910,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "date-fns": { @@ -1812,7 +1952,7 @@ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "requires": { - "mimic-response": "1.0.0" + "mimic-response": "^1.0.0" } }, "deep-eql": { @@ -1821,7 +1961,7 @@ "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "dev": true, "requires": { - "type-detect": "4.0.8" + "type-detect": "^4.0.0" } }, "deep-extend": { @@ -1841,8 +1981,8 @@ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" }, "dependencies": { "is-accessor-descriptor": { @@ -1851,7 +1991,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -1860,7 +2000,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -1869,9 +2009,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -1901,7 +2041,7 @@ "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, "diff": { @@ -1920,7 +2060,7 @@ "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", "dev": true, "requires": { - "is-obj": "1.0.1" + "is-obj": "^1.0.0" } }, "duplexer": { @@ -1940,7 +2080,7 @@ "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0" } }, "editions": { @@ -1968,13 +2108,13 @@ "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", "requires": { - "bn.js": "4.11.6", - "brorand": "1.1.0", - "hash.js": "1.1.3", - "hmac-drbg": "1.0.1", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" } }, "emojis-list": { @@ -1992,9 +2132,9 @@ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz", "integrity": "sha512-jox/62b2GofV1qTUQTMPEJSDIGycS43evqYzD/KVtEb9OCoki9cnacUPxCrZa7JfPzZSYOCZhu9O9luaMxAX8g==", "requires": { - "graceful-fs": "4.1.11", - "memory-fs": "0.4.1", - "tapable": "1.0.0" + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "tapable": "^1.0.0" } }, "errno": { @@ -2002,7 +2142,7 @@ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "requires": { - "prr": "1.0.1" + "prr": "~1.0.1" } }, "error": { @@ -2010,8 +2150,8 @@ "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=", "requires": { - "string-template": "0.2.1", - "xtend": "4.0.1" + "string-template": "~0.2.1", + "xtend": "~4.0.0" } }, "error-ex": { @@ -2019,7 +2159,7 @@ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "escape-html": { @@ -2038,11 +2178,11 @@ "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "dev": true, "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.2.0" + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" }, "dependencies": { "esprima": { @@ -2058,7 +2198,7 @@ "dev": true, "optional": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -2084,18 +2224,69 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "eth-gas-reporter": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.1.12.tgz", + "integrity": "sha512-Ao5uiXSA5Ep5fi/YvGCsFJMelMKj0fMJkAvWYzPVe1h3Mg9Z7X3Rs51ovG9izFZH7wSqnqydiC6SKDhZWpxK2g==", + "dev": true, + "requires": { + "abi-decoder": "^1.0.8", + "cli-table3": "^0.5.0", + "colors": "^1.1.2", + "lodash": "^4.17.4", + "mocha": "^4.1.0", + "req-cwd": "^2.0.0", + "request": "^2.83.0", + "request-promise-native": "^1.0.5", + "sha1": "^1.1.1", + "shelljs": "^0.7.8", + "solidity-parser-antlr": "^0.2.10", + "sync-request": "^6.0.0" + }, + "dependencies": { + "req-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz", + "integrity": "sha1-1AgrTURZgDZkD7c93qAe1T20nrw=", + "dev": true, + "requires": { + "req-from": "^2.0.0" + } + }, + "req-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/req-from/-/req-from-2.0.0.tgz", + "integrity": "sha1-10GI5H+TeW9Kpx327jWuaJ8+DnA=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + } + } + }, "eth-lib": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", "requires": { - "bn.js": "4.11.6", - "elliptic": "6.4.0", - "keccakjs": "0.2.1", - "nano-json-stream-parser": "0.1.2", - "servify": "0.1.12", - "ws": "3.3.3", - "xhr-request-promise": "0.1.2" + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "keccakjs": "^0.2.1", + "nano-json-stream-parser": "^0.1.2", + "servify": "^0.1.12", + "ws": "^3.0.0", + "xhr-request-promise": "^0.1.2" } }, "ethereumjs-testrpc-sc": { @@ -2104,8 +2295,8 @@ "integrity": "sha512-dBTav4AZQ7zuajmICv1k7bEesqS+8f0u0wciXNUJZb842RTBi0lgKEDF8WgZshzv4ThI+XVQSRNV/A+seiK4aA==", "dev": true, "requires": { - "source-map-support": "0.5.4", - "webpack-cli": "2.0.13" + "source-map-support": "^0.5.3", + "webpack-cli": "^2.0.9" } }, "ethjs-unit": { @@ -2123,13 +2314,13 @@ "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", "dev": true, "requires": { - "duplexer": "0.1.1", - "from": "0.1.7", - "map-stream": "0.1.0", + "duplexer": "~0.1.1", + "from": "~0", + "map-stream": "~0.1.0", "pause-stream": "0.0.11", - "split": "0.3.3", - "stream-combiner": "0.0.4", - "through": "2.3.8" + "split": "0.3", + "stream-combiner": "~0.0.4", + "through": "~2.3.1" } }, "execa": { @@ -2137,13 +2328,13 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "exit-hook": { @@ -2157,13 +2348,13 @@ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "debug": "2.6.8", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -2172,7 +2363,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -2181,7 +2372,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -2191,7 +2382,7 @@ "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "requires": { - "fill-range": "2.2.3" + "fill-range": "^2.1.0" }, "dependencies": { "fill-range": { @@ -2199,11 +2390,11 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^1.1.3", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" } }, "is-number": { @@ -2211,7 +2402,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "isobject": { @@ -2227,7 +2418,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -2237,7 +2428,7 @@ "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "requires": { - "homedir-polyfill": "1.0.1" + "homedir-polyfill": "^1.0.1" } }, "express": { @@ -2245,36 +2436,36 @@ "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", "requires": { - "accepts": "1.3.5", + "accepts": "~1.3.5", "array-flatten": "1.1.1", "body-parser": "1.18.2", "content-disposition": "0.5.2", - "content-type": "1.0.4", + "content-type": "~1.0.4", "cookie": "0.3.1", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "1.1.2", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "finalhandler": "1.1.1", "fresh": "0.5.2", "merge-descriptors": "1.0.1", - "methods": "1.1.2", - "on-finished": "2.3.0", - "parseurl": "1.3.2", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.3", + "proxy-addr": "~2.0.3", "qs": "6.5.1", - "range-parser": "1.2.0", + "range-parser": "~1.2.0", "safe-buffer": "5.1.1", "send": "0.16.2", "serve-static": "1.13.2", "setprototypeof": "1.1.0", - "statuses": "1.4.0", - "type-is": "1.6.16", + "statuses": "~1.4.0", + "type-is": "~1.6.16", "utils-merge": "1.0.1", - "vary": "1.1.2" + "vary": "~1.1.2" }, "dependencies": { "debug": { @@ -2303,8 +2494,8 @@ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -2313,7 +2504,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -2323,9 +2514,9 @@ "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", "requires": { - "chardet": "0.4.2", - "iconv-lite": "0.4.19", - "tmp": "0.0.33" + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" } }, "extglob": { @@ -2334,14 +2525,14 @@ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -2350,7 +2541,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -2359,7 +2550,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "is-accessor-descriptor": { @@ -2368,7 +2559,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -2377,7 +2568,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -2386,9 +2577,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -2419,7 +2610,7 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "requires": { - "escape-string-regexp": "1.0.5" + "escape-string-regexp": "^1.0.5" } }, "filename-regex": { @@ -2433,10 +2624,10 @@ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -2445,7 +2636,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -2456,12 +2647,12 @@ "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "requires": { "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.4.0", - "unpipe": "1.0.0" + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" }, "dependencies": { "debug": { @@ -2484,8 +2675,8 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "first-chunk-stream": { @@ -2493,7 +2684,7 @@ "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA=", "requires": { - "readable-stream": "2.3.5" + "readable-stream": "^2.0.2" } }, "flow-parser": { @@ -2506,7 +2697,7 @@ "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", "requires": { - "is-function": "1.0.1" + "is-function": "~1.0.0" } }, "for-in": { @@ -2519,7 +2710,7 @@ "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, "forever-agent": { @@ -2532,9 +2723,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { - "asynckit": "0.4.0", + "asynckit": "^0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.18" + "mime-types": "^2.1.12" } }, "forwarded": { @@ -2548,7 +2739,7 @@ "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { - "map-cache": "0.2.2" + "map-cache": "^0.2.2" } }, "fresh": { @@ -2567,8 +2758,8 @@ "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.5" + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" } }, "fs-extra": { @@ -2576,11 +2767,11 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0", - "klaw": "1.3.1", - "path-is-absolute": "1.0.1", - "rimraf": "2.6.2" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" } }, "fs.realpath": { @@ -2595,8 +2786,8 @@ "dev": true, "optional": true, "requires": { - "nan": "2.10.0", - "node-pre-gyp": "0.9.1" + "nan": "^2.9.2", + "node-pre-gyp": "^0.9.0" }, "dependencies": { "abbrev": { @@ -2622,8 +2813,8 @@ "dev": true, "optional": true, "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, "balanced-match": { @@ -2636,7 +2827,7 @@ "bundled": true, "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -2700,7 +2891,7 @@ "dev": true, "optional": true, "requires": { - "minipass": "2.2.4" + "minipass": "^2.2.1" } }, "fs.realpath": { @@ -2715,14 +2906,14 @@ "dev": true, "optional": true, "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" } }, "glob": { @@ -2731,12 +2922,12 @@ "dev": true, "optional": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "has-unicode": { @@ -2751,7 +2942,7 @@ "dev": true, "optional": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": "^2.1.0" } }, "ignore-walk": { @@ -2760,7 +2951,7 @@ "dev": true, "optional": true, "requires": { - "minimatch": "3.0.4" + "minimatch": "^3.0.4" } }, "inflight": { @@ -2769,8 +2960,8 @@ "dev": true, "optional": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -2789,7 +2980,7 @@ "bundled": true, "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "isarray": { @@ -2803,7 +2994,7 @@ "bundled": true, "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -2816,8 +3007,8 @@ "bundled": true, "dev": true, "requires": { - "safe-buffer": "5.1.1", - "yallist": "3.0.2" + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" } }, "minizlib": { @@ -2826,7 +3017,7 @@ "dev": true, "optional": true, "requires": { - "minipass": "2.2.4" + "minipass": "^2.2.1" } }, "mkdirp": { @@ -2849,9 +3040,9 @@ "dev": true, "optional": true, "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.21", - "sax": "1.2.4" + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" } }, "node-pre-gyp": { @@ -2860,16 +3051,16 @@ "dev": true, "optional": true, "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.2.0", - "nopt": "4.0.1", - "npm-packlist": "1.1.10", - "npmlog": "4.1.2", - "rc": "1.2.6", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "4.4.1" + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" } }, "nopt": { @@ -2878,8 +3069,8 @@ "dev": true, "optional": true, "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" + "abbrev": "1", + "osenv": "^0.1.4" } }, "npm-bundled": { @@ -2894,8 +3085,8 @@ "dev": true, "optional": true, "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.3" + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" } }, "npmlog": { @@ -2904,10 +3095,10 @@ "dev": true, "optional": true, "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" } }, "number-is-nan": { @@ -2926,7 +3117,7 @@ "bundled": true, "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "os-homedir": { @@ -2947,8 +3138,8 @@ "dev": true, "optional": true, "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, "path-is-absolute": { @@ -2969,10 +3160,10 @@ "dev": true, "optional": true, "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "~0.4.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "dependencies": { "minimist": { @@ -2989,13 +3180,13 @@ "dev": true, "optional": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "rimraf": { @@ -3004,7 +3195,7 @@ "dev": true, "optional": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "safe-buffer": { @@ -3047,9 +3238,9 @@ "bundled": true, "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { @@ -3058,7 +3249,7 @@ "dev": true, "optional": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, "strip-ansi": { @@ -3066,7 +3257,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-json-comments": { @@ -3081,13 +3272,13 @@ "dev": true, "optional": true, "requires": { - "chownr": "1.0.1", - "fs-minipass": "1.2.5", - "minipass": "2.2.4", - "minizlib": "1.1.0", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.1", - "yallist": "3.0.2" + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" } }, "util-deprecate": { @@ -3102,7 +3293,7 @@ "dev": true, "optional": true, "requires": { - "string-width": "1.0.2" + "string-width": "^1.0.2" } }, "wrappy": { @@ -3122,8 +3313,8 @@ "resolved": "https://registry.npmjs.org/ganache-cli/-/ganache-cli-6.1.0.tgz", "integrity": "sha512-FdTeyk4uLRHGeFiMe+Qnh4Hc5KiTVqvRVVvLDFJEVVKC1P1yHhEgZeh9sp1KhuvxSrxToxgJS25UapYQwH4zHw==", "requires": { - "source-map-support": "0.5.4", - "webpack-cli": "2.0.13" + "source-map-support": "^0.5.3", + "webpack-cli": "^2.0.9" } }, "get-caller-file": { @@ -3137,6 +3328,12 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", + "dev": true + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -3153,7 +3350,7 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "gh-got": { @@ -3161,8 +3358,8 @@ "resolved": "https://registry.npmjs.org/gh-got/-/gh-got-6.0.0.tgz", "integrity": "sha512-F/mS+fsWQMo1zfgG9MD8KWvTWPPzzhuVwY++fhQ5Ggd+0P+CAMHtzMZhNxG+TqGfHDChJKsbh6otfMGqO2AKBw==", "requires": { - "got": "7.1.0", - "is-plain-obj": "1.1.0" + "got": "^7.0.0", + "is-plain-obj": "^1.1.0" }, "dependencies": { "got": { @@ -3170,20 +3367,20 @@ "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", "requires": { - "decompress-response": "3.3.0", - "duplexer3": "0.1.4", - "get-stream": "3.0.0", - "is-plain-obj": "1.1.0", - "is-retry-allowed": "1.1.0", - "is-stream": "1.1.0", - "isurl": "1.0.0", - "lowercase-keys": "1.0.0", - "p-cancelable": "0.3.0", - "p-timeout": "1.2.1", - "safe-buffer": "5.1.1", - "timed-out": "4.0.1", - "url-parse-lax": "1.0.0", - "url-to-options": "1.0.1" + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" } }, "p-cancelable": { @@ -3196,7 +3393,7 @@ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", "requires": { - "p-finally": "1.0.0" + "p-finally": "^1.0.0" } } } @@ -3206,7 +3403,7 @@ "resolved": "https://registry.npmjs.org/github-username/-/github-username-4.1.0.tgz", "integrity": "sha1-y+KABBiDIG2kISrp5LXxacML9Bc=", "requires": { - "gh-got": "6.0.0" + "gh-got": "^6.0.0" } }, "glob": { @@ -3214,12 +3411,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-all": { @@ -3227,8 +3424,8 @@ "resolved": "https://registry.npmjs.org/glob-all/-/glob-all-3.1.0.tgz", "integrity": "sha1-iRPd+17hrHgSZWJBsD1SF8ZLAqs=", "requires": { - "glob": "7.1.1", - "yargs": "1.2.6" + "glob": "^7.0.5", + "yargs": "~1.2.6" }, "dependencies": { "minimist": { @@ -3241,7 +3438,7 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-1.2.6.tgz", "integrity": "sha1-nHtKgv1dWVsr8Xq23MQxNUMv40s=", "requires": { - "minimist": "0.1.0" + "minimist": "^0.1.0" } } } @@ -3251,8 +3448,8 @@ "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" }, "dependencies": { "glob-parent": { @@ -3260,7 +3457,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "requires": { - "is-glob": "2.0.1" + "is-glob": "^2.0.0" } }, "is-extglob": { @@ -3273,7 +3470,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } } } @@ -3284,8 +3481,8 @@ "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" }, "dependencies": { "is-glob": { @@ -3294,7 +3491,7 @@ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { - "is-extglob": "2.1.1" + "is-extglob": "^2.1.0" } } } @@ -3304,8 +3501,8 @@ "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", "requires": { - "min-document": "2.19.0", - "process": "0.5.2" + "min-document": "^2.19.0", + "process": "~0.5.1" } }, "global-dirs": { @@ -3314,7 +3511,7 @@ "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", "dev": true, "requires": { - "ini": "1.3.5" + "ini": "^1.3.4" } }, "global-modules": { @@ -3322,9 +3519,9 @@ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "requires": { - "global-prefix": "1.0.2", - "is-windows": "1.0.2", - "resolve-dir": "1.0.1" + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" } }, "global-prefix": { @@ -3332,11 +3529,11 @@ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", "requires": { - "expand-tilde": "2.0.2", - "homedir-polyfill": "1.0.1", - "ini": "1.3.5", - "is-windows": "1.0.2", - "which": "1.3.0" + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" } }, "globals": { @@ -3349,11 +3546,11 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "requires": { - "array-union": "1.0.2", - "glob": "7.1.1", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "got": { @@ -3362,17 +3559,17 @@ "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { - "create-error-class": "3.0.2", - "duplexer3": "0.1.4", - "get-stream": "3.0.0", - "is-redirect": "1.0.0", - "is-retry-allowed": "1.1.0", - "is-stream": "1.1.0", - "lowercase-keys": "1.0.0", - "safe-buffer": "5.1.1", - "timed-out": "4.0.1", - "unzip-response": "2.0.1", - "url-parse-lax": "1.0.0" + "create-error-class": "^3.0.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-redirect": "^1.0.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "lowercase-keys": "^1.0.0", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "unzip-response": "^2.0.1", + "url-parse-lax": "^1.0.0" } }, "graceful-fs": { @@ -3385,7 +3582,7 @@ "resolved": "https://registry.npmjs.org/grouped-queue/-/grouped-queue-0.3.3.tgz", "integrity": "sha1-wWfSpTGcWg4JZO9qJbfC34mWyFw=", "requires": { - "lodash": "4.17.5" + "lodash": "^4.17.2" } }, "growl": { @@ -3400,10 +3597,10 @@ "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "dev": true, "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" }, "dependencies": { "async": { @@ -3418,7 +3615,7 @@ "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -3433,8 +3630,8 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^5.1.0", + "har-schema": "^2.0.0" } }, "has-ansi": { @@ -3442,7 +3639,7 @@ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-color": { @@ -3466,7 +3663,7 @@ "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", "requires": { - "has-symbol-support-x": "1.4.2" + "has-symbol-support-x": "^1.4.1" } }, "has-value": { @@ -3475,9 +3672,9 @@ "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" } }, "has-values": { @@ -3486,8 +3683,8 @@ "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "kind-of": { @@ -3496,7 +3693,7 @@ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3506,8 +3703,8 @@ "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" } }, "hawk": { @@ -3515,10 +3712,10 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.1.0" + "boom": "4.x.x", + "cryptiles": "3.x.x", + "hoek": "4.x.x", + "sntp": "2.x.x" } }, "he": { @@ -3531,9 +3728,9 @@ "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "requires": { - "hash.js": "1.1.3", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, "hoek": { @@ -3546,8 +3743,8 @@ "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" } }, "homedir-polyfill": { @@ -3555,7 +3752,7 @@ "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", "requires": { - "parse-passwd": "1.0.0" + "parse-passwd": "^1.0.0" } }, "hosted-git-info": { @@ -3563,6 +3760,20 @@ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" }, + "http-basic": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-7.0.0.tgz", + "integrity": "sha1-gvClBr6UJzLsje6+6A50bvVzbbo=", + "dev": true, + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/node": "^9.4.1", + "caseless": "~0.12.0", + "concat-stream": "^1.4.6", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + } + }, "http-cache-semantics": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", @@ -3573,10 +3784,19 @@ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { - "depd": "1.1.2", + "depd": "~1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.0", - "statuses": "1.5.0" + "statuses": ">= 1.4.0 < 2" + } + }, + "http-response-object": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.1.tgz", + "integrity": "sha512-6L0Fkd6TozA8kFSfh9Widst0wfza3U1Ex2RjJ6zNDK0vR1U1auUR6jY4Nn2Xl7CCy0ikFmxW1XcspVpb9RvwTg==", + "dev": true, + "requires": { + "@types/node": "^9.3.0" } }, "http-signature": { @@ -3584,9 +3804,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "iconv-lite": { @@ -3616,7 +3836,7 @@ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, "inflight": { @@ -3624,8 +3844,8 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -3643,19 +3863,19 @@ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", "requires": { - "ansi-escapes": "3.1.0", - "chalk": "2.3.2", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "2.1.0", - "figures": "2.0.0", - "lodash": "4.17.5", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.1.0", + "figures": "^2.0.0", + "lodash": "^4.3.0", "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rxjs": "5.5.7", - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "through": "2.3.8" + "run-async": "^2.2.0", + "rxjs": "^5.5.2", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" }, "dependencies": { "ansi-regex": { @@ -3673,8 +3893,8 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -3682,7 +3902,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -3697,8 +3917,8 @@ "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", "requires": { - "from2": "2.3.0", - "p-is-promise": "1.1.0" + "from2": "^2.1.1", + "p-is-promise": "^1.1.0" } }, "invariant": { @@ -3706,7 +3926,7 @@ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "requires": { - "loose-envify": "1.3.1" + "loose-envify": "^1.0.0" } }, "invert-kv": { @@ -3725,7 +3945,7 @@ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -3734,7 +3954,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3750,7 +3970,7 @@ "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "1.11.0" + "binary-extensions": "^1.0.0" } }, "is-buffer": { @@ -3763,7 +3983,7 @@ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, "is-ci": { @@ -3772,7 +3992,7 @@ "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", "dev": true, "requires": { - "ci-info": "1.1.3" + "ci-info": "^1.0.0" } }, "is-data-descriptor": { @@ -3781,7 +4001,7 @@ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -3790,7 +4010,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3801,9 +4021,9 @@ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "dependencies": { "kind-of": { @@ -3824,7 +4044,7 @@ "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", "requires": { - "is-primitive": "2.0.0" + "is-primitive": "^2.0.0" } }, "is-extendable": { @@ -3843,7 +4063,7 @@ "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-fullwidth-code-point": { @@ -3851,7 +4071,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-function": { @@ -3865,7 +4085,7 @@ "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", "dev": true, "requires": { - "is-extglob": "2.1.1" + "is-extglob": "^2.1.1" } }, "is-hex-prefixed": { @@ -3879,8 +4099,8 @@ "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", "dev": true, "requires": { - "global-dirs": "0.1.1", - "is-path-inside": "1.0.1" + "global-dirs": "^0.1.0", + "is-path-inside": "^1.0.0" } }, "is-npm": { @@ -3894,7 +4114,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -3902,7 +4122,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3923,7 +4143,7 @@ "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-0.2.0.tgz", "integrity": "sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI=", "requires": { - "symbol-observable": "0.2.4" + "symbol-observable": "^0.2.2" }, "dependencies": { "symbol-observable": { @@ -3939,7 +4159,7 @@ "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", "dev": true, "requires": { - "is-number": "4.0.0" + "is-number": "^4.0.0" }, "dependencies": { "is-number": { @@ -3956,7 +4176,7 @@ "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { - "path-is-inside": "1.0.2" + "path-is-inside": "^1.0.1" } }, "is-plain-obj": { @@ -3970,7 +4190,7 @@ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "is-posix-bracket": { @@ -4004,7 +4224,7 @@ "resolved": "https://registry.npmjs.org/is-scoped/-/is-scoped-1.0.0.tgz", "integrity": "sha1-RJypgpnnEwOCViieyytUDcQ3yzA=", "requires": { - "scoped-regex": "1.0.0" + "scoped-regex": "^1.0.0" } }, "is-stream": { @@ -4054,20 +4274,20 @@ "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", "dev": true, "requires": { - "abbrev": "1.0.9", - "async": "1.5.2", - "escodegen": "1.8.1", - "esprima": "2.7.3", - "glob": "5.0.15", - "handlebars": "4.0.11", - "js-yaml": "3.11.0", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "once": "1.4.0", - "resolve": "1.1.7", - "supports-color": "3.1.2", - "which": "1.3.0", - "wordwrap": "1.0.0" + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" }, "dependencies": { "abbrev": { @@ -4094,11 +4314,11 @@ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "dev": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "nopt": { @@ -4107,7 +4327,7 @@ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1.0.9" + "abbrev": "1" } }, "resolve": { @@ -4123,9 +4343,9 @@ "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-2.2.1.tgz", "integrity": "sha512-TS+hoFl8Z5FAFMK38nhBkdLt44CclNRgDHWeMgsV8ko3nDlr/9UI2Sf839sW7enijf8oKsZYXRvM8g0it9Zmcw==", "requires": { - "binaryextensions": "2.1.1", - "editions": "1.3.4", - "textextensions": "2.2.0" + "binaryextensions": "2", + "editions": "^1.3.3", + "textextensions": "2" } }, "isurl": { @@ -4133,8 +4353,8 @@ "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "requires": { - "has-to-string-tag-x": "1.4.1", - "is-object": "1.0.1" + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" } }, "jade": { @@ -4178,8 +4398,8 @@ "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "jsbn": { @@ -4193,21 +4413,21 @@ "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.5.0.tgz", "integrity": "sha512-JAcQINNMFpdzzpKJN8k5xXjF3XDuckB1/48uScSzcnNyK199iWEc9AxKL9OoX5144M2w5zEx9Qs4/E/eBZZUlw==", "requires": { - "babel-plugin-transform-flow-strip-types": "6.22.0", - "babel-preset-es2015": "6.24.1", - "babel-preset-stage-1": "6.24.1", - "babel-register": "6.26.0", - "babylon": "7.0.0-beta.42", - "colors": "1.2.1", - "flow-parser": "0.68.0", - "lodash": "4.17.5", - "micromatch": "2.3.11", - "neo-async": "2.5.0", + "babel-plugin-transform-flow-strip-types": "^6.8.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-stage-1": "^6.5.0", + "babel-register": "^6.9.0", + "babylon": "^7.0.0-beta.30", + "colors": "^1.1.2", + "flow-parser": "^0.*", + "lodash": "^4.13.1", + "micromatch": "^2.3.7", + "neo-async": "^2.5.0", "node-dir": "0.1.8", - "nomnom": "1.8.1", - "recast": "0.14.7", - "temp": "0.8.3", - "write-file-atomic": "1.3.4" + "nomnom": "^1.8.1", + "recast": "^0.14.1", + "temp": "^0.8.1", + "write-file-atomic": "^1.2.0" }, "dependencies": { "arr-diff": { @@ -4215,7 +4435,7 @@ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "array-unique": { @@ -4228,9 +4448,9 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "expand-brackets": { @@ -4238,7 +4458,7 @@ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "extglob": { @@ -4246,7 +4466,7 @@ "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-extglob": { @@ -4259,7 +4479,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "kind-of": { @@ -4267,7 +4487,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } }, "micromatch": { @@ -4275,19 +4495,19 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" } }, "write-file-atomic": { @@ -4295,9 +4515,9 @@ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "slide": "1.1.6" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" } } } @@ -4342,7 +4562,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } }, "jsprim": { @@ -4361,8 +4581,8 @@ "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.1.tgz", "integrity": "sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0=", "requires": { - "browserify-sha3": "0.0.1", - "sha3": "1.2.0" + "browserify-sha3": "^0.0.1", + "sha3": "^1.1.0" } }, "keyv": { @@ -4384,7 +4604,7 @@ "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.9" } }, "latest-version": { @@ -4393,7 +4613,7 @@ "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", "dev": true, "requires": { - "package-json": "4.0.1" + "package-json": "^4.0.0" } }, "lazy-cache": { @@ -4408,7 +4628,7 @@ "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "levn": { @@ -4417,8 +4637,8 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "listr": { @@ -4426,23 +4646,23 @@ "resolved": "https://registry.npmjs.org/listr/-/listr-0.13.0.tgz", "integrity": "sha1-ILsLowuuZg7oTMBQPfS+PVYjiH0=", "requires": { - "chalk": "1.1.3", - "cli-truncate": "0.2.1", - "figures": "1.7.0", - "indent-string": "2.1.0", - "is-observable": "0.2.0", - "is-promise": "2.1.0", - "is-stream": "1.1.0", - "listr-silent-renderer": "1.1.1", - "listr-update-renderer": "0.4.0", - "listr-verbose-renderer": "0.4.1", - "log-symbols": "1.0.2", - "log-update": "1.0.2", - "ora": "0.2.3", - "p-map": "1.2.0", - "rxjs": "5.5.7", - "stream-to-observable": "0.2.0", - "strip-ansi": "3.0.1" + "chalk": "^1.1.3", + "cli-truncate": "^0.2.1", + "figures": "^1.7.0", + "indent-string": "^2.1.0", + "is-observable": "^0.2.0", + "is-promise": "^2.1.0", + "is-stream": "^1.1.0", + "listr-silent-renderer": "^1.1.1", + "listr-update-renderer": "^0.4.0", + "listr-verbose-renderer": "^0.4.0", + "log-symbols": "^1.0.2", + "log-update": "^1.0.2", + "ora": "^0.2.3", + "p-map": "^1.1.1", + "rxjs": "^5.4.2", + "stream-to-observable": "^0.2.0", + "strip-ansi": "^3.0.1" }, "dependencies": { "ansi-styles": { @@ -4455,11 +4675,11 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "figures": { @@ -4467,8 +4687,8 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" } }, "log-symbols": { @@ -4476,7 +4696,7 @@ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", "requires": { - "chalk": "1.1.3" + "chalk": "^1.0.0" } }, "supports-color": { @@ -4496,14 +4716,14 @@ "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz", "integrity": "sha1-NE2YDaLKLosUW6MFkI8yrj9MyKc=", "requires": { - "chalk": "1.1.3", - "cli-truncate": "0.2.1", - "elegant-spinner": "1.0.1", - "figures": "1.7.0", - "indent-string": "3.2.0", - "log-symbols": "1.0.2", - "log-update": "1.0.2", - "strip-ansi": "3.0.1" + "chalk": "^1.1.3", + "cli-truncate": "^0.2.1", + "elegant-spinner": "^1.0.1", + "figures": "^1.7.0", + "indent-string": "^3.0.0", + "log-symbols": "^1.0.2", + "log-update": "^1.0.2", + "strip-ansi": "^3.0.1" }, "dependencies": { "ansi-styles": { @@ -4516,11 +4736,11 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "figures": { @@ -4528,8 +4748,8 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" } }, "indent-string": { @@ -4542,7 +4762,7 @@ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", "requires": { - "chalk": "1.1.3" + "chalk": "^1.0.0" } }, "supports-color": { @@ -4557,10 +4777,10 @@ "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz", "integrity": "sha1-ggb0z21S3cWCfl/RSYng6WWTOjU=", "requires": { - "chalk": "1.1.3", - "cli-cursor": "1.0.2", - "date-fns": "1.29.0", - "figures": "1.7.0" + "chalk": "^1.1.3", + "cli-cursor": "^1.0.2", + "date-fns": "^1.27.2", + "figures": "^1.7.0" }, "dependencies": { "ansi-styles": { @@ -4573,11 +4793,11 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "cli-cursor": { @@ -4585,7 +4805,7 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", "requires": { - "restore-cursor": "1.0.1" + "restore-cursor": "^1.0.1" } }, "figures": { @@ -4593,8 +4813,8 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" } }, "onetime": { @@ -4607,8 +4827,8 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" } }, "supports-color": { @@ -4623,11 +4843,11 @@ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, "loader-utils": { @@ -4635,9 +4855,9 @@ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" } }, "locate-path": { @@ -4645,8 +4865,8 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" }, "dependencies": { "path-exists": { @@ -4671,7 +4891,7 @@ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", "requires": { - "chalk": "2.3.2" + "chalk": "^2.0.1" } }, "log-update": { @@ -4679,8 +4899,8 @@ "resolved": "https://registry.npmjs.org/log-update/-/log-update-1.0.2.tgz", "integrity": "sha1-GZKfZMQJPS0ucHWh2tivWcKWuNE=", "requires": { - "ansi-escapes": "1.4.0", - "cli-cursor": "1.0.2" + "ansi-escapes": "^1.0.0", + "cli-cursor": "^1.0.2" }, "dependencies": { "ansi-escapes": { @@ -4693,7 +4913,7 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", "requires": { - "restore-cursor": "1.0.1" + "restore-cursor": "^1.0.1" } }, "onetime": { @@ -4706,8 +4926,8 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" } } } @@ -4723,7 +4943,7 @@ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", "requires": { - "js-tokens": "3.0.2" + "js-tokens": "^3.0.0" } }, "lowercase-keys": { @@ -4742,7 +4962,7 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" }, "dependencies": { "pify": { @@ -4770,7 +4990,7 @@ "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { - "object-visit": "1.0.1" + "object-visit": "^1.0.0" } }, "media-typer": { @@ -4783,7 +5003,7 @@ "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "mem-fs": { @@ -4791,9 +5011,9 @@ "resolved": "https://registry.npmjs.org/mem-fs/-/mem-fs-1.1.3.tgz", "integrity": "sha1-uK6NLj/Lb10/kWXBLUVRoGXZicw=", "requires": { - "through2": "2.0.3", - "vinyl": "1.2.0", - "vinyl-file": "2.0.0" + "through2": "^2.0.0", + "vinyl": "^1.1.0", + "vinyl-file": "^2.0.0" } }, "mem-fs-editor": { @@ -4801,16 +5021,16 @@ "resolved": "https://registry.npmjs.org/mem-fs-editor/-/mem-fs-editor-3.0.2.tgz", "integrity": "sha1-3Qpuryu4prN3QAZ6pUnrUwEFr58=", "requires": { - "commondir": "1.0.1", - "deep-extend": "0.4.2", - "ejs": "2.5.8", - "glob": "7.1.1", - "globby": "6.1.0", - "mkdirp": "0.5.1", - "multimatch": "2.1.0", - "rimraf": "2.6.2", - "through2": "2.0.3", - "vinyl": "2.1.0" + "commondir": "^1.0.1", + "deep-extend": "^0.4.0", + "ejs": "^2.3.1", + "glob": "^7.0.3", + "globby": "^6.1.0", + "mkdirp": "^0.5.0", + "multimatch": "^2.0.0", + "rimraf": "^2.2.8", + "through2": "^2.0.0", + "vinyl": "^2.0.1" }, "dependencies": { "clone": { @@ -4833,12 +5053,12 @@ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", "requires": { - "clone": "2.1.2", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.1.2", - "remove-trailing-separator": "1.1.0", - "replace-ext": "1.0.0" + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" } } } @@ -4848,8 +5068,8 @@ "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", "requires": { - "errno": "0.1.7", - "readable-stream": "2.3.5" + "errno": "^0.1.3", + "readable-stream": "^2.0.1" } }, "memorystream": { @@ -4873,19 +5093,19 @@ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } }, "mime": { @@ -4903,7 +5123,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "requires": { - "mime-db": "1.33.0" + "mime-db": "~1.33.0" } }, "mimic-fn": { @@ -4921,7 +5141,7 @@ "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", "requires": { - "dom-walk": "0.1.1" + "dom-walk": "^0.1.0" } }, "minimalistic-assert": { @@ -4939,7 +5159,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -4953,8 +5173,8 @@ "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "dev": true, "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -4963,7 +5183,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -5006,12 +5226,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "growl": { @@ -5029,7 +5249,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", "requires": { - "has-flag": "2.0.0" + "has-flag": "^2.0.0" } } } @@ -5044,10 +5264,10 @@ "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", "requires": { - "array-differ": "1.0.0", - "array-union": "1.0.2", - "arrify": "1.0.1", - "minimatch": "3.0.4" + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" } }, "mute-stream": { @@ -5071,18 +5291,18 @@ "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-odd": "2.0.0", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" } }, "negotiator": { @@ -5111,16 +5331,16 @@ "integrity": "sha512-8AtS+wA5u6qoE12LONjqOzUzxAI5ObzSw6U5LgqpaO/0y6wwId4l5dN0ZulYyYdpLZD1MbkBp7GjG1hqaoRqYg==", "dev": true, "requires": { - "chokidar": "2.0.3", - "debug": "3.1.0", - "ignore-by-default": "1.0.1", - "minimatch": "3.0.4", - "pstree.remy": "1.1.0", - "semver": "5.5.0", - "supports-color": "5.4.0", - "touch": "3.1.0", - "undefsafe": "2.0.2", - "update-notifier": "2.5.0" + "chokidar": "^2.0.2", + "debug": "^3.1.0", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.0", + "semver": "^5.5.0", + "supports-color": "^5.2.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.2", + "update-notifier": "^2.3.0" }, "dependencies": { "debug": { @@ -5144,7 +5364,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -5154,8 +5374,8 @@ "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", "requires": { - "chalk": "0.4.0", - "underscore": "1.6.0" + "chalk": "~0.4.0", + "underscore": "~1.6.0" }, "dependencies": { "ansi-styles": { @@ -5168,9 +5388,9 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", "requires": { - "ansi-styles": "1.0.0", - "has-color": "0.1.7", - "strip-ansi": "0.1.1" + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" } }, "strip-ansi": { @@ -5186,7 +5406,7 @@ "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", "dev": true, "requires": { - "abbrev": "1.1.1" + "abbrev": "1" } }, "normalize-package-data": { @@ -5194,10 +5414,10 @@ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "requires": { - "hosted-git-info": "2.5.0", - "is-builtin-module": "1.0.0", - "semver": "5.5.0", - "validate-npm-package-license": "3.0.1" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "normalize-path": { @@ -5205,7 +5425,7 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "requires": { - "remove-trailing-separator": "1.1.0" + "remove-trailing-separator": "^1.0.1" } }, "normalize-url": { @@ -5213,9 +5433,9 @@ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", "requires": { - "prepend-http": "2.0.0", - "query-string": "5.1.1", - "sort-keys": "2.0.0" + "prepend-http": "^2.0.0", + "query-string": "^5.0.1", + "sort-keys": "^2.0.0" }, "dependencies": { "prepend-http": { @@ -5230,7 +5450,7 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { @@ -5263,9 +5483,9 @@ "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { "define-property": { @@ -5274,7 +5494,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "kind-of": { @@ -5283,7 +5503,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -5294,7 +5514,7 @@ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.0" } }, "object.omit": { @@ -5302,8 +5522,8 @@ "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" } }, "object.pick": { @@ -5312,7 +5532,7 @@ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "on-finished": { @@ -5328,7 +5548,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "onetime": { @@ -5336,7 +5556,7 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "openzeppelin-solidity": { @@ -5350,8 +5570,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" }, "dependencies": { "wordwrap": { @@ -5368,12 +5588,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "ora": { @@ -5381,10 +5601,10 @@ "resolved": "https://registry.npmjs.org/ora/-/ora-0.2.3.tgz", "integrity": "sha1-N1J9Igrc1Tw5tzVx11QVbV22V6Q=", "requires": { - "chalk": "1.1.3", - "cli-cursor": "1.0.2", - "cli-spinners": "0.1.2", - "object-assign": "4.1.1" + "chalk": "^1.1.1", + "cli-cursor": "^1.0.2", + "cli-spinners": "^0.1.2", + "object-assign": "^4.0.1" }, "dependencies": { "ansi-styles": { @@ -5397,11 +5617,11 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "cli-cursor": { @@ -5409,7 +5629,7 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", "requires": { - "restore-cursor": "1.0.1" + "restore-cursor": "^1.0.1" } }, "onetime": { @@ -5422,8 +5642,8 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" } }, "supports-color": { @@ -5448,7 +5668,7 @@ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "requires": { - "lcid": "1.0.0" + "lcid": "^1.0.0" } }, "os-tmpdir": { @@ -5466,7 +5686,7 @@ "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", "integrity": "sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=", "requires": { - "p-reduce": "1.0.0" + "p-reduce": "^1.0.0" } }, "p-finally": { @@ -5489,7 +5709,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -5497,7 +5717,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "requires": { - "p-limit": "1.2.0" + "p-limit": "^1.1.0" } }, "p-map": { @@ -5515,7 +5735,7 @@ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", "requires": { - "p-finally": "1.0.0" + "p-finally": "^1.0.0" } }, "p-try": { @@ -5529,21 +5749,27 @@ "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", "dev": true, "requires": { - "got": "6.7.1", - "registry-auth-token": "3.3.2", - "registry-url": "3.1.0", - "semver": "5.5.0" + "got": "^6.7.1", + "registry-auth-token": "^3.0.1", + "registry-url": "^3.0.3", + "semver": "^5.1.0" } }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha1-juqz5U+laSD+Fro493+iGqzC104=", + "dev": true + }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" }, "dependencies": { "is-extglob": { @@ -5556,7 +5782,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } } } @@ -5566,7 +5792,7 @@ "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", "requires": { - "for-each": "0.3.2", + "for-each": "^0.3.2", "trim": "0.0.1" } }, @@ -5575,7 +5801,7 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "requires": { - "error-ex": "1.3.1" + "error-ex": "^1.2.0" } }, "parse-passwd": { @@ -5605,7 +5831,7 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-is-absolute": { @@ -5639,9 +5865,9 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pathval": { @@ -5656,7 +5882,7 @@ "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", "dev": true, "requires": { - "through": "2.3.8" + "through": "~2.3" } }, "pegjs": { @@ -5685,7 +5911,7 @@ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "posix-character-classes": { @@ -5735,12 +5961,21 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, + "promise": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.0.2.tgz", + "integrity": "sha512-EIyzM39FpVOMbqgzEHhxdrEhtOSDOtjMZQ0M6iVfCE+kWNgCkAyOdnuCWqfmflylftfadU6FkiMgHZA2kUzwRw==", + "dev": true, + "requires": { + "asap": "~2.0.6" + } + }, "proxy-addr": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", "requires": { - "forwarded": "0.1.2", + "forwarded": "~0.1.2", "ipaddr.js": "1.6.0" } }, @@ -5755,7 +5990,7 @@ "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", "dev": true, "requires": { - "event-stream": "3.3.4" + "event-stream": "~3.3.0" } }, "pseudomap": { @@ -5769,7 +6004,7 @@ "integrity": "sha512-q5I5vLRMVtdWa8n/3UEzZX7Lfghzrg9eG2IKk2ENLSofKRCXVqMvMUHxCKgXNaqH/8ebhBxrqftHWnyTFweJ5Q==", "dev": true, "requires": { - "ps-tree": "1.1.0" + "ps-tree": "^1.1.0" } }, "punycode": { @@ -5787,9 +6022,9 @@ "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "requires": { - "decode-uri-component": "0.2.0", - "object-assign": "4.1.1", - "strict-uri-encode": "1.1.0" + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" } }, "randomatic": { @@ -5797,8 +6032,8 @@ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "kind-of": { @@ -5806,7 +6041,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -5845,7 +6080,7 @@ "depd": "1.1.1", "inherits": "2.0.3", "setprototypeof": "1.0.3", - "statuses": "1.5.0" + "statuses": ">= 1.3.1 < 2" } }, "setprototypeof": { @@ -5861,10 +6096,10 @@ "integrity": "sha1-6xiYnG1PTxYsOZ953dKfODVWgJI=", "dev": true, "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "~0.4.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "dependencies": { "minimist": { @@ -5880,8 +6115,8 @@ "resolved": "https://registry.npmjs.org/read-chunk/-/read-chunk-2.1.0.tgz", "integrity": "sha1-agTAkoAF7Z1C4aasVgDhnLx/9lU=", "requires": { - "pify": "3.0.0", - "safe-buffer": "5.1.1" + "pify": "^3.0.0", + "safe-buffer": "^5.1.1" }, "dependencies": { "pify": { @@ -5896,9 +6131,9 @@ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -5906,8 +6141,8 @@ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" } }, "readable-stream": { @@ -5915,13 +6150,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" } }, "readdirp": { @@ -5930,10 +6165,10 @@ "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "minimatch": "3.0.4", - "readable-stream": "2.3.5", - "set-immediate-shim": "1.0.1" + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" } }, "recast": { @@ -5942,9 +6177,9 @@ "integrity": "sha512-/nwm9pkrcWagN40JeJhkPaRxiHXBRkXyRh/hgU088Z/v+qCy+zIHHY6bC6o7NaKAxPqtE6nD8zBH1LfU0/Wx6A==", "requires": { "ast-types": "0.11.3", - "esprima": "4.0.0", - "private": "0.1.8", - "source-map": "0.6.1" + "esprima": "~4.0.0", + "private": "~0.1.5", + "source-map": "~0.6.1" }, "dependencies": { "source-map": { @@ -5959,7 +6194,7 @@ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "requires": { - "resolve": "1.6.0" + "resolve": "^1.1.6" } }, "regenerate": { @@ -5977,9 +6212,9 @@ "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "private": "0.1.8" + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" } }, "regex-cache": { @@ -5987,7 +6222,7 @@ "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "requires": { - "is-equal-shallow": "0.1.3" + "is-equal-shallow": "^0.1.3" } }, "regex-not": { @@ -5996,8 +6231,8 @@ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, "regexpu-core": { @@ -6005,9 +6240,9 @@ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", "requires": { - "regenerate": "1.3.3", - "regjsgen": "0.2.0", - "regjsparser": "0.1.5" + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" } }, "registry-auth-token": { @@ -6016,8 +6251,8 @@ "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", "dev": true, "requires": { - "rc": "1.2.6", - "safe-buffer": "5.1.1" + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" } }, "registry-url": { @@ -6026,7 +6261,7 @@ "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", "dev": true, "requires": { - "rc": "1.2.6" + "rc": "^1.0.1" } }, "regjsgen": { @@ -6039,7 +6274,7 @@ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "requires": { - "jsesc": "0.5.0" + "jsesc": "~0.5.0" } }, "remove-trailing-separator": { @@ -6062,7 +6297,7 @@ "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "requires": { - "is-finite": "1.0.2" + "is-finite": "^1.0.0" } }, "replace-ext": { @@ -6076,7 +6311,7 @@ "integrity": "sha1-DXOurpJm5penj3l2AZZ352rPD/8=", "dev": true, "requires": { - "req-from": "1.0.1" + "req-from": "^1.0.1" } }, "req-from": { @@ -6085,7 +6320,7 @@ "integrity": "sha1-v4HaUUeUfTLRO5R9wSpYrUWHNQ4=", "dev": true, "requires": { - "resolve-from": "2.0.0" + "resolve-from": "^2.0.0" }, "dependencies": { "resolve-from": { @@ -6101,28 +6336,48 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.7.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "hawk": "~6.0.2", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "stringstream": "~0.0.5", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "dev": true, + "requires": { + "lodash": "^4.13.1" + } + }, + "request-promise-native": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", + "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "dev": true, + "requires": { + "request-promise-core": "1.1.1", + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" } }, "require-directory": { @@ -6145,7 +6400,7 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz", "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==", "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "resolve-cwd": { @@ -6153,7 +6408,7 @@ "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", "requires": { - "resolve-from": "3.0.0" + "resolve-from": "^3.0.0" } }, "resolve-dir": { @@ -6161,8 +6416,8 @@ "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", "requires": { - "expand-tilde": "2.0.2", - "global-modules": "1.0.0" + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" } }, "resolve-from": { @@ -6181,7 +6436,7 @@ "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", "requires": { - "lowercase-keys": "1.0.0" + "lowercase-keys": "^1.0.0" } }, "restore-cursor": { @@ -6189,8 +6444,8 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "requires": { - "onetime": "2.0.1", - "signal-exit": "3.0.2" + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" } }, "ret": { @@ -6206,7 +6461,7 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, "rimraf": { @@ -6214,7 +6469,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "requires": { - "glob": "7.1.1" + "glob": "^7.0.5" } }, "run-async": { @@ -6222,7 +6477,7 @@ "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "requires": { - "is-promise": "2.1.0" + "is-promise": "^2.1.0" } }, "rx-lite": { @@ -6235,7 +6490,7 @@ "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", "requires": { - "rx-lite": "4.0.8" + "rx-lite": "*" } }, "rxjs": { @@ -6257,7 +6512,7 @@ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { - "ret": "0.1.15" + "ret": "~0.1.10" } }, "scoped-regex": { @@ -6276,7 +6531,7 @@ "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", "dev": true, "requires": { - "semver": "5.5.0" + "semver": "^5.0.3" } }, "send": { @@ -6285,18 +6540,18 @@ "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "requires": { "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.6.3", + "http-errors": "~1.6.2", "mime": "1.4.1", "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" }, "dependencies": { "debug": { @@ -6319,9 +6574,9 @@ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "requires": { - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "parseurl": "1.3.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", "send": "0.16.2" } }, @@ -6330,11 +6585,11 @@ "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", "requires": { - "body-parser": "1.18.2", - "cors": "2.8.4", - "express": "4.16.3", - "request": "2.85.0", - "xhr": "2.4.1" + "body-parser": "^1.16.0", + "cors": "^2.8.1", + "express": "^4.14.0", + "request": "^2.79.0", + "xhr": "^2.3.3" } }, "set-blocking": { @@ -6354,10 +6609,10 @@ "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -6366,7 +6621,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -6376,12 +6631,22 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" }, + "sha1": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", + "integrity": "sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg=", + "dev": true, + "requires": { + "charenc": ">= 0.0.1", + "crypt": ">= 0.0.1" + } + }, "sha3": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.0.tgz", "integrity": "sha1-aYnxtwpJhwWHajc+LGKs6WqpOZo=", "requires": { - "nan": "2.10.0" + "nan": "^2.0.5" } }, "shebang-command": { @@ -6389,7 +6654,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -6402,9 +6667,9 @@ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.1.tgz", "integrity": "sha512-YA/iYtZpzFe5HyWVGrb02FjPxc4EMCfpoU/Phg9fQoyMC72u9598OUBrsU8IrtwAKG0tO8IYaqbaLIw+k3IRGA==", "requires": { - "glob": "7.1.1", - "interpret": "1.1.0", - "rechoir": "0.6.2" + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" } }, "sigmund": { @@ -6428,9 +6693,9 @@ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.7.0.tgz", "integrity": "sha512-RkE9rGPHcxYZ/baYmgJtOSM63vH0Vyq+ma5TijBcLla41SWlh8t6XYIGMR/oeZcmr+/G8k+zrClkkVrtnQ0esg==", "requires": { - "decompress-response": "3.3.0", - "once": "1.4.0", - "simple-concat": "1.0.0" + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" } }, "slash": { @@ -6454,14 +6719,14 @@ "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, "requires": { - "base": "0.11.2", - "debug": "2.6.8", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.1", - "use": "3.1.0" + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" }, "dependencies": { "define-property": { @@ -6470,7 +6735,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -6479,7 +6744,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -6490,9 +6755,9 @@ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" }, "dependencies": { "define-property": { @@ -6501,7 +6766,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -6510,7 +6775,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -6519,7 +6784,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -6528,9 +6793,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -6541,7 +6806,7 @@ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.2.0" }, "dependencies": { "kind-of": { @@ -6550,7 +6815,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -6560,7 +6825,7 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } }, "sol-explore": { @@ -6574,11 +6839,11 @@ "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.24.tgz", "integrity": "sha512-2xd7Cf1HeVwrIb6Bu1cwY2/TaLRodrppCq3l7rhLimFQgmxptXhTC3+/wesVLpB09F1A2kZgvbMOgH7wvhFnBQ==", "requires": { - "fs-extra": "0.30.0", - "memorystream": "0.3.1", - "require-from-string": "1.2.1", - "semver": "5.5.0", - "yargs": "4.8.1" + "fs-extra": "^0.30.0", + "memorystream": "^0.3.1", + "require-from-string": "^1.1.0", + "semver": "^5.3.0", + "yargs": "^4.7.1" } }, "solidity-coverage": { @@ -6587,19 +6852,20 @@ "integrity": "sha512-iA3MT20rh1LllcNwfxAKU3ZBDu8R/4K8jANJAk7BcJU1foOjEh3tYhGqL8w2kRJPIo5XtoW0wxyVt95X2eJk/A==", "dev": true, "requires": { - "death": "1.1.0", + "death": "^1.1.0", "ethereumjs-testrpc-sc": "6.1.2", - "istanbul": "0.4.5", - "keccakjs": "0.2.1", - "req-cwd": "1.0.1", - "shelljs": "0.7.8", - "sol-explore": "1.6.2", + "istanbul": "^0.4.5", + "keccakjs": "^0.2.1", + "req-cwd": "^1.0.1", + "shelljs": "^0.7.4", + "sol-explore": "^1.6.2", "solidity-parser-sc": "0.4.7", - "web3": "0.18.4" + "web3": "^0.18.4" }, "dependencies": { "bignumber.js": { "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "from": "bignumber.js@git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", "dev": true }, "commander": { @@ -6635,8 +6901,8 @@ "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", "dev": true, "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } }, "mocha": { @@ -6663,8 +6929,8 @@ "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", "dev": true, "requires": { - "inherits": "2.0.3", - "minimatch": "0.3.0" + "inherits": "2", + "minimatch": "0.3" } } } @@ -6681,9 +6947,9 @@ "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { - "glob": "7.1.1", - "interpret": "1.1.0", - "rechoir": "0.6.2" + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" } }, "solidity-parser-sc": { @@ -6692,9 +6958,9 @@ "integrity": "sha512-wbX2806sm6thZME1aniqLcLH9HYwNwuKke6aw/FEgupCvoT9Iq5PdwuN9OyHWKGBOVeczpM5tCrnRXWNQ04YVw==", "dev": true, "requires": { - "mocha": "2.5.3", - "pegjs": "0.10.0", - "yargs": "4.8.1" + "mocha": "^2.4.5", + "pegjs": "^0.10.0", + "yargs": "^4.6.0" } }, "supports-color": { @@ -6710,10 +6976,10 @@ "dev": true, "requires": { "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "crypto-js": "3.1.8", - "utf8": "2.1.2", - "xhr2": "0.1.4", - "xmlhttprequest": "1.8.0" + "crypto-js": "^3.1.4", + "utf8": "^2.1.1", + "xhr2": "*", + "xmlhttprequest": "*" } } } @@ -6724,9 +6990,9 @@ "integrity": "sha1-o0PxPac8kWgyeQNGgOgMSR3jQPo=", "dev": true, "requires": { - "mocha": "2.5.3", - "pegjs": "0.10.0", - "yargs": "4.8.1" + "mocha": "^2.4.5", + "pegjs": "^0.10.0", + "yargs": "^4.6.0" }, "dependencies": { "commander": { @@ -6762,8 +7028,8 @@ "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", "dev": true, "requires": { - "inherits": "2.0.3", - "minimatch": "0.3.0" + "inherits": "2", + "minimatch": "0.3" } }, "minimatch": { @@ -6772,8 +7038,8 @@ "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", "dev": true, "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } }, "mocha": { @@ -6808,12 +7074,18 @@ } } }, + "solidity-parser-antlr": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.2.15.tgz", + "integrity": "sha512-EzRI8/TR/ljTXkZAyAjb0w4G20wH2XM7pcNf87ifdV825AbUv7DkY7HmiZCTj6NeKtIx8Y1s0NZWPbj+JTp8Zw==", + "dev": true + }, "sort-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", "requires": { - "is-plain-obj": "1.1.0" + "is-plain-obj": "^1.0.0" } }, "source-map": { @@ -6827,11 +7099,11 @@ "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", "dev": true, "requires": { - "atob": "2.1.1", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" + "atob": "^2.0.0", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, "source-map-support": { @@ -6839,7 +7111,7 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.4.tgz", "integrity": "sha512-PETSPG6BjY1AHs2t64vS2aqAgu6dMIMXJULWFBGbh2Gr8nVLbCFDo6i/RMMvviIQ2h1Z8+5gQhVKSn2je9nmdg==", "requires": { - "source-map": "0.6.1" + "source-map": "^0.6.0" }, "dependencies": { "source-map": { @@ -6860,7 +7132,7 @@ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", "requires": { - "spdx-license-ids": "1.2.2" + "spdx-license-ids": "^1.0.2" } }, "spdx-expression-parse": { @@ -6879,7 +7151,7 @@ "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", "dev": true, "requires": { - "through": "2.3.8" + "through": "2" } }, "split-string": { @@ -6888,7 +7160,7 @@ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { - "extend-shallow": "3.0.2" + "extend-shallow": "^3.0.0" } }, "sprintf-js": { @@ -6902,14 +7174,14 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" } }, "static-extend": { @@ -6918,8 +7190,8 @@ "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "dependencies": { "define-property": { @@ -6928,7 +7200,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -6938,13 +7210,19 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, "stream-combiner": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", "dev": true, "requires": { - "duplexer": "0.1.1" + "duplexer": "~0.1.1" } }, "stream-to-observable": { @@ -6952,7 +7230,7 @@ "resolved": "https://registry.npmjs.org/stream-to-observable/-/stream-to-observable-0.2.0.tgz", "integrity": "sha1-WdbqOT2HwsDdrBCqDVYbxrpvDhA=", "requires": { - "any-observable": "0.2.0" + "any-observable": "^0.2.0" } }, "strict-uri-encode": { @@ -6970,9 +7248,9 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { @@ -6980,7 +7258,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, "stringstream": { @@ -6993,7 +7271,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -7001,7 +7279,7 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } }, "strip-bom-stream": { @@ -7009,8 +7287,8 @@ "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz", "integrity": "sha1-+H217yYT9paKpUWr/h7HKLaoKco=", "requires": { - "first-chunk-stream": "2.0.0", - "strip-bom": "2.0.0" + "first-chunk-stream": "^2.0.0", + "strip-bom": "^2.0.0" } }, "strip-eof": { @@ -7038,7 +7316,7 @@ "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } }, "symbol-observable": { @@ -7046,6 +7324,26 @@ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=" }, + "sync-request": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.0.0.tgz", + "integrity": "sha512-jGNIAlCi9iU4X3Dm4oQnNQshDD3h0/1A7r79LyqjbjUnj69sX6mShAXlhRXgImsfVKtTcnra1jfzabdZvp+Lmw==", + "dev": true, + "requires": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + } + }, + "sync-rpc": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.4.tgz", + "integrity": "sha512-Iug+t1ICVFenUcTnDu8WXFnT+k8IVoLKGh8VA3eXUtl2Rt9SjKX3YEv33OenABqpTPL9QEaHv1+CNn2LK8vMow==", + "dev": true, + "requires": { + "get-port": "^3.1.0" + } + }, "tapable": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.0.0.tgz", @@ -7056,8 +7354,8 @@ "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz", "integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=", "requires": { - "os-tmpdir": "1.0.2", - "rimraf": "2.2.8" + "os-tmpdir": "^1.0.0", + "rimraf": "~2.2.6" }, "dependencies": { "rimraf": { @@ -7073,7 +7371,7 @@ "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", "dev": true, "requires": { - "execa": "0.7.0" + "execa": "^0.7.0" } }, "text-table": { @@ -7086,6 +7384,33 @@ "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-2.2.0.tgz", "integrity": "sha512-j5EMxnryTvKxwH2Cq+Pb43tsf6sdEgw6Pdwxk83mPaq0ToeFJt6WE4J3s5BqY7vmjlLgkgXvhtXUxo80FyBhCA==" }, + "then-request": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.0.tgz", + "integrity": "sha512-xA+7uEMc+jsQIoyySJ93Ad08Kuqnik7u6jLS5hR91Z3smAoCfL3M8/MqMlobAa9gzBfO9pA88A/AntfepkkMJQ==", + "dev": true, + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^7.0.0", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "dependencies": { + "@types/node": { + "version": "8.10.36", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.36.tgz", + "integrity": "sha512-SL6KhfM7PTqiFmbCW3eVNwVBZ+88Mrzbuvn9olPsfv43mbiWaFY+nRcz/TGGku0/lc2FepdMbImdMY1JrQ+zbw==", + "dev": true + } + } + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -7096,8 +7421,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "requires": { - "readable-stream": "2.3.5", - "xtend": "4.0.1" + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" } }, "timed-out": { @@ -7110,7 +7435,7 @@ "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "requires": { - "os-tmpdir": "1.0.2" + "os-tmpdir": "~1.0.2" } }, "to-fast-properties": { @@ -7130,7 +7455,7 @@ "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -7139,7 +7464,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -7150,10 +7475,10 @@ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" } }, "to-regex-range": { @@ -7162,8 +7487,8 @@ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, "touch": { @@ -7172,7 +7497,7 @@ "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", "dev": true, "requires": { - "nopt": "1.0.10" + "nopt": "~1.0.10" } }, "tough-cookie": { @@ -7180,7 +7505,7 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "trim": { @@ -7198,8 +7523,8 @@ "resolved": "https://registry.npmjs.org/truffle/-/truffle-4.1.11.tgz", "integrity": "sha512-VNhc6jexZeM92sNJJr4U8ln3uJ/mJEQO/0y9ZLYc4pccyIskPtl+3r4mzymgGM/Mq5v6MpoQVD6NZgHUVKX+Dw==", "requires": { - "mocha": "4.1.0", - "original-require": "1.0.1", + "mocha": "^4.1.0", + "original-require": "^1.0.1", "solc": "0.4.24" } }, @@ -7215,11 +7540,11 @@ "integrity": "sha512-E8pvJNAIjs7LNsjkYeS2dgoOnLoSBrTwb1xF5lJwfvZmGMFpKvVL1sa5jpFxozpf/WkRn/rfxy8zTdb3pq16jA==", "dev": true, "requires": { - "find-up": "2.1.0", - "lodash": "4.17.5", - "original-require": "1.0.1", - "truffle-error": "0.0.2", - "truffle-provider": "0.0.4" + "find-up": "^2.1.0", + "lodash": "^4.17.4", + "original-require": "^1.0.0", + "truffle-error": "^0.0.2", + "truffle-provider": "^0.0.4" }, "dependencies": { "find-up": { @@ -7228,7 +7553,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } } } @@ -7240,10 +7565,10 @@ "dev": true, "requires": { "ethjs-abi": "0.1.8", - "truffle-blockchain-utils": "0.0.4", - "truffle-contract-schema": "2.0.0", + "truffle-blockchain-utils": "^0.0.4", + "truffle-contract-schema": "^2.0.0", "truffle-error": "0.0.2", - "web3": "0.20.5" + "web3": "^0.20.1" }, "dependencies": { "ethjs-abi": { @@ -7265,9 +7590,9 @@ "integrity": "sha512-nLlspmu1GKDaluWksBwitHi/7Z3IpRjmBYeO9N+T1nVJD2V4IWJaptCKP1NqnPiJA+FChB7+F7pI6Br51/FtXQ==", "dev": true, "requires": { - "ajv": "5.5.2", - "crypto-js": "3.1.9-1", - "debug": "3.1.0" + "ajv": "^5.1.1", + "crypto-js": "^3.1.9-1", + "debug": "^3.1.0" }, "dependencies": { "crypto-js": { @@ -7305,11 +7630,11 @@ "integrity": "sha512-DisthKMI1qH+Xbw/S84CLPGeXz/kMkVUxBpz8Elj2kI4paVjEFEFwrq0juQHwxr2w/046r2tUT5usCE38Bw6Qw==", "dev": true, "requires": { - "find-up": "2.1.0", - "semver": "5.5.0", - "solidity-parser": "0.4.0", - "truffle-config": "1.0.4", - "truffle-resolver": "4.0.2", + "find-up": "^2.1.0", + "semver": "^5.4.1", + "solidity-parser": "^0.4.0", + "truffle-config": "^1.0.2", + "truffle-resolver": "^4.0.1", "tsort": "0.0.1" }, "dependencies": { @@ -7319,7 +7644,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } } } @@ -7330,8 +7655,8 @@ "integrity": "sha512-yVxxjocxnJcFspQ0T4Rjq/1wvvm3iLxidb6oa1EAX5LsnSQLPG8wAM5+JLlJ4FDBsqJdZLGOq1RR5Ln/w7x5JA==", "dev": true, "requires": { - "truffle-error": "0.0.2", - "web3": "0.20.5" + "truffle-error": "^0.0.2", + "web3": "^0.20.1" } }, "truffle-provisioner": { @@ -7346,10 +7671,10 @@ "integrity": "sha512-HKRd45HSfAqb9/BCOgYq4zkyl2lF40MvPDIGhyoPXFj5/9PSFzclyTkkMOdb+Rnm7oC1vY4cE1/k453lgf81Kw==", "dev": true, "requires": { - "async": "2.6.0", - "truffle-contract": "3.0.4", + "async": "^2.1.4", + "truffle-contract": "^3.0.4", "truffle-expect": "0.0.3", - "truffle-provisioner": "0.1.0" + "truffle-provisioner": "^0.1.0" } }, "tsort": { @@ -7363,7 +7688,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -7378,7 +7703,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "type-detect": { @@ -7393,9 +7718,15 @@ "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", "requires": { "media-typer": "0.3.0", - "mime-types": "2.1.18" + "mime-types": "~2.1.18" } }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, "uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", @@ -7403,9 +7734,9 @@ "dev": true, "optional": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" }, "dependencies": { "camelcase": { @@ -7422,8 +7753,8 @@ "dev": true, "optional": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" } }, @@ -7448,9 +7779,9 @@ "dev": true, "optional": true, "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", "window-size": "0.1.0" } } @@ -7474,7 +7805,7 @@ "integrity": "sha1-Il9rngM3Zj4Njnz9aG/Cg2zKznY=", "dev": true, "requires": { - "debug": "2.6.8" + "debug": "^2.2.0" } }, "underscore": { @@ -7488,10 +7819,10 @@ "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "dev": true, "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" }, "dependencies": { "extend-shallow": { @@ -7500,7 +7831,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "set-value": { @@ -7509,10 +7840,10 @@ "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" } } } @@ -7523,7 +7854,7 @@ "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", "dev": true, "requires": { - "crypto-random-string": "1.0.0" + "crypto-random-string": "^1.0.0" } }, "unpipe": { @@ -7537,8 +7868,8 @@ "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { "has-value": { @@ -7547,9 +7878,9 @@ "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" }, "dependencies": { "isobject": { @@ -7594,16 +7925,16 @@ "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", "dev": true, "requires": { - "boxen": "1.3.0", - "chalk": "2.3.2", - "configstore": "3.1.2", - "import-lazy": "2.1.0", - "is-ci": "1.1.0", - "is-installed-globally": "0.1.0", - "is-npm": "1.0.0", - "latest-version": "3.1.0", - "semver-diff": "2.1.0", - "xdg-basedir": "3.0.0" + "boxen": "^1.2.1", + "chalk": "^2.0.1", + "configstore": "^3.0.0", + "import-lazy": "^2.1.0", + "is-ci": "^1.0.10", + "is-installed-globally": "^0.1.0", + "is-npm": "^1.0.0", + "latest-version": "^3.0.0", + "semver-diff": "^2.0.0", + "xdg-basedir": "^3.0.0" } }, "urix": { @@ -7617,7 +7948,7 @@ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "requires": { - "prepend-http": "1.0.4" + "prepend-http": "^1.0.1" } }, "url-set-query": { @@ -7636,7 +7967,7 @@ "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.2" } }, "utf8": { @@ -7670,8 +8001,8 @@ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" + "spdx-correct": "~1.0.0", + "spdx-expression-parse": "~1.0.0" } }, "vary": { @@ -7684,9 +8015,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" } }, "vinyl": { @@ -7694,8 +8025,8 @@ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", "requires": { - "clone": "1.0.4", - "clone-stats": "0.0.1", + "clone": "^1.0.0", + "clone-stats": "^0.0.1", "replace-ext": "0.0.1" } }, @@ -7704,12 +8035,12 @@ "resolved": "https://registry.npmjs.org/vinyl-file/-/vinyl-file-2.0.0.tgz", "integrity": "sha1-p+v1/779obfRjRQPyweyI++2dRo=", "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0", - "strip-bom-stream": "2.0.0", - "vinyl": "1.2.0" + "graceful-fs": "^4.1.2", + "pify": "^2.3.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0", + "strip-bom-stream": "^2.0.0", + "vinyl": "^1.1.0" } }, "web3": { @@ -7719,10 +8050,10 @@ "dev": true, "requires": { "bignumber.js": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", - "crypto-js": "3.1.8", - "utf8": "2.1.2", - "xhr2": "0.1.4", - "xmlhttprequest": "1.8.0" + "crypto-js": "^3.1.4", + "utf8": "^2.1.1", + "xhr2": "*", + "xmlhttprequest": "*" } }, "web3-utils": { @@ -7756,7 +8087,7 @@ "resolved": "https://registry.npmjs.org/webpack-addons/-/webpack-addons-1.1.5.tgz", "integrity": "sha512-MGO0nVniCLFAQz1qv22zM02QPjcpAoJdy7ED0i3Zy7SY1IecgXCm460ib7H/Wq7e9oL5VL6S2BxaObxwIcag0g==", "requires": { - "jscodeshift": "0.4.1" + "jscodeshift": "^0.4.0" }, "dependencies": { "arr-diff": { @@ -7764,7 +8095,7 @@ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "array-unique": { @@ -7792,9 +8123,9 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "expand-brackets": { @@ -7802,7 +8133,7 @@ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "extglob": { @@ -7810,7 +8141,7 @@ "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-extglob": { @@ -7823,7 +8154,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "jscodeshift": { @@ -7831,21 +8162,21 @@ "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.4.1.tgz", "integrity": "sha512-iOX6If+hsw0q99V3n31t4f5VlD1TQZddH08xbT65ZqA7T4Vkx68emrDZMUOLVvCEAJ6NpAk7DECe3fjC/t52AQ==", "requires": { - "async": "1.5.2", - "babel-plugin-transform-flow-strip-types": "6.22.0", - "babel-preset-es2015": "6.24.1", - "babel-preset-stage-1": "6.24.1", - "babel-register": "6.26.0", - "babylon": "6.18.0", - "colors": "1.2.1", - "flow-parser": "0.68.0", - "lodash": "4.17.5", - "micromatch": "2.3.11", + "async": "^1.5.0", + "babel-plugin-transform-flow-strip-types": "^6.8.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-stage-1": "^6.5.0", + "babel-register": "^6.9.0", + "babylon": "^6.17.3", + "colors": "^1.1.2", + "flow-parser": "^0.*", + "lodash": "^4.13.1", + "micromatch": "^2.3.7", "node-dir": "0.1.8", - "nomnom": "1.8.1", - "recast": "0.12.9", - "temp": "0.8.3", - "write-file-atomic": "1.3.4" + "nomnom": "^1.8.1", + "recast": "^0.12.5", + "temp": "^0.8.1", + "write-file-atomic": "^1.2.0" } }, "kind-of": { @@ -7853,7 +8184,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } }, "micromatch": { @@ -7861,19 +8192,19 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" } }, "recast": { @@ -7882,10 +8213,10 @@ "integrity": "sha512-y7ANxCWmMW8xLOaiopiRDlyjQ9ajKRENBH+2wjntIbk3A6ZR1+BLQttkmSHMY7Arl+AAZFwJ10grg2T6f1WI8A==", "requires": { "ast-types": "0.10.1", - "core-js": "2.5.3", - "esprima": "4.0.0", - "private": "0.1.8", - "source-map": "0.6.1" + "core-js": "^2.4.1", + "esprima": "~4.0.0", + "private": "~0.1.5", + "source-map": "~0.6.1" } }, "source-map": { @@ -7898,9 +8229,9 @@ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "slide": "1.1.6" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" } } } @@ -7910,31 +8241,31 @@ "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-2.0.13.tgz", "integrity": "sha512-0lnOi3yla8FsZVuMsbfnNRB/8DlfuDugKdekC+4ykydZG0+UOidMi5J5LLWN4c0VJ8PqC19yMXXkYyCq78OuqA==", "requires": { - "chalk": "2.3.2", - "cross-spawn": "6.0.5", - "diff": "3.5.0", - "enhanced-resolve": "4.0.0", - "glob-all": "3.1.0", - "global-modules": "1.0.0", - "got": "8.3.0", - "inquirer": "5.2.0", - "interpret": "1.1.0", - "jscodeshift": "0.5.0", - "listr": "0.13.0", - "loader-utils": "1.1.0", - "lodash": "4.17.5", - "log-symbols": "2.2.0", - "mkdirp": "0.5.1", - "p-each-series": "1.0.0", - "p-lazy": "1.0.0", - "prettier": "1.11.1", - "resolve-cwd": "2.0.0", - "supports-color": "5.3.0", - "v8-compile-cache": "1.1.2", - "webpack-addons": "1.1.5", - "yargs": "11.0.0", - "yeoman-environment": "2.0.5", - "yeoman-generator": "2.0.3" + "chalk": "^2.3.2", + "cross-spawn": "^6.0.5", + "diff": "^3.5.0", + "enhanced-resolve": "^4.0.0", + "glob-all": "^3.1.0", + "global-modules": "^1.0.0", + "got": "^8.2.0", + "inquirer": "^5.1.0", + "interpret": "^1.0.4", + "jscodeshift": "^0.5.0", + "listr": "^0.13.0", + "loader-utils": "^1.1.0", + "lodash": "^4.17.5", + "log-symbols": "^2.2.0", + "mkdirp": "^0.5.1", + "p-each-series": "^1.0.0", + "p-lazy": "^1.0.0", + "prettier": "^1.5.3", + "resolve-cwd": "^2.0.0", + "supports-color": "^5.3.0", + "v8-compile-cache": "^1.1.2", + "webpack-addons": "^1.1.5", + "yargs": "^11.0.0", + "yeoman-environment": "^2.0.0", + "yeoman-generator": "^2.0.3" }, "dependencies": { "ansi-regex": { @@ -7952,9 +8283,9 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.0.0.tgz", "integrity": "sha512-nY3W5Gu2racvdDk//ELReY+dHjb9PlIcVDFXP72nVIhq2Gy3LuVXYwJoPVudwQnv1shtohpgkdCKT2YaKY0CKw==", "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } }, "cross-spawn": { @@ -7962,11 +8293,11 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "requires": { - "nice-try": "1.0.4", - "path-key": "2.0.1", - "semver": "5.5.0", - "shebang-command": "1.2.0", - "which": "1.3.0" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "diff": { @@ -7979,7 +8310,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "got": { @@ -7987,23 +8318,23 @@ "resolved": "https://registry.npmjs.org/got/-/got-8.3.0.tgz", "integrity": "sha512-kBNy/S2CGwrYgDSec5KTWGKUvupwkkTVAjIsVFF2shXO13xpZdFP4d4kxa//CLX2tN/rV0aYwK8vY6UKWGn2vQ==", "requires": { - "@sindresorhus/is": "0.7.0", - "cacheable-request": "2.1.4", - "decompress-response": "3.3.0", - "duplexer3": "0.1.4", - "get-stream": "3.0.0", - "into-stream": "3.1.0", - "is-retry-allowed": "1.1.0", - "isurl": "1.0.0", - "lowercase-keys": "1.0.0", - "mimic-response": "1.0.0", - "p-cancelable": "0.4.0", - "p-timeout": "2.0.1", - "pify": "3.0.0", - "safe-buffer": "5.1.1", - "timed-out": "4.0.1", - "url-parse-lax": "3.0.0", - "url-to-options": "1.0.1" + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" } }, "has-flag": { @@ -8021,9 +8352,9 @@ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "pify": { @@ -8041,8 +8372,8 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -8050,7 +8381,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "supports-color": { @@ -8058,7 +8389,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } }, "url-parse-lax": { @@ -8066,7 +8397,7 @@ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", "requires": { - "prepend-http": "2.0.0" + "prepend-http": "^2.0.0" } }, "which-module": { @@ -8079,18 +8410,18 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", "requires": { - "cliui": "4.0.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "9.0.2" + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" } }, "yargs-parser": { @@ -8098,7 +8429,7 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" } } } @@ -8108,7 +8439,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -8122,7 +8453,7 @@ "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", "dev": true, "requires": { - "string-width": "2.1.1" + "string-width": "^2.1.1" }, "dependencies": { "ansi-regex": { @@ -8143,8 +8474,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -8153,7 +8484,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -8174,8 +8505,8 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" } }, "wrappy": { @@ -8189,9 +8520,9 @@ "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "signal-exit": "3.0.2" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" } }, "ws": { @@ -8199,9 +8530,9 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "requires": { - "async-limiter": "1.0.0", - "safe-buffer": "5.1.1", - "ultron": "1.1.1" + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" } }, "xdg-basedir": { @@ -8215,10 +8546,10 @@ "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.4.1.tgz", "integrity": "sha512-pAIU5vBr9Hiy5cpFIbPnwf0C18ZF86DBsZKrlsf87N5De/JbA6RJ83UP/cv+aljl4S40iRVMqP4pr4sF9Dnj0A==", "requires": { - "global": "4.3.2", - "is-function": "1.0.1", - "parse-headers": "2.0.1", - "xtend": "4.0.1" + "global": "~4.3.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" } }, "xhr-request": { @@ -8226,13 +8557,13 @@ "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", "requires": { - "buffer-to-arraybuffer": "0.0.5", - "object-assign": "4.1.1", - "query-string": "5.1.1", - "simple-get": "2.7.0", - "timed-out": "4.0.1", - "url-set-query": "1.0.0", - "xhr": "2.4.1" + "buffer-to-arraybuffer": "^0.0.5", + "object-assign": "^4.1.1", + "query-string": "^5.0.1", + "simple-get": "^2.7.0", + "timed-out": "^4.0.1", + "url-set-query": "^1.0.0", + "xhr": "^2.0.4" } }, "xhr-request-promise": { @@ -8240,7 +8571,7 @@ "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz", "integrity": "sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0=", "requires": { - "xhr-request": "1.1.0" + "xhr-request": "^1.0.1" } }, "xhr2": { @@ -8275,20 +8606,20 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", "requires": { - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.2", - "lodash.assign": "4.2.0", - "os-locale": "1.4.0", - "read-pkg-up": "1.0.1", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "1.0.2", - "which-module": "1.0.0", - "window-size": "0.2.0", - "y18n": "3.2.1", - "yargs-parser": "2.4.1" + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" } }, "yargs-parser": { @@ -8296,8 +8627,8 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", "requires": { - "camelcase": "3.0.0", - "lodash.assign": "4.2.0" + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" } }, "yeoman-environment": { @@ -8305,19 +8636,19 @@ "resolved": "https://registry.npmjs.org/yeoman-environment/-/yeoman-environment-2.0.5.tgz", "integrity": "sha512-6/W7/B54OPHJXob0n0+pmkwFsirC8cokuQkPSmT/D0lCcSxkKtg/BA6ZnjUBIwjuGqmw3DTrT4en++htaUju5g==", "requires": { - "chalk": "2.3.2", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "globby": "6.1.0", - "grouped-queue": "0.3.3", - "inquirer": "3.3.0", - "is-scoped": "1.0.0", - "lodash": "4.17.5", - "log-symbols": "2.2.0", - "mem-fs": "1.1.3", - "text-table": "0.2.0", - "untildify": "3.0.2" + "chalk": "^2.1.0", + "debug": "^3.1.0", + "diff": "^3.3.1", + "escape-string-regexp": "^1.0.2", + "globby": "^6.1.0", + "grouped-queue": "^0.3.3", + "inquirer": "^3.3.0", + "is-scoped": "^1.0.0", + "lodash": "^4.17.4", + "log-symbols": "^2.1.0", + "mem-fs": "^1.1.0", + "text-table": "^0.2.0", + "untildify": "^3.0.2" }, "dependencies": { "ansi-regex": { @@ -8343,20 +8674,20 @@ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "requires": { - "ansi-escapes": "3.1.0", - "chalk": "2.3.2", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "2.1.0", - "figures": "2.0.0", - "lodash": "4.17.5", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rx-lite": "4.0.8", - "rx-lite-aggregates": "4.0.8", - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "through": "2.3.8" + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" } }, "is-fullwidth-code-point": { @@ -8369,8 +8700,8 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -8378,7 +8709,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -8388,31 +8719,31 @@ "resolved": "https://registry.npmjs.org/yeoman-generator/-/yeoman-generator-2.0.3.tgz", "integrity": "sha512-mODmrZ26a94djmGZZuIiomSGlN4wULdou29ZwcySupb2e9FdvoCl7Ps2FqHFjEHio3kOl/iBeaNqrnx3C3NwWg==", "requires": { - "async": "2.6.0", - "chalk": "2.3.2", - "cli-table": "0.3.1", - "cross-spawn": "5.1.0", - "dargs": "5.1.0", - "dateformat": "3.0.3", - "debug": "3.1.0", - "detect-conflict": "1.0.1", - "error": "7.0.2", - "find-up": "2.1.0", - "github-username": "4.1.0", - "istextorbinary": "2.2.1", - "lodash": "4.17.5", - "make-dir": "1.2.0", - "mem-fs-editor": "3.0.2", - "minimist": "1.2.0", - "pretty-bytes": "4.0.2", - "read-chunk": "2.1.0", - "read-pkg-up": "3.0.0", - "rimraf": "2.6.2", - "run-async": "2.3.0", - "shelljs": "0.8.1", - "text-table": "0.2.0", - "through2": "2.0.3", - "yeoman-environment": "2.0.5" + "async": "^2.6.0", + "chalk": "^2.3.0", + "cli-table": "^0.3.1", + "cross-spawn": "^5.1.0", + "dargs": "^5.1.0", + "dateformat": "^3.0.2", + "debug": "^3.1.0", + "detect-conflict": "^1.0.0", + "error": "^7.0.2", + "find-up": "^2.1.0", + "github-username": "^4.0.0", + "istextorbinary": "^2.1.0", + "lodash": "^4.17.4", + "make-dir": "^1.1.0", + "mem-fs-editor": "^3.0.2", + "minimist": "^1.2.0", + "pretty-bytes": "^4.0.2", + "read-chunk": "^2.1.0", + "read-pkg-up": "^3.0.0", + "rimraf": "^2.6.2", + "run-async": "^2.0.0", + "shelljs": "^0.8.0", + "text-table": "^0.2.0", + "through2": "^2.0.0", + "yeoman-environment": "^2.0.5" }, "dependencies": { "debug": { @@ -8428,7 +8759,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "load-json-file": { @@ -8436,10 +8767,10 @@ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "requires": { - "graceful-fs": "4.1.11", - "parse-json": "4.0.0", - "pify": "3.0.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" } }, "minimist": { @@ -8452,8 +8783,8 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "requires": { - "error-ex": "1.3.1", - "json-parse-better-errors": "1.0.1" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" } }, "path-type": { @@ -8461,7 +8792,7 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" } }, "pify": { @@ -8474,9 +8805,9 @@ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", "requires": { - "load-json-file": "4.0.0", - "normalize-package-data": "2.4.0", - "path-type": "3.0.0" + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" } }, "read-pkg-up": { @@ -8484,8 +8815,8 @@ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", "requires": { - "find-up": "2.1.0", - "read-pkg": "3.0.0" + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" } }, "strip-bom": { diff --git a/package.json b/package.json index 2ecec4cda..299b5b46e 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "chai": "^4.1.2", "chai-as-promised": "^7.1.1", "chai-bignumber": "^2.0.2", + "eth-gas-reporter": "^0.1.12", "nodemon": "^1.17.3", "solidity-coverage": "^0.4.15", "truffle-flattener": "^1.2.3" diff --git a/truffle.js b/truffle.js index 31e2c9b6c..3468c855d 100644 --- a/truffle.js +++ b/truffle.js @@ -52,5 +52,12 @@ module.exports = { enabled: true, runs: 200 } + }, + mocha: { + reporter: 'eth-gas-reporter', + reporterOptions : { + currency: 'USD', + gasPrice: 1 + } } }; From 40cea735844458481999c73e4e543e097d1c9913 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 19 Oct 2018 16:56:45 -0300 Subject: [PATCH 57/77] Add new submitSignature tests on home contracts --- test/erc_to_erc/home_bridge.test.js | 25 +++++++++++++++++++++++++ test/erc_to_native/home_bridge.test.js | 23 +++++++++++++++++++++++ test/native_to_erc/home_bridge_test.js | 24 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/test/erc_to_erc/home_bridge.test.js b/test/erc_to_erc/home_bridge.test.js index dafcbfdd9..fbe53bd82 100644 --- a/test/erc_to_erc/home_bridge.test.js +++ b/test/erc_to_erc/home_bridge.test.js @@ -291,6 +291,31 @@ contract('HomeBridge_ERC20_to_ERC20', async (accounts) => { const markedAsProcessed = new web3.BigNumber(2).pow(255).add(2); markedAsProcessed.should.be.bignumber.equal(await homeBridgeWithTwoSigs.numMessagesSigned(hashMsg)) }) + it('works with 5 validators and 3 required signatures', async () => { + const recipientAccount = accounts[8] + const authoritiesFiveAccs = [accounts[1], accounts[2], accounts[3], accounts[4], accounts[5]] + const validatorContractWith3Signatures = await BridgeValidators.new() + await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) + const token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); + + const homeBridgeWithThreeSigs = await HomeBridge.new(); + await homeBridgeWithThreeSigs.initialize(validatorContractWith3Signatures.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, token.address); + + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80"; + const message = createMessage(recipientAccount, value, transactionHash, homeBridgeWithThreeSigs.address); + const signature = await sign(authoritiesFiveAccs[0], message) + const signature2 = await sign(authoritiesFiveAccs[1], message) + const signature3 = await sign(authoritiesFiveAccs[2], message) + '3'.should.be.bignumber.equal(await validatorContractWith3Signatures.requiredSignatures()); + + await homeBridgeWithThreeSigs.submitSignature(signature, message, {from: authoritiesFiveAccs[0]}).should.be.fulfilled; + await homeBridgeWithThreeSigs.submitSignature(signature2, message, {from: authoritiesFiveAccs[1]}).should.be.fulfilled; + const {logs} = await homeBridgeWithThreeSigs.submitSignature(signature3, message, {from: authoritiesFiveAccs[2]}).should.be.fulfilled; + logs.length.should.be.equal(2) + logs[1].event.should.be.equal('CollectedSignatures') + logs[1].args.authorityResponsibleForRelay.should.be.equal(authoritiesFiveAccs[2]) + }) it('attack when increasing requiredSignatures', async () => { var recipientAccount = accounts[8] var value = web3.toBigNumber(web3.toWei(0.5, "ether")); diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index e6f20512b..7f43e85c7 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -396,7 +396,30 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { logs[1].event.should.be.equal('CollectedSignatures') logs[1].args.authorityResponsibleForRelay.should.be.equal(authoritiesTwoAccs[1]) }) + it('works with 5 validators and 3 required signatures', async () => { + const recipientAccount = accounts[8] + const authoritiesFiveAccs = [accounts[1], accounts[2], accounts[3], accounts[4], accounts[5]] + const validatorContractWith3Signatures = await BridgeValidators.new() + await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) + + const homeBridgeWithThreeSigs = await HomeBridge.new(); + await homeBridgeWithThreeSigs.initialize(validatorContractWith3Signatures.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, blockRewardContract.address); + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80"; + const message = createMessage(recipientAccount, value, transactionHash, homeBridgeWithThreeSigs.address); + const signature = await sign(authoritiesFiveAccs[0], message) + const signature2 = await sign(authoritiesFiveAccs[1], message) + const signature3 = await sign(authoritiesFiveAccs[2], message) + '3'.should.be.bignumber.equal(await validatorContractWith3Signatures.requiredSignatures()); + + await homeBridgeWithThreeSigs.submitSignature(signature, message, {from: authoritiesFiveAccs[0]}).should.be.fulfilled; + await homeBridgeWithThreeSigs.submitSignature(signature2, message, {from: authoritiesFiveAccs[1]}).should.be.fulfilled; + const {logs} = await homeBridgeWithThreeSigs.submitSignature(signature3, message, {from: authoritiesFiveAccs[2]}).should.be.fulfilled; + logs.length.should.be.equal(2) + logs[1].event.should.be.equal('CollectedSignatures') + logs[1].args.authorityResponsibleForRelay.should.be.equal(authoritiesFiveAccs[2]) + }) it('attack when increasing requiredSignatures', async () => { const recipientAccount = accounts[8] const value = web3.toBigNumber(web3.toWei(0.5, "ether")); diff --git a/test/native_to_erc/home_bridge_test.js b/test/native_to_erc/home_bridge_test.js index f5c877e7c..3b799e35e 100644 --- a/test/native_to_erc/home_bridge_test.js +++ b/test/native_to_erc/home_bridge_test.js @@ -378,6 +378,30 @@ contract('HomeBridge', async (accounts) => { logs[1].event.should.be.equal('CollectedSignatures') logs[1].args.authorityResponsibleForRelay.should.be.equal(authoritiesTwoAccs[1]) }) + it('works with 5 validators and 3 required signatures', async () => { + const recipientAccount = accounts[8] + const authoritiesFiveAccs = [accounts[1], accounts[2], accounts[3], accounts[4], accounts[5]] + const validatorContractWith3Signatures = await BridgeValidators.new() + await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) + + const homeBridgeWithThreeSigs = await HomeBridge.new(); + await homeBridgeWithThreeSigs.initialize(validatorContractWith3Signatures.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations); + + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x1045bfe274b88120a6b1e5d01b5ec00ab5d01098346e90e7c7a3c9b8f0181c80"; + const message = createMessage(recipientAccount, value, transactionHash, homeBridgeWithThreeSigs.address); + const signature = await sign(authoritiesFiveAccs[0], message) + const signature2 = await sign(authoritiesFiveAccs[1], message) + const signature3 = await sign(authoritiesFiveAccs[2], message) + '3'.should.be.bignumber.equal(await validatorContractWith3Signatures.requiredSignatures()); + + await homeBridgeWithThreeSigs.submitSignature(signature, message, {from: authoritiesFiveAccs[0]}).should.be.fulfilled; + await homeBridgeWithThreeSigs.submitSignature(signature2, message, {from: authoritiesFiveAccs[1]}).should.be.fulfilled; + const {logs} = await homeBridgeWithThreeSigs.submitSignature(signature3, message, {from: authoritiesFiveAccs[2]}).should.be.fulfilled; + logs.length.should.be.equal(2) + logs[1].event.should.be.equal('CollectedSignatures') + logs[1].args.authorityResponsibleForRelay.should.be.equal(authoritiesFiveAccs[2]) + }) it('attack when increasing requiredSignatures', async () => { var recipientAccount = accounts[8] var value = web3.toBigNumber(web3.toWei(0.5, "ether")); From 0c4fe91fafdebcfc2bdfc67281f90df6e028b552 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 22 Oct 2018 10:44:50 -0300 Subject: [PATCH 58/77] Add new executeAffirmation tests on home contracts --- test/erc_to_erc/home_bridge.test.js | 32 +++++++++++++++++++++++ test/erc_to_native/home_bridge.test.js | 30 ++++++++++++++++++++++ test/native_to_erc/home_bridge_test.js | 35 ++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) diff --git a/test/erc_to_erc/home_bridge.test.js b/test/erc_to_erc/home_bridge.test.js index fbe53bd82..0a2950693 100644 --- a/test/erc_to_erc/home_bridge.test.js +++ b/test/erc_to_erc/home_bridge.test.js @@ -228,6 +228,38 @@ contract('HomeBridge_ERC20_to_ERC20', async (accounts) => { balanceBefore.add(value).should.be.bignumber.equal(await token2sig.balanceOf(recipient)) }) + it('works with 5 validators and 3 required signatures', async () => { + const recipient = accounts[8] + const authoritiesFiveAccs = [accounts[1], accounts[2], accounts[3], accounts[4], accounts[5]] + let ownerOfValidators = accounts[0] + const validatorContractWith3Signatures = await BridgeValidators.new() + await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) + const token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); + + const homeBridgeWithThreeSigs = await HomeBridge.new(); + await homeBridgeWithThreeSigs.initialize(validatorContractWith3Signatures.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, token.address); + await token.transferOwnership(homeBridgeWithThreeSigs.address); + + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; + + const {logs} = await homeBridgeWithThreeSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesFiveAccs[0]}).should.be.fulfilled; + logs[0].event.should.be.equal("SignedForAffirmation"); + logs[0].args.should.be.deep.equal({ + signer: authorities[0], + transactionHash + }); + + await homeBridgeWithThreeSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesFiveAccs[1]}).should.be.fulfilled; + const thirdSignature = await homeBridgeWithThreeSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesFiveAccs[2]}).should.be.fulfilled; + + thirdSignature.logs[1].event.should.be.equal("AffirmationCompleted"); + thirdSignature.logs[1].args.should.be.deep.equal({ + recipient, + value, + transactionHash + }) + }) }) describe('#isAlreadyProcessed', async () => { it('returns ', async () => { diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index 7f43e85c7..4d1de7df2 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -344,6 +344,36 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; await homeBridge.executeAffirmation(recipient, value, transactionHash, {from: authorities[0]}).should.be.rejectedWith(ERROR_MSG) }) + it('works with 5 validators and 3 required signatures', async () => { + const recipient = accounts[8] + const authoritiesFiveAccs = [accounts[1], accounts[2], accounts[3], accounts[4], accounts[5]] + let ownerOfValidators = accounts[0] + const validatorContractWith3Signatures = await BridgeValidators.new() + await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) + + const homeBridgeWithThreeSigs = await HomeBridge.new(); + await homeBridgeWithThreeSigs.initialize(validatorContractWith3Signatures.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations, blockRewardContract.address); + + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; + + const {logs} = await homeBridgeWithThreeSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesFiveAccs[0]}).should.be.fulfilled; + logs[0].event.should.be.equal("SignedForAffirmation"); + logs[0].args.should.be.deep.equal({ + signer: authorities[0], + transactionHash + }); + + await homeBridgeWithThreeSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesFiveAccs[1]}).should.be.fulfilled; + const thirdSignature = await homeBridgeWithThreeSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesFiveAccs[2]}).should.be.fulfilled; + + thirdSignature.logs[1].event.should.be.equal("AffirmationCompleted"); + thirdSignature.logs[1].args.should.be.deep.equal({ + recipient, + value, + transactionHash + }) + }) }) describe('#submitSignature', async () => { diff --git a/test/native_to_erc/home_bridge_test.js b/test/native_to_erc/home_bridge_test.js index 3b799e35e..22da752c3 100644 --- a/test/native_to_erc/home_bridge_test.js +++ b/test/native_to_erc/home_bridge_test.js @@ -322,6 +322,41 @@ contract('HomeBridge', async (accounts) => { homeBalanceAfter.should.be.bignumber.equal(0) }) + it('works with 5 validators and 3 required signatures', async () => { + const recipient = accounts[8] + const authoritiesFiveAccs = [accounts[1], accounts[2], accounts[3], accounts[4], accounts[5]] + let ownerOfValidators = accounts[0] + const validatorContractWith3Signatures = await BridgeValidators.new() + await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) + + const homeBridgeWithThreeSigs = await HomeBridge.new(); + await homeBridgeWithThreeSigs.initialize(validatorContractWith3Signatures.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations); + + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const transactionHash = "0x806335163828a8eda675cff9c84fa6e6c7cf06bb44cc6ec832e42fe789d01415"; + + await homeBridgeWithThreeSigs.sendTransaction({ + from: recipient, + value: halfEther + }).should.be.fulfilled + + const {logs} = await homeBridgeWithThreeSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesFiveAccs[0]}).should.be.fulfilled; + logs[0].event.should.be.equal("SignedForAffirmation"); + logs[0].args.should.be.deep.equal({ + signer: authorities[0], + transactionHash + }); + + await homeBridgeWithThreeSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesFiveAccs[1]}).should.be.fulfilled; + const thirdSignature = await homeBridgeWithThreeSigs.executeAffirmation(recipient, value, transactionHash, {from: authoritiesFiveAccs[2]}).should.be.fulfilled; + + thirdSignature.logs[1].event.should.be.equal("AffirmationCompleted"); + thirdSignature.logs[1].args.should.be.deep.equal({ + recipient, + value, + transactionHash + }) + }) }) describe('#isAlreadyProcessed', async () => { it('returns ', async () => { From 342c4bd49d33d8f55d7b4fbeb375a0a66ccccfb9 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 22 Oct 2018 12:07:17 -0300 Subject: [PATCH 59/77] Add new executeSignatures tests on foreign contracts --- test/erc_to_erc/foreign_bridge.test.js | 36 +++++++++++++++++++++++ test/erc_to_native/foreign_bridge.test.js | 35 ++++++++++++++++++++++ test/native_to_erc/foreign_bridge_test.js | 35 ++++++++++++++++++++++ 3 files changed, 106 insertions(+) diff --git a/test/erc_to_erc/foreign_bridge.test.js b/test/erc_to_erc/foreign_bridge.test.js index d7f2a30d3..73c061954 100644 --- a/test/erc_to_erc/foreign_bridge.test.js +++ b/test/erc_to_erc/foreign_bridge.test.js @@ -178,6 +178,42 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { false.should.be.equal(await foreignBridgeWithMultiSignatures.relayedMessages(transactionHash)) await foreignBridgeWithMultiSignatures.executeSignatures([vrs.v, vrs.v], [vrs.r, vrs.r], [vrs.s, vrs.s], message).should.be.rejectedWith(ERROR_MSG) }) + + it('works with 5 validators and 3 required signatures', async () => { + const recipient = accounts[8] + const authoritiesFiveAccs = [accounts[1], accounts[2], accounts[3], accounts[4], accounts[5]] + const ownerOfValidators = accounts[0] + const validatorContractWith3Signatures = await BridgeValidators.new() + await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) + const erc20Token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const foreignBridgeWithThreeSigs = await ForeignBridge.new() + + await foreignBridgeWithThreeSigs.initialize(validatorContractWith3Signatures.address, erc20Token.address, requireBlockConfirmations, gasPrice); + await erc20Token.mint(foreignBridgeWithThreeSigs.address, value); + + const txHash = "0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121"; + const message = createMessage(recipient, value, txHash, foreignBridgeWithThreeSigs.address); + + // signature 1 + const signature = await sign(authoritiesFiveAccs[0], message) + const vrs = signatureToVRS(signature); + + // signature 2 + const signature2 = await sign(authoritiesFiveAccs[1], message) + const vrs2 = signatureToVRS(signature2); + + // signature 3 + const signature3 = await sign(authoritiesFiveAccs[2], message) + const vrs3 = signatureToVRS(signature3); + + + const {logs} = await foreignBridgeWithThreeSigs.executeSignatures([vrs.v, vrs2.v, vrs3.v], [vrs.r, vrs2.r, vrs3.r], [vrs.s, vrs2.s, vrs3.s], message).should.be.fulfilled; + logs[0].event.should.be.equal("RelayedMessage") + logs[0].args.recipient.should.be.equal(recipient) + logs[0].args.value.should.be.bignumber.equal(value) + true.should.be.equal(await foreignBridgeWithThreeSigs.relayedMessages(txHash)) + }) }) describe('#upgradeable', async () => { diff --git a/test/erc_to_native/foreign_bridge.test.js b/test/erc_to_native/foreign_bridge.test.js index e7673ec33..3c25274c0 100644 --- a/test/erc_to_native/foreign_bridge.test.js +++ b/test/erc_to_native/foreign_bridge.test.js @@ -186,6 +186,41 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { await foreignBridgeWithMultiSignatures.executeSignatures([vrs.v, vrs.v], [vrs.r, vrs.r], [vrs.s, vrs.s], message).should.be.rejectedWith(ERROR_MSG) }) + it('works with 5 validators and 3 required signatures', async () => { + const recipient = accounts[8] + const authoritiesFiveAccs = [accounts[1], accounts[2], accounts[3], accounts[4], accounts[5]] + const ownerOfValidators = accounts[0] + const validatorContractWith3Signatures = await BridgeValidators.new() + await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) + const erc20Token = await ERC677BridgeToken.new("Some ERC20", "RSZT", 18); + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const foreignBridgeWithThreeSigs = await ForeignBridge.new() + + await foreignBridgeWithThreeSigs.initialize(validatorContractWith3Signatures.address, erc20Token.address, requireBlockConfirmations, gasPrice); + await erc20Token.mint(foreignBridgeWithThreeSigs.address, value); + + const txHash = "0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121"; + const message = createMessage(recipient, value, txHash, foreignBridgeWithThreeSigs.address); + + // signature 1 + const signature = await sign(authoritiesFiveAccs[0], message) + const vrs = signatureToVRS(signature); + + // signature 2 + const signature2 = await sign(authoritiesFiveAccs[1], message) + const vrs2 = signatureToVRS(signature2); + + // signature 3 + const signature3 = await sign(authoritiesFiveAccs[2], message) + const vrs3 = signatureToVRS(signature3); + + + const {logs} = await foreignBridgeWithThreeSigs.executeSignatures([vrs.v, vrs2.v, vrs3.v], [vrs.r, vrs2.r, vrs3.r], [vrs.s, vrs2.s, vrs3.s], message).should.be.fulfilled; + logs[0].event.should.be.equal("RelayedMessage") + logs[0].args.recipient.should.be.equal(recipient) + logs[0].args.value.should.be.bignumber.equal(value) + true.should.be.equal(await foreignBridgeWithThreeSigs.relayedMessages(txHash)) + }) }) describe('#upgradeable', async () => { diff --git a/test/native_to_erc/foreign_bridge_test.js b/test/native_to_erc/foreign_bridge_test.js index 06156110c..72b89f2f2 100644 --- a/test/native_to_erc/foreign_bridge_test.js +++ b/test/native_to_erc/foreign_bridge_test.js @@ -216,6 +216,41 @@ contract('ForeignBridge', async (accounts) => { false.should.be.equal(await foreignBridgeWithMultiSignatures.relayedMessages(transactionHash)) await foreignBridgeWithMultiSignatures.executeSignatures([vrs.v, vrs.v], [vrs.r, vrs.r], [vrs.s, vrs.s], message).should.be.rejectedWith(ERROR_MSG) }) + it('works with 5 validators and 3 required signatures', async () => { + const recipient = accounts[8] + const authoritiesFiveAccs = [accounts[1], accounts[2], accounts[3], accounts[4], accounts[5]] + const ownerOfValidators = accounts[0] + const validatorContractWith3Signatures = await BridgeValidators.new() + await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) + const erc20Token = await POA20.new("Some ERC20", "RSZT", 18); + const value = web3.toBigNumber(web3.toWei(0.5, "ether")); + const foreignBridgeWithThreeSigs = await ForeignBridge.new() + + await foreignBridgeWithThreeSigs.initialize(validatorContractWith3Signatures.address, erc20Token.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations); + await erc20Token.transferOwnership(foreignBridgeWithThreeSigs.address); + + const txHash = "0x35d3818e50234655f6aebb2a1cfbf30f59568d8a4ec72066fac5a25dbe7b8121"; + const message = createMessage(recipient, value, txHash, foreignBridgeWithThreeSigs.address); + + // signature 1 + const signature = await sign(authoritiesFiveAccs[0], message) + const vrs = signatureToVRS(signature); + + // signature 2 + const signature2 = await sign(authoritiesFiveAccs[1], message) + const vrs2 = signatureToVRS(signature2); + + // signature 3 + const signature3 = await sign(authoritiesFiveAccs[2], message) + const vrs3 = signatureToVRS(signature3); + + + const {logs} = await foreignBridgeWithThreeSigs.executeSignatures([vrs.v, vrs2.v, vrs3.v], [vrs.r, vrs2.r, vrs3.r], [vrs.s, vrs2.s, vrs3.s], message).should.be.fulfilled; + logs[0].event.should.be.equal("RelayedMessage") + logs[0].args.recipient.should.be.equal(recipient) + logs[0].args.value.should.be.bignumber.equal(value) + true.should.be.equal(await foreignBridgeWithThreeSigs.relayedMessages(txHash)) + }) }) From 9547cee10b1e92297071004c03597aaa1172ae43 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 22 Oct 2018 12:37:35 -0300 Subject: [PATCH 60/77] Add gas usage report on README --- README.md | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/README.md b/README.md index b8244a473..a5e77d6ad 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,127 @@ Please the [README.md](deploy/README.md) in the `deploy` folder for instructions npm test ``` +##### Gas usage report +``` +·---------------------------------------------------------------------------------------------|-----------------------------------· +| Gas · Block limit: 17592186044415 gas │ +··························································|···································|···································· +| Methods · 1 gwei/gas · 204.45 usd/eth │ +·····························|····························|···········|···········|···········|··················|················· +| Contract · Method · Min · Max · Avg · # calls · usd (avg) │ +·····························|····························|···········|···········|···········|··················|················· +| BlockReward · addMintedTotallyByBridge · - · - · 44279 · 6 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| BridgeValidators · addValidator · - · - · 53178 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| BridgeValidators · initialize · 187738 · 280847 · 253949 · 15 · 0.05 │ +·····························|····························|···········|···········|···········|··················|················· +| BridgeValidators · removeValidator · - · - · 24400 · 3 · 0.00 │ +·····························|····························|···········|···········|···········|··················|················· +| BridgeValidators · setRequiredSignatures · - · - · 29790 · 11 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ERC677BridgeToken · burn · - · - · 18249 · 1 · 0.00 │ +·····························|····························|···········|···········|···········|··················|················· +| ERC677BridgeToken · claimTokens · - · - · 44183 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ERC677BridgeToken · mint · 53369 · 68497 · 66130 · 27 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ERC677BridgeToken · setBridgeContract · 29432 · 44432 · 39432 · 12 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ERC677BridgeToken · transfer · 37691 · 86589 · 55005 · 12 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ERC677BridgeToken · transferAndCall · 58370 · 166206 · 92399 · 8 · 0.02 │ +·····························|····························|···········|···········|···········|··················|················· +| ERC677BridgeToken · transferOwnership · 30860 · 30924 · 30919 · 12 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| EternalStorageProxy · upgradeTo · 35871 · 65871 · 55864 · 9 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| EternalStorageProxy · upgradeToAndCall · 199612 · 262801 · 237404 · 7 · 0.05 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeErcToErc · claimTokens · - · - · 52157 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeErcToErc · executeSignatures · 73779 · 115769 · 93027 · 6 · 0.02 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeErcToErc · initialize · - · - · 150614 · 3 · 0.03 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeErcToNative · claimTokens · - · - · 52157 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeErcToNative · executeSignatures · 73779 · 115769 · 92985 · 6 · 0.02 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeErcToNative · initialize · - · - · 150614 · 3 · 0.03 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeNativeToErc · claimTokens · - · - · 47586 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeNativeToErc · claimTokensFromErc677 · - · - · 50828 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeNativeToErc · executeSignatures · 89201 · 146127 · 120917 · 6 · 0.02 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeNativeToErc · initialize · 213493 · 213557 · 213549 · 8 · 0.04 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeNativeToErc · setMaxPerTx · - · - · 32249 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| ForeignBridgeNativeToErc · setMinPerTx · - · - · 32774 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToErc · executeAffirmation · 79336 · 134607 · 108215 · 8 · 0.02 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToErc · initialize · 212299 · 213195 · 213003 · 5 · 0.04 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToErc · setMaxPerTx · - · - · 32084 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToErc · setMinPerTx · - · - · 32673 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToErc · submitSignature · 159386 · 275159 · 220171 · 10 · 0.05 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToNative · executeAffirmation · 64380 · 140744 · 97562 · 6 · 0.02 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToNative · initialize · 196910 · 213930 · 210795 · 6 · 0.04 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToNative · setBlockRewardContract · - · - · 35251 · 1 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToNative · setDailyLimit · - · - · 32433 · 3 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToNative · setMaxPerTx · - · - · 32106 · 3 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToNative · setMinPerTx · - · - · 32716 · 2 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeErcToNative · submitSignature · 159428 · 275201 · 220206 · 10 · 0.05 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeNativeToErc · executeAffirmation · 64314 · 107669 · 83596 · 10 · 0.02 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeNativeToErc · initialize · 190051 · 190947 · 190768 · 5 · 0.04 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeNativeToErc · setDailyLimit · - · - · 32367 · 3 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeNativeToErc · setMaxPerTx · - · - · 32040 · 3 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeNativeToErc · setMinPerTx · - · - · 32651 · 2 · 0.01 │ +·····························|····························|···········|···········|···········|··················|················· +| HomeBridgeNativeToErc · submitSignature · 159362 · 275135 · 220134 · 10 · 0.05 │ +·····························|····························|···········|···········|···········|··················|················· +| Deployments · · % of limit · │ +··························································|···········|···········|···········|··················|················· +| BlockReward · - · - · 329177 · 0 % · 0.07 │ +··························································|···········|···········|···········|··················|················· +| BridgeValidators · - · - · 1144207 · 0 % · 0.23 │ +··························································|···········|···········|···········|··················|················· +| ERC677BridgeToken · 1498202 · 1499226 · 1498825 · 0 % · 0.31 │ +··························································|···········|···········|···········|··················|················· +| EternalStorageProxy · - · - · 378510 · 0 % · 0.08 │ +··························································|···········|···········|···········|··················|················· +| ForeignBridgeErcToErc · - · - · 2449436 · 0 % · 0.50 │ +··························································|···········|···········|···········|··················|················· +| ForeignBridgeErcToNative · - · - · 2449564 · 0 % · 0.50 │ +··························································|···········|···········|···········|··················|················· +| ForeignBridgeNativeToErc · - · - · 2768705 · 0 % · 0.57 │ +··························································|···········|···········|···········|··················|················· +| HomeBridgeErcToErc · - · - · 3492618 · 0 % · 0.71 │ +··························································|···········|···········|···········|··················|················· +| HomeBridgeErcToNative · - · - · 3757420 · 0 % · 0.77 │ +··························································|···········|···········|···········|··················|················· +| HomeBridgeNativeToErc · - · - · 3327263 · 0 % · 0.68 │ +·---------------------------------------------------------|-----------|-----------|-----------|------------------|----------------· +``` + ### Flatten ```bash npm run flatten From 9266487737c18f51f063d03118a8b6ecbd28dca0 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 23 Oct 2018 15:25:08 -0300 Subject: [PATCH 61/77] Add transferProxyOwnership test --- test/native_to_erc/foreign_bridge_test.js | 11 ++++++++++- test/native_to_erc/home_bridge_test.js | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/test/native_to_erc/foreign_bridge_test.js b/test/native_to_erc/foreign_bridge_test.js index 72b89f2f2..e9dc04b54 100644 --- a/test/native_to_erc/foreign_bridge_test.js +++ b/test/native_to_erc/foreign_bridge_test.js @@ -28,7 +28,7 @@ const getEvents = function(contract, filter) { }); } contract('ForeignBridge', async (accounts) => { - let homeContract, validatorContract, authorities, owner, token; + let validatorContract, authorities, owner, token; before(async () => { validatorContract = await BridgeValidators.new() authorities = [accounts[1], accounts[2]]; @@ -412,6 +412,15 @@ contract('ForeignBridge', async (accounts) => { FOREIGN_MAX_AMOUNT_PER_TX.should.be.bignumber.equal(await finalContract.maxPerTx()) FOREIGN_MIN_AMOUNT_PER_TX.should.be.bignumber.equal(await finalContract.minPerTx()) }) + it('can transfer ownership', async () => { + const token = await POA20.new("POA ERC20 Foundation", "POA20", 18); + const foreignBridge = await ForeignBridge.new(); + const storageProxy = await EternalStorageProxy.new().should.be.fulfilled; + const data = foreignBridge.initialize.request( + validatorContract.address, token.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations).params[0].data + await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; + await storageProxy.transferProxyOwnership(owner).should.be.fulfilled + }) }) describe('#claimTokens', async () => { diff --git a/test/native_to_erc/home_bridge_test.js b/test/native_to_erc/home_bridge_test.js index 22da752c3..a5d944ef2 100644 --- a/test/native_to_erc/home_bridge_test.js +++ b/test/native_to_erc/home_bridge_test.js @@ -62,6 +62,12 @@ contract('HomeBridge', async (accounts) => { "2".should.be.bignumber.equal(await finalContract.maxPerTx()) "1".should.be.bignumber.equal(await finalContract.minPerTx()) }) + it('can transfer ownership', async () => { + let storageProxy = await EternalStorageProxy.new().should.be.fulfilled; + let data = homeContract.initialize.request(validatorContract.address, "3", "2", "1", gasPrice, requireBlockConfirmations).params[0].data + await storageProxy.upgradeToAndCall('1', homeContract.address, data).should.be.fulfilled; + await storageProxy.transferProxyOwnership(owner).should.be.fulfilled + }) }) describe('#fallback', async () => { From 9cc1c99ace4262bef9e6befe4c816b11eadb3a7b Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 23 Oct 2018 15:25:38 -0300 Subject: [PATCH 62/77] Add Native-to-ERC20 gas consumption report --- README.md | 182 ++++++++++++++++++------------------------------------ 1 file changed, 61 insertions(+), 121 deletions(-) diff --git a/README.md b/README.md index a5e77d6ad..80db8549e 100644 --- a/README.md +++ b/README.md @@ -62,132 +62,72 @@ Please the [README.md](deploy/README.md) in the `deploy` folder for instructions npm test ``` -##### Gas usage report -``` -·---------------------------------------------------------------------------------------------|-----------------------------------· -| Gas · Block limit: 17592186044415 gas │ -··························································|···································|···································· -| Methods · 1 gwei/gas · 204.45 usd/eth │ -·····························|····························|···········|···········|···········|··················|················· -| Contract · Method · Min · Max · Avg · # calls · usd (avg) │ -·····························|····························|···········|···········|···········|··················|················· -| BlockReward · addMintedTotallyByBridge · - · - · 44279 · 6 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| BridgeValidators · addValidator · - · - · 53178 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| BridgeValidators · initialize · 187738 · 280847 · 253949 · 15 · 0.05 │ -·····························|····························|···········|···········|···········|··················|················· -| BridgeValidators · removeValidator · - · - · 24400 · 3 · 0.00 │ -·····························|····························|···········|···········|···········|··················|················· -| BridgeValidators · setRequiredSignatures · - · - · 29790 · 11 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ERC677BridgeToken · burn · - · - · 18249 · 1 · 0.00 │ -·····························|····························|···········|···········|···········|··················|················· -| ERC677BridgeToken · claimTokens · - · - · 44183 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ERC677BridgeToken · mint · 53369 · 68497 · 66130 · 27 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ERC677BridgeToken · setBridgeContract · 29432 · 44432 · 39432 · 12 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ERC677BridgeToken · transfer · 37691 · 86589 · 55005 · 12 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ERC677BridgeToken · transferAndCall · 58370 · 166206 · 92399 · 8 · 0.02 │ -·····························|····························|···········|···········|···········|··················|················· -| ERC677BridgeToken · transferOwnership · 30860 · 30924 · 30919 · 12 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| EternalStorageProxy · upgradeTo · 35871 · 65871 · 55864 · 9 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| EternalStorageProxy · upgradeToAndCall · 199612 · 262801 · 237404 · 7 · 0.05 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeErcToErc · claimTokens · - · - · 52157 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeErcToErc · executeSignatures · 73779 · 115769 · 93027 · 6 · 0.02 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeErcToErc · initialize · - · - · 150614 · 3 · 0.03 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeErcToNative · claimTokens · - · - · 52157 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeErcToNative · executeSignatures · 73779 · 115769 · 92985 · 6 · 0.02 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeErcToNative · initialize · - · - · 150614 · 3 · 0.03 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeNativeToErc · claimTokens · - · - · 47586 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeNativeToErc · claimTokensFromErc677 · - · - · 50828 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeNativeToErc · executeSignatures · 89201 · 146127 · 120917 · 6 · 0.02 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeNativeToErc · initialize · 213493 · 213557 · 213549 · 8 · 0.04 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeNativeToErc · setMaxPerTx · - · - · 32249 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| ForeignBridgeNativeToErc · setMinPerTx · - · - · 32774 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToErc · executeAffirmation · 79336 · 134607 · 108215 · 8 · 0.02 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToErc · initialize · 212299 · 213195 · 213003 · 5 · 0.04 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToErc · setMaxPerTx · - · - · 32084 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToErc · setMinPerTx · - · - · 32673 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToErc · submitSignature · 159386 · 275159 · 220171 · 10 · 0.05 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToNative · executeAffirmation · 64380 · 140744 · 97562 · 6 · 0.02 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToNative · initialize · 196910 · 213930 · 210795 · 6 · 0.04 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToNative · setBlockRewardContract · - · - · 35251 · 1 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToNative · setDailyLimit · - · - · 32433 · 3 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToNative · setMaxPerTx · - · - · 32106 · 3 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToNative · setMinPerTx · - · - · 32716 · 2 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeErcToNative · submitSignature · 159428 · 275201 · 220206 · 10 · 0.05 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeNativeToErc · executeAffirmation · 64314 · 107669 · 83596 · 10 · 0.02 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeNativeToErc · initialize · 190051 · 190947 · 190768 · 5 · 0.04 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeNativeToErc · setDailyLimit · - · - · 32367 · 3 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeNativeToErc · setMaxPerTx · - · - · 32040 · 3 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeNativeToErc · setMinPerTx · - · - · 32651 · 2 · 0.01 │ -·····························|····························|···········|···········|···········|··················|················· -| HomeBridgeNativeToErc · submitSignature · 159362 · 275135 · 220134 · 10 · 0.05 │ -·····························|····························|···········|···········|···········|··················|················· -| Deployments · · % of limit · │ -··························································|···········|···········|···········|··················|················· -| BlockReward · - · - · 329177 · 0 % · 0.07 │ -··························································|···········|···········|···········|··················|················· -| BridgeValidators · - · - · 1144207 · 0 % · 0.23 │ -··························································|···········|···········|···········|··················|················· -| ERC677BridgeToken · 1498202 · 1499226 · 1498825 · 0 % · 0.31 │ -··························································|···········|···········|···········|··················|················· -| EternalStorageProxy · - · - · 378510 · 0 % · 0.08 │ -··························································|···········|···········|···········|··················|················· -| ForeignBridgeErcToErc · - · - · 2449436 · 0 % · 0.50 │ -··························································|···········|···········|···········|··················|················· -| ForeignBridgeErcToNative · - · - · 2449564 · 0 % · 0.50 │ -··························································|···········|···········|···········|··················|················· -| ForeignBridgeNativeToErc · - · - · 2768705 · 0 % · 0.57 │ -··························································|···········|···········|···········|··················|················· -| HomeBridgeErcToErc · - · - · 3492618 · 0 % · 0.71 │ -··························································|···········|···········|···········|··················|················· -| HomeBridgeErcToNative · - · - · 3757420 · 0 % · 0.77 │ -··························································|···········|···········|···········|··················|················· -| HomeBridgeNativeToErc · - · - · 3327263 · 0 % · 0.68 │ -·---------------------------------------------------------|-----------|-----------|-----------|------------------|----------------· -``` - ### Flatten ```bash npm run flatten ``` +### Gas Consumption + +#### `NATIVE-TO-ERC` Bridge Mode + +##### Deployment +###### Home + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +EternalStorageProxy|deployment|378510|378510|378510 +BridgeValidators|deployment|1144207|1144207|1144207 +EternalStorageProxy|upgradeTo|35871|30924|30913 +BridgeValidators|initialize|187738|280847|253949 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +EternalStorageProxy|deployment|378510|378510|378510 +HomeBridgeNativeToErc|deployment|3327263|3327263|3327263 +EternalStorageProxy|upgradeTo|35871|30924|30913 +HomeBridgeNativeToErc|initialize|190051|190947|190755 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +Total| |5739327|5823438|5796326 + +###### Foreign + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +ERC677BridgeToken|deployment|1498202|1499226|1498829 +EternalStorageProxy|deployment|378510|378510|378510 +BridgeValidators|deployment|1144207|1144207|1144207 +EternalStorageProxy|upgradeTo|35871|30924|30913 +BridgeValidators|initialize|187738|280847|253949 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +EternalStorageProxy|deployment|378510|378510|378510 +ForeignBridgeNativeToErc|deployment|2768705|2768705|2768705 +EternalStorageProxy|upgradeTo|35871|30924|30913 +ForeignBridgeNativeToErc|initialize|213493|213557|213549 +ERC677BridgeToken|setBridgeContract|29432|44432|39432 +ERC677BridgeToken|transferOwnership|30860|30924|30913 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +Total| |6762705|6862072|6829736 + +##### Usage + +###### Validators + + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +To sign at the Home (each validator)| +HomeBridgeNativeToErc|submitSignature|159362|275135|220127 +To relay signatures from the Home to the Foreign (one validator)| +ForeignBridgeNativeToErc|executeSignatures|89201|146127|120917 +To sign and relay from the Foreign to the Home (each validator)| +HomeBridgeNativeToErc|executeAffirmation|64314|107669|83596 + +###### Users + + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +To request transfer from the Home to the Foreign| +HomeBridgeNativeToErc|fallback|46982|46982|46982 +To request transfer from the Foreign to the Home| +ERC677BridgeToken|transferAndCall|58370|166206|92399 + + ## Contributing See the [CONTRIBUTING](CONTRIBUTING.md) document for contribution, testing and pull request protocol. From 1225b12b22e8c0fe9b645ea5bbc9fcfc97dc22df Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 23 Oct 2018 16:05:26 -0300 Subject: [PATCH 63/77] Add GAS_CONSUMPTION file --- GAS_CONSUMPTION.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 59 +--------------------------------------------- 2 files changed, 60 insertions(+), 58 deletions(-) create mode 100644 GAS_CONSUMPTION.md diff --git a/GAS_CONSUMPTION.md b/GAS_CONSUMPTION.md new file mode 100644 index 000000000..3daec6dfb --- /dev/null +++ b/GAS_CONSUMPTION.md @@ -0,0 +1,59 @@ +## Gas Consumption + +### `NATIVE-TO-ERC` Bridge Mode + +#### Deployment +##### Home + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +EternalStorageProxy|deployment|378510|378510|378510 +BridgeValidators|deployment|1144207|1144207|1144207 +EternalStorageProxy|upgradeTo|35871|30924|30913 +BridgeValidators|initialize|187738|280847|253949 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +EternalStorageProxy|deployment|378510|378510|378510 +HomeBridgeNativeToErc|deployment|3327263|3327263|3327263 +EternalStorageProxy|upgradeTo|35871|30924|30913 +HomeBridgeNativeToErc|initialize|190051|190947|190755 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +Total| |5739327|5823438|5796326 + +##### Foreign + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +ERC677BridgeToken|deployment|1498202|1499226|1498829 +EternalStorageProxy|deployment|378510|378510|378510 +BridgeValidators|deployment|1144207|1144207|1144207 +EternalStorageProxy|upgradeTo|35871|30924|30913 +BridgeValidators|initialize|187738|280847|253949 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +EternalStorageProxy|deployment|378510|378510|378510 +ForeignBridgeNativeToErc|deployment|2768705|2768705|2768705 +EternalStorageProxy|upgradeTo|35871|30924|30913 +ForeignBridgeNativeToErc|initialize|213493|213557|213549 +ERC677BridgeToken|setBridgeContract|29432|44432|39432 +ERC677BridgeToken|transferOwnership|30860|30924|30913 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +Total| |6762705|6862072|6829736 + +#### Usage + +##### Validators + + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +To sign at the Home (each validator)| +HomeBridgeNativeToErc|submitSignature|159362|275135|220127 +To relay signatures from the Home to the Foreign (one validator)| +ForeignBridgeNativeToErc|executeSignatures|89201|146127|120917 +To sign and relay from the Foreign to the Home (each validator)| +HomeBridgeNativeToErc|executeAffirmation|64314|107669|83596 + +##### Users + + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +To request transfer from the Home to the Foreign| +HomeBridgeNativeToErc|fallback|46982|46982|46982 +To request transfer from the Foreign to the Home| +ERC677BridgeToken|transferAndCall|58370|166206|92399 diff --git a/README.md b/README.md index 80db8549e..b3b114c49 100644 --- a/README.md +++ b/README.md @@ -68,64 +68,7 @@ npm run flatten ``` ### Gas Consumption - -#### `NATIVE-TO-ERC` Bridge Mode - -##### Deployment -###### Home - Contract | Method | Min | Max | Avg ----- | ---- | ---- | ---- | ---- -EternalStorageProxy|deployment|378510|378510|378510 -BridgeValidators|deployment|1144207|1144207|1144207 -EternalStorageProxy|upgradeTo|35871|30924|30913 -BridgeValidators|initialize|187738|280847|253949 -EternalStorageProxy|transferProxyOwnership|30653|30653|30653 -EternalStorageProxy|deployment|378510|378510|378510 -HomeBridgeNativeToErc|deployment|3327263|3327263|3327263 -EternalStorageProxy|upgradeTo|35871|30924|30913 -HomeBridgeNativeToErc|initialize|190051|190947|190755 -EternalStorageProxy|transferProxyOwnership|30653|30653|30653 -Total| |5739327|5823438|5796326 - -###### Foreign - Contract | Method | Min | Max | Avg ----- | ---- | ---- | ---- | ---- -ERC677BridgeToken|deployment|1498202|1499226|1498829 -EternalStorageProxy|deployment|378510|378510|378510 -BridgeValidators|deployment|1144207|1144207|1144207 -EternalStorageProxy|upgradeTo|35871|30924|30913 -BridgeValidators|initialize|187738|280847|253949 -EternalStorageProxy|transferProxyOwnership|30653|30653|30653 -EternalStorageProxy|deployment|378510|378510|378510 -ForeignBridgeNativeToErc|deployment|2768705|2768705|2768705 -EternalStorageProxy|upgradeTo|35871|30924|30913 -ForeignBridgeNativeToErc|initialize|213493|213557|213549 -ERC677BridgeToken|setBridgeContract|29432|44432|39432 -ERC677BridgeToken|transferOwnership|30860|30924|30913 -EternalStorageProxy|transferProxyOwnership|30653|30653|30653 -Total| |6762705|6862072|6829736 - -##### Usage - -###### Validators - - Contract | Method | Min | Max | Avg ----- | ---- | ---- | ---- | ---- -To sign at the Home (each validator)| -HomeBridgeNativeToErc|submitSignature|159362|275135|220127 -To relay signatures from the Home to the Foreign (one validator)| -ForeignBridgeNativeToErc|executeSignatures|89201|146127|120917 -To sign and relay from the Foreign to the Home (each validator)| -HomeBridgeNativeToErc|executeAffirmation|64314|107669|83596 - -###### Users - - Contract | Method | Min | Max | Avg ----- | ---- | ---- | ---- | ---- -To request transfer from the Home to the Foreign| -HomeBridgeNativeToErc|fallback|46982|46982|46982 -To request transfer from the Foreign to the Home| -ERC677BridgeToken|transferAndCall|58370|166206|92399 +See the [GAS_CONSUMPTION](GAS_CONSUMPTION.md) document to get a description of gas consumption. ## Contributing From c677e6b2336965145994ea1cd0c1dd9d2e4d8f4e Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Wed, 24 Oct 2018 10:30:59 -0300 Subject: [PATCH 64/77] Add ERC20-to-ERC20 gas consumption report --- GAS_CONSUMPTION.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/GAS_CONSUMPTION.md b/GAS_CONSUMPTION.md index 3daec6dfb..fbf1bc544 100644 --- a/GAS_CONSUMPTION.md +++ b/GAS_CONSUMPTION.md @@ -57,3 +57,62 @@ To request transfer from the Home to the Foreign| HomeBridgeNativeToErc|fallback|46982|46982|46982 To request transfer from the Foreign to the Home| ERC677BridgeToken|transferAndCall|58370|166206|92399 + + +### `ERC-TO-ERC` Bridge Mode + +#### Deployment +##### Home + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +EternalStorageProxy|deployment|378510|378510|378510 +BridgeValidators|deployment|1144207|1144207|1144207 +EternalStorageProxy|upgradeTo|35871|30924|30913 +BridgeValidators|initialize|187738|280847|253949 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +EternalStorageProxy|deployment|378510|378510|378510 +HomeBridgeErcToErc|deployment|3528509|3528509|3528509 +EternalStorageProxy|upgradeTo|35871|30924|30913 +ERC677BridgeToken|deployment|1498202|1499226|1498829 +ERC677BridgeToken|setBridgeContract|29432|44432|39432 +ERC677BridgeToken|transferOwnership|30860|30924|30913 +HomeBridgeErcToErc|initialize|212299|213195|213003 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +Total| |7521315|7621514|7588994 + +##### Foreign + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +EternalStorageProxy|deployment|378510|378510|378510 +BridgeValidators|deployment|1144207|1144207|1144207 +EternalStorageProxy|upgradeTo|35871|30924|30913 +BridgeValidators|initialize|187738|280847|253949 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +EternalStorageProxy|deployment|378510|378510|378510 +ForeignBridgeErcToErc|deployment|2449436|2449436|2449436 +EternalStorageProxy|upgradeTo|35871|30924|30913 +ForeignBridgeErcToErc|initialize|150614|150614|150614 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +Total| |4822063|4905278|4878358 + +#### Usage + +##### Validators + + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +To sign at the Home (each validator)| +HomeBridgeErcToErc|submitSignature|159386|275159|220171 +To relay signatures from the Home to the Foreign (one validator)| +ForeignBridgeErcToErc|executeSignatures|73779|115769|93027 +To sign and relay from the Foreign to the Home (each validator)| +HomeBridgeErcToErc|executeAffirmation|79336|134607|108215 + +##### Users + + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +To request transfer from the Home to the Foreign| +ERC677BridgeToken|transferAndCall|58370|166206|92399 +To request transfer from the Foreign to the Home| +ERC677BridgeToken|transfer|37691|86589|55000 From d132627001b4b6269e1f01c5fa725d31f627cb89 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Wed, 24 Oct 2018 11:09:39 -0300 Subject: [PATCH 65/77] Add ERC20-to-Native gas consumption report --- GAS_CONSUMPTION.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/GAS_CONSUMPTION.md b/GAS_CONSUMPTION.md index fbf1bc544..88cc9ae49 100644 --- a/GAS_CONSUMPTION.md +++ b/GAS_CONSUMPTION.md @@ -116,3 +116,59 @@ To request transfer from the Home to the Foreign| ERC677BridgeToken|transferAndCall|58370|166206|92399 To request transfer from the Foreign to the Home| ERC677BridgeToken|transfer|37691|86589|55000 + + +### `ERC-TO-NATIVE` Bridge Mode + +#### Deployment +##### Home + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +EternalStorageProxy|deployment|378510|378510|378510 +BridgeValidators|deployment|1144207|1144207|1144207 +EternalStorageProxy|upgradeTo|35871|30924|30913 +BridgeValidators|initialize|187738|280847|253949 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +EternalStorageProxy|deployment|378510|378510|378510 +HomeBridgeErcToNative|deployment|3757420|3757420|3757420 +EternalStorageProxy|upgradeTo|35871|30924|30913 +HomeBridgeErcToNative|initialize|196910|213930|210795 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +Total| |6176343|6276578|6246523 + +##### Foreign + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +EternalStorageProxy|deployment|378510|378510|378510 +BridgeValidators|deployment|1144207|1144207|1144207 +EternalStorageProxy|upgradeTo|35871|30924|30913 +BridgeValidators|initialize|187738|280847|253949 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +EternalStorageProxy|deployment|378510|378510|378510 +ForeignBridgeErcToNative|deployment|2449564|2449564|2449564 +EternalStorageProxy|upgradeTo|35871|30924|30913 +ForeignBridgeErcToNative|initialize|150614|150614|150614 +EternalStorageProxy|transferProxyOwnership|30653|30653|30653 +Total| | + +#### Usage + +##### Validators + + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +To sign at the Home (each validator)| +HomeBridgeErcToNative|submitSignature|159428|275201|220206 +To relay signatures from the Home to the Foreign (one validator)| +ForeignBridgeErcToNative|executeSignatures|73779|115769|92985 +To sign and relay from the Foreign to the Home (each validator)| +HomeBridgeErcToNative|executeAffirmation|64380|140744|97562 + +##### Users + + Contract | Method | Min | Max | Avg +---- | ---- | ---- | ---- | ---- +To request transfer from the Home to the Foreign| +HomeBridgeErcToNative|fallback|80174|80174|80174 +To request transfer from the Foreign to the Home| +ERC677BridgeToken|transfer|37691|86589|55000 From 49997cf4818fbc0ba09a1f2d87ed1a1ff6c49ea9 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Wed, 24 Oct 2018 14:02:54 -0300 Subject: [PATCH 66/77] Check validatorContract is contract on initialize --- .../erc20_to_erc20/ForeignBridgeErcToErc.sol | 2 +- .../erc20_to_erc20/HomeBridgeErcToErc.sol | 2 +- .../erc20_to_native/ForeignBridgeErcToNative.sol | 2 +- .../erc20_to_native/HomeBridgeErcToNative.sol | 2 +- .../native_to_erc20/ForeignBridgeNativeToErc.sol | 2 +- .../native_to_erc20/HomeBridgeNativeToErc.sol | 2 +- test/erc_to_erc/foreign_bridge.test.js | 7 ++++--- test/erc_to_erc/home_bridge.test.js | 10 ++++++++++ test/erc_to_native/foreign_bridge.test.js | 12 +++++++++--- test/erc_to_native/home_bridge.test.js | 9 +++++++++ test/native_to_erc/foreign_bridge_test.js | 12 +++++++++--- test/native_to_erc/home_bridge_test.js | 8 ++++++++ 12 files changed, 55 insertions(+), 15 deletions(-) diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol index 24f24a352..23d8a42a2 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol @@ -19,7 +19,7 @@ contract ForeignBridgeErcToErc is BasicBridge, BasicForeignBridge { uint256 _gasPrice ) public returns(bool) { require(!isInitialized()); - require(_validatorContract != address(0)); + require(_validatorContract != address(0) && isContract(_validatorContract)); require(_requiredBlockConfirmations != 0); require(_gasPrice > 0); addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErc.sol b/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErc.sol index d66690a44..76ea54536 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErc.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/HomeBridgeErcToErc.sol @@ -24,7 +24,7 @@ contract HomeBridgeErcToErc is ERC677Receiver, EternalStorage, BasicBridge, Basi returns(bool) { require(!isInitialized()); - require(_validatorContract != address(0)); + require(_validatorContract != address(0) && isContract(_validatorContract)); require(_homeGasPrice > 0); require(_requiredBlockConfirmations > 0); require(_minPerTx > 0 && _maxPerTx > _minPerTx && _dailyLimit > _maxPerTx); diff --git a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol index eaa408b99..ab86718fd 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol @@ -18,7 +18,7 @@ contract ForeignBridgeErcToNative is BasicBridge, BasicForeignBridge { uint256 _gasPrice ) public returns(bool) { require(!isInitialized()); - require(_validatorContract != address(0)); + require(_validatorContract != address(0) && isContract(_validatorContract)); require(_requiredBlockConfirmations != 0); require(_gasPrice > 0); addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; diff --git a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol index 7fc21aa37..db98fae61 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/HomeBridgeErcToNative.sol @@ -36,7 +36,7 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge { ) public returns(bool) { require(!isInitialized()); - require(_validatorContract != address(0)); + require(_validatorContract != address(0) && isContract(_validatorContract)); require(_requiredBlockConfirmations > 0); require(_minPerTx > 0 && _maxPerTx > _minPerTx && _dailyLimit > _maxPerTx); require(_blockReward == address(0) || isContract(_blockReward)); diff --git a/contracts/upgradeable_contracts/native_to_erc20/ForeignBridgeNativeToErc.sol b/contracts/upgradeable_contracts/native_to_erc20/ForeignBridgeNativeToErc.sol index 6166dec04..2075908dd 100644 --- a/contracts/upgradeable_contracts/native_to_erc20/ForeignBridgeNativeToErc.sol +++ b/contracts/upgradeable_contracts/native_to_erc20/ForeignBridgeNativeToErc.sol @@ -23,7 +23,7 @@ contract ForeignBridgeNativeToErc is ERC677Receiver, BasicBridge, BasicForeignBr uint256 _requiredBlockConfirmations ) public returns(bool) { require(!isInitialized()); - require(_validatorContract != address(0)); + require(_validatorContract != address(0) && isContract(_validatorContract)); require(_minPerTx > 0 && _maxPerTx > _minPerTx && _dailyLimit > _maxPerTx); require(_foreignGasPrice > 0); addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract; diff --git a/contracts/upgradeable_contracts/native_to_erc20/HomeBridgeNativeToErc.sol b/contracts/upgradeable_contracts/native_to_erc20/HomeBridgeNativeToErc.sol index 73606ce18..43fd268d6 100644 --- a/contracts/upgradeable_contracts/native_to_erc20/HomeBridgeNativeToErc.sol +++ b/contracts/upgradeable_contracts/native_to_erc20/HomeBridgeNativeToErc.sol @@ -24,7 +24,7 @@ contract HomeBridgeNativeToErc is EternalStorage, BasicBridge, BasicHomeBridge { returns(bool) { require(!isInitialized()); - require(_validatorContract != address(0)); + require(_validatorContract != address(0) && isContract(_validatorContract)); require(_homeGasPrice > 0); require(_requiredBlockConfirmations > 0); require(_minPerTx > 0 && _maxPerTx > _minPerTx && _dailyLimit > _maxPerTx); diff --git a/test/erc_to_erc/foreign_bridge.test.js b/test/erc_to_erc/foreign_bridge.test.js index d7f2a30d3..c5c2fc03a 100644 --- a/test/erc_to_erc/foreign_bridge.test.js +++ b/test/erc_to_erc/foreign_bridge.test.js @@ -36,6 +36,7 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { await foreignBridge.initialize(validatorContract.address, ZERO_ADDRESS, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, 0, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, 0).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(owner, token.address, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); @@ -217,16 +218,16 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { }) it('can be deployed via upgradeToAndCall', async () => { const fakeTokenAddress = accounts[7] - const fakeValidatorsAddress = accounts[6] + const validatorsAddress = validatorContract.address let storageProxy = await EternalStorageProxy.new().should.be.fulfilled; let foreignBridge = await ForeignBridge.new(); let data = foreignBridge.initialize.request( - fakeValidatorsAddress, fakeTokenAddress, requireBlockConfirmations, gasPrice).params[0].data + validatorsAddress, fakeTokenAddress, requireBlockConfirmations, gasPrice).params[0].data await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; let finalContract = await ForeignBridge.at(storageProxy.address); true.should.be.equal(await finalContract.isInitialized()); - fakeValidatorsAddress.should.be.equal(await finalContract.validatorContract()) + validatorsAddress.should.be.equal(await finalContract.validatorContract()) }) }) diff --git a/test/erc_to_erc/home_bridge.test.js b/test/erc_to_erc/home_bridge.test.js index dafcbfdd9..0efc013ac 100644 --- a/test/erc_to_erc/home_bridge.test.js +++ b/test/erc_to_erc/home_bridge.test.js @@ -64,6 +64,16 @@ contract('HomeBridge_ERC20_to_ERC20', async (accounts) => { "2".should.be.bignumber.equal(await finalContract.maxPerTx()) "1".should.be.bignumber.equal(await finalContract.minPerTx()) }) + + it('cant initialize with invalid arguments', async () => { + false.should.be.equal(await homeContract.isInitialized()) + await homeContract.initialize(validatorContract.address, '3', '2', '1', 0, requireBlockConfirmations, token.address).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, 0, token.address).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(owner, '3', '2', '1', gasPrice, requireBlockConfirmations, token.address).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(ZERO_ADDRESS, '3', '2', '1', gasPrice, requireBlockConfirmations, token.address).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, token.address).should.be.fulfilled; + true.should.be.equal(await homeContract.isInitialized()) + }) }) describe('#fallback', async () => { diff --git a/test/erc_to_native/foreign_bridge.test.js b/test/erc_to_native/foreign_bridge.test.js index e7673ec33..dec602d9a 100644 --- a/test/erc_to_native/foreign_bridge.test.js +++ b/test/erc_to_native/foreign_bridge.test.js @@ -30,6 +30,12 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { false.should.be.equal(await foreignBridge.isInitialized()) '0'.should.be.bignumber.equal(await foreignBridge.requiredBlockConfirmations()) + await foreignBridge.initialize(ZERO_ADDRESS, token.address, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, ZERO_ADDRESS, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, token.address, 0, gasPrice).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, 0).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(owner, token.address, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); token.address.should.be.equal(await foreignBridge.erc20token()); @@ -226,17 +232,17 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { it('can be deployed via upgradeToAndCall', async () => { const fakeTokenAddress = accounts[7] - const fakeValidatorsAddress = accounts[6] + const validatorsAddress = validatorContract.address const storageProxy = await EternalStorageProxy.new().should.be.fulfilled; const foreignBridge = await ForeignBridge.new(); - const data = foreignBridge.initialize.request(fakeValidatorsAddress, fakeTokenAddress, requireBlockConfirmations, gasPrice).params[0].data + const data = foreignBridge.initialize.request(validatorsAddress, fakeTokenAddress, requireBlockConfirmations, gasPrice).params[0].data await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; let finalContract = await ForeignBridge.at(storageProxy.address); true.should.be.equal(await finalContract.isInitialized()); - fakeValidatorsAddress.should.be.equal(await finalContract.validatorContract()) + validatorsAddress.should.be.equal(await finalContract.validatorContract()) }) }) diff --git a/test/erc_to_native/home_bridge.test.js b/test/erc_to_native/home_bridge.test.js index e6f20512b..8d92c2ed9 100644 --- a/test/erc_to_native/home_bridge.test.js +++ b/test/erc_to_native/home_bridge.test.js @@ -99,6 +99,15 @@ contract('HomeBridge_ERC20_to_Native', async (accounts) => { "2".should.be.bignumber.equal(await finalContract.maxPerTx()) "1".should.be.bignumber.equal(await finalContract.minPerTx()) }) + it('cant initialize with invalid arguments', async () => { + false.should.be.equal(await homeContract.isInitialized()) + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, 0, blockRewardContract.address).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(owner, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(ZERO_ADDRESS, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, owner).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, blockRewardContract.address).should.be.fulfilled; + true.should.be.equal(await homeContract.isInitialized()) + }) }) describe('#fallback', async () => { diff --git a/test/native_to_erc/foreign_bridge_test.js b/test/native_to_erc/foreign_bridge_test.js index 06156110c..19fcb46b9 100644 --- a/test/native_to_erc/foreign_bridge_test.js +++ b/test/native_to_erc/foreign_bridge_test.js @@ -46,6 +46,12 @@ contract('ForeignBridge', async (accounts) => { '0'.should.be.bignumber.equal(await foreignBridge.dailyLimit()) '0'.should.be.bignumber.equal(await foreignBridge.maxPerTx()) false.should.be.equal(await foreignBridge.isInitialized()) + + await foreignBridge.initialize(ZERO_ADDRESS, token.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, ZERO_ADDRESS, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, token.address, oneEther, halfEther, minPerTx, 0, requireBlockConfirmations).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(owner, token.address, oneEther, halfEther, minPerTx, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, token.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations); true.should.be.equal(await foreignBridge.isInitialized()) @@ -360,7 +366,7 @@ contract('ForeignBridge', async (accounts) => { }) it('can be deployed via upgradeToAndCall', async () => { const fakeTokenAddress = accounts[7] - const fakeValidatorsAddress = accounts[6] + const validatorsAddress = validatorContract.address const FOREIGN_DAILY_LIMIT = oneEther; const FOREIGN_MAX_AMOUNT_PER_TX = halfEther; const FOREIGN_MIN_AMOUNT_PER_TX = minPerTx; @@ -368,11 +374,11 @@ contract('ForeignBridge', async (accounts) => { let storageProxy = await EternalStorageProxy.new().should.be.fulfilled; let foreignBridge = await ForeignBridge.new(); let data = foreignBridge.initialize.request( - fakeValidatorsAddress, fakeTokenAddress, FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX, gasPrice, requireBlockConfirmations).params[0].data + validatorsAddress, fakeTokenAddress, FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX, gasPrice, requireBlockConfirmations).params[0].data await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; let finalContract = await ForeignBridge.at(storageProxy.address); true.should.be.equal(await finalContract.isInitialized()); - fakeValidatorsAddress.should.be.equal(await finalContract.validatorContract()) + validatorsAddress.should.be.equal(await finalContract.validatorContract()) FOREIGN_DAILY_LIMIT.should.be.bignumber.equal(await finalContract.dailyLimit()) FOREIGN_MAX_AMOUNT_PER_TX.should.be.bignumber.equal(await finalContract.maxPerTx()) FOREIGN_MIN_AMOUNT_PER_TX.should.be.bignumber.equal(await finalContract.minPerTx()) diff --git a/test/native_to_erc/home_bridge_test.js b/test/native_to_erc/home_bridge_test.js index f5c877e7c..6a2ba7436 100644 --- a/test/native_to_erc/home_bridge_test.js +++ b/test/native_to_erc/home_bridge_test.js @@ -62,6 +62,14 @@ contract('HomeBridge', async (accounts) => { "2".should.be.bignumber.equal(await finalContract.maxPerTx()) "1".should.be.bignumber.equal(await finalContract.minPerTx()) }) + it('cant initialize with invalid arguments', async () => { + false.should.be.equal(await homeContract.isInitialized()) + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, 0).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(owner, '3', '2', '1', gasPrice, requireBlockConfirmations).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(ZERO_ADDRESS, '3', '2', '1', gasPrice, requireBlockConfirmations).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations).should.be.fulfilled; + true.should.be.equal(await homeContract.isInitialized()) + }) }) describe('#fallback', async () => { From 629044e9b5f2586584a6b925b2ccb6a756d0a51d Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Wed, 24 Oct 2018 15:12:29 -0300 Subject: [PATCH 67/77] Check token address is contract --- contracts/upgradeable_contracts/ERC677Bridge.sol | 2 +- .../erc20_to_erc20/ForeignBridgeErcToErc.sol | 2 +- .../erc20_to_native/ForeignBridgeErcToNative.sol | 2 +- test/erc_to_erc/foreign_bridge.test.js | 5 +++-- test/erc_to_erc/home_bridge.test.js | 2 ++ test/erc_to_native/foreign_bridge.test.js | 5 +++-- test/native_to_erc/foreign_bridge_test.js | 6 +++--- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/contracts/upgradeable_contracts/ERC677Bridge.sol b/contracts/upgradeable_contracts/ERC677Bridge.sol index 7b9c1dfa3..8206e6669 100644 --- a/contracts/upgradeable_contracts/ERC677Bridge.sol +++ b/contracts/upgradeable_contracts/ERC677Bridge.sol @@ -10,7 +10,7 @@ contract ERC677Bridge is BasicBridge { } function setErc677token(address _token) internal { - require(_token != address(0)); + require(_token != address(0) && isContract(_token)); addressStorage[keccak256(abi.encodePacked("erc677token"))] = _token; } diff --git a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol index 23d8a42a2..92f3547c5 100644 --- a/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol +++ b/contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol @@ -49,7 +49,7 @@ contract ForeignBridgeErcToErc is BasicBridge, BasicForeignBridge { } function setErc20token(address _token) private { - require(_token != address(0)); + require(_token != address(0) && isContract(_token)); addressStorage[keccak256(abi.encodePacked("erc20token"))] = _token; } } diff --git a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol index ab86718fd..1653c37f4 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol @@ -48,7 +48,7 @@ contract ForeignBridgeErcToNative is BasicBridge, BasicForeignBridge { } function setErc20token(address _token) private { - require(_token != address(0)); + require(_token != address(0) && isContract(_token)); addressStorage[keccak256(abi.encodePacked("erc20token"))] = _token; } } diff --git a/test/erc_to_erc/foreign_bridge.test.js b/test/erc_to_erc/foreign_bridge.test.js index c5c2fc03a..7127a1ea6 100644 --- a/test/erc_to_erc/foreign_bridge.test.js +++ b/test/erc_to_erc/foreign_bridge.test.js @@ -34,6 +34,7 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { await foreignBridge.initialize(ZERO_ADDRESS, token.address, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, ZERO_ADDRESS, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, owner, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, 0, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, 0).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(owner, token.address, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); @@ -217,13 +218,13 @@ contract('ForeignBridge_ERC20_to_ERC20', async (accounts) => { (await foreignBridgeV2Proxy.something()).should.be.equal(accounts[2]) }) it('can be deployed via upgradeToAndCall', async () => { - const fakeTokenAddress = accounts[7] + const tokenAddress = token.address const validatorsAddress = validatorContract.address let storageProxy = await EternalStorageProxy.new().should.be.fulfilled; let foreignBridge = await ForeignBridge.new(); let data = foreignBridge.initialize.request( - validatorsAddress, fakeTokenAddress, requireBlockConfirmations, gasPrice).params[0].data + validatorsAddress, tokenAddress, requireBlockConfirmations, gasPrice).params[0].data await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; let finalContract = await ForeignBridge.at(storageProxy.address); true.should.be.equal(await finalContract.isInitialized()); diff --git a/test/erc_to_erc/home_bridge.test.js b/test/erc_to_erc/home_bridge.test.js index 0efc013ac..3933070ce 100644 --- a/test/erc_to_erc/home_bridge.test.js +++ b/test/erc_to_erc/home_bridge.test.js @@ -71,6 +71,8 @@ contract('HomeBridge_ERC20_to_ERC20', async (accounts) => { await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, 0, token.address).should.be.rejectedWith(ERROR_MSG); await homeContract.initialize(owner, '3', '2', '1', gasPrice, requireBlockConfirmations, token.address).should.be.rejectedWith(ERROR_MSG); await homeContract.initialize(ZERO_ADDRESS, '3', '2', '1', gasPrice, requireBlockConfirmations, token.address).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, ZERO_ADDRESS).should.be.rejectedWith(ERROR_MSG); + await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, owner).should.be.rejectedWith(ERROR_MSG); await homeContract.initialize(validatorContract.address, '3', '2', '1', gasPrice, requireBlockConfirmations, token.address).should.be.fulfilled; true.should.be.equal(await homeContract.isInitialized()) }) diff --git a/test/erc_to_native/foreign_bridge.test.js b/test/erc_to_native/foreign_bridge.test.js index dec602d9a..f58abf829 100644 --- a/test/erc_to_native/foreign_bridge.test.js +++ b/test/erc_to_native/foreign_bridge.test.js @@ -34,6 +34,7 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { await foreignBridge.initialize(validatorContract.address, ZERO_ADDRESS, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, 0, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, 0).should.be.rejectedWith(ERROR_MSG); + await foreignBridge.initialize(validatorContract.address, owner, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(owner, token.address, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, requireBlockConfirmations, gasPrice); @@ -231,12 +232,12 @@ contract('ForeignBridge_ERC20_to_Native', async (accounts) => { }) it('can be deployed via upgradeToAndCall', async () => { - const fakeTokenAddress = accounts[7] + const tokenAddress = token.address const validatorsAddress = validatorContract.address const storageProxy = await EternalStorageProxy.new().should.be.fulfilled; const foreignBridge = await ForeignBridge.new(); - const data = foreignBridge.initialize.request(validatorsAddress, fakeTokenAddress, requireBlockConfirmations, gasPrice).params[0].data + const data = foreignBridge.initialize.request(validatorsAddress, tokenAddress, requireBlockConfirmations, gasPrice).params[0].data await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; diff --git a/test/native_to_erc/foreign_bridge_test.js b/test/native_to_erc/foreign_bridge_test.js index 19fcb46b9..cec00caf2 100644 --- a/test/native_to_erc/foreign_bridge_test.js +++ b/test/native_to_erc/foreign_bridge_test.js @@ -51,7 +51,7 @@ contract('ForeignBridge', async (accounts) => { await foreignBridge.initialize(validatorContract.address, ZERO_ADDRESS, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, oneEther, halfEther, minPerTx, 0, requireBlockConfirmations).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(owner, token.address, oneEther, halfEther, minPerTx, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); - + await foreignBridge.initialize(validatorContract.address, owner, oneEther, halfEther, minPerTx, requireBlockConfirmations, gasPrice).should.be.rejectedWith(ERROR_MSG); await foreignBridge.initialize(validatorContract.address, token.address, oneEther, halfEther, minPerTx, gasPrice, requireBlockConfirmations); true.should.be.equal(await foreignBridge.isInitialized()) @@ -365,7 +365,7 @@ contract('ForeignBridge', async (accounts) => { await token.transferOwnership(foreignBridgeProxy.address, {from: accounts[2]}).should.be.fulfilled; }) it('can be deployed via upgradeToAndCall', async () => { - const fakeTokenAddress = accounts[7] + const tokenAddress = token.address const validatorsAddress = validatorContract.address const FOREIGN_DAILY_LIMIT = oneEther; const FOREIGN_MAX_AMOUNT_PER_TX = halfEther; @@ -374,7 +374,7 @@ contract('ForeignBridge', async (accounts) => { let storageProxy = await EternalStorageProxy.new().should.be.fulfilled; let foreignBridge = await ForeignBridge.new(); let data = foreignBridge.initialize.request( - validatorsAddress, fakeTokenAddress, FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX, gasPrice, requireBlockConfirmations).params[0].data + validatorsAddress, tokenAddress, FOREIGN_DAILY_LIMIT, FOREIGN_MAX_AMOUNT_PER_TX, FOREIGN_MIN_AMOUNT_PER_TX, gasPrice, requireBlockConfirmations).params[0].data await storageProxy.upgradeToAndCall('1', foreignBridge.address, data).should.be.fulfilled; let finalContract = await ForeignBridge.at(storageProxy.address); true.should.be.equal(await finalContract.isInitialized()); From 3afe1a9767059fc5514bbf0cc8891ab563ff99a6 Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Tue, 30 Oct 2018 18:42:05 +0300 Subject: [PATCH 68/77] A docker environment initialization --- .dockerignore | 9 +++++++++ Dockerfile | 17 +++++++++++++++++ README.md | 27 +++++++++++++++++++++++---- docker-compose.yml | 6 ++++++ 4 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..40d41b2d4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +node_modules +deploy/node_modules +.git +.dockerignore +deploy/.env +docker-compose.yml +Dockerfile +*.log +flats diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..476323109 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:8 + +WORKDIR /contracts + +COPY package.json . +COPY package-lock.json . +RUN npm install + +COPY ./deploy/package.json ./deploy/ +COPY ./deploy/package-lock.json ./deploy/ +RUN cd ./deploy; npm install; cd .. + +COPY . . +RUN npm run compile +RUN bash flatten.sh + +ENV PATH="/contracts/:${PATH}" diff --git a/README.md b/README.md index b3b114c49..356afc093 100644 --- a/README.md +++ b/README.md @@ -50,22 +50,41 @@ Responsibilities and roles of the bridge: ## Usage -### Install Dependencies +There are two ways to deploy contracts: one option is to install and use NodeJS directly on the system, +another way is for those systems where it is more preferable to use NodeJS in the docker environment. + +### Deployment with NodeJS + +#### Install Dependencies ```bash npm install ``` -### Deploy +#### Deploy Please the [README.md](deploy/README.md) in the `deploy` folder for instructions and .env file configuration -### Test +#### Test ```bash npm test ``` -### Flatten +#### Flatten +The flatten contracts can be used to verify code of contracts in a block explorer like BlockScout or Etherscan. +The following command will prepare flattened version of the contracts: + ```bash npm run flatten ``` +The flattened contracts can be found in the `flats` directory. + +### Usage of Docker +[Docker](https://www.docker.com/community-edition) and [Docker Compose](https://docs.docker.com/compose/install/) could be used to deploy contracts without NodeJS installation on the system. +f you are on Linux, it's also recommended that you [create a docker group and add your user to it](https://docs.docker.com/install/linux/linux-postinstall/), so that you can use the CLI without `sudo`. + +#### Prepare the docker container +```bash +docker-compose up --build +``` +_Note: The container must be rebuild every time when you change code of contracts or deployment script._ ### Gas Consumption See the [GAS_CONSUMPTION](GAS_CONSUMPTION.md) document to get a description of gas consumption. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..9c1e9ee14 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: "3.3" +services: + bridge-contracts: + build: . + command: "true" + env_file: ./deploy/.env From 7ae734d9669650a3a9faa5bccf3473fc74b3a498 Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Fri, 2 Nov 2018 22:35:13 +0300 Subject: [PATCH 69/77] added a script to simplify deployment by using Docker --- README.md | 43 +++++++++++++++++++++++-- deploy.sh | 38 ++++++++++++++++++++++ deploy/src/utils/deployERC20Token.js | 48 ++++++++++++++++++++++++++++ deploy/testenv-deploy.js | 23 +++++++++++++ 4 files changed, 150 insertions(+), 2 deletions(-) create mode 100755 deploy.sh create mode 100644 deploy/src/utils/deployERC20Token.js create mode 100644 deploy/testenv-deploy.js diff --git a/README.md b/README.md index 356afc093..434732839 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ npm run flatten ``` The flattened contracts can be found in the `flats` directory. -### Usage of Docker +### Deployment in the Docker environment [Docker](https://www.docker.com/community-edition) and [Docker Compose](https://docs.docker.com/compose/install/) could be used to deploy contracts without NodeJS installation on the system. f you are on Linux, it's also recommended that you [create a docker group and add your user to it](https://docs.docker.com/install/linux/linux-postinstall/), so that you can use the CLI without `sudo`. @@ -84,11 +84,50 @@ f you are on Linux, it's also recommended that you [create a docker group and ad ```bash docker-compose up --build ``` -_Note: The container must be rebuild every time when you change code of contracts or deployment script._ +_Note: The container must be rebuild every time when you change the code of contracts or the deployment scripts._ + +#### Deploy the contracts +1. Create the `.env` file in the `deploy` directory as it is described in deployment [README.md](deploy/README.md). +2. Run deployment process by + ```bash + docker-compose run bridge-contracts deploy.sh + ``` + or (in case of Linux system) + ```bash + ./deploy.sh + ``` + +#### Copy flatten sources (if it is needed) +1. Discover the container name by + ```bash + docker-compose images bridge-contracts + ``` +2. Use contaner name in the following comand to copy flatten sources to the current workin directory. Sources will be located in the `flats` directory. + ```bash + docker cp name-of-your-container:/contracts/flats ./ + ``` + +#### Shutdown the container +If the container is not needed any more it could be shutdown by the command + +```bash +docker-compose down +``` ### Gas Consumption See the [GAS_CONSUMPTION](GAS_CONSUMPTION.md) document to get a description of gas consumption. +### Testing environment +In order to test the bridge scripts working in `ERC20-to-ERC20` mode in testnet like Sokol or Kovan, it is required to deploy an ERC20 token to +the Foreign network. This can be done by running the following command: +```bash +cd deploy +node testenv-deploy.js token +``` +or in case of usage of Docker environment +```bash +./deploy.sh token +``` ## Contributing diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 000000000..9477e930d --- /dev/null +++ b/deploy.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +if [ -f /.dockerenv ]; then + # the script is run within the container + cd deploy + + if [ "$1" == "token" ]; then + echo "Deployment of token for testing environment started" + node testenv-deploy.js token + else + echo "Bridge contract deployment started" + node deploy.js + if [ -f bridgeDeploymentResults.json ]; then + cat bridgeDeploymentResults.json + echo + fi + fi + exit 0 +fi + +which docker-compose > /dev/null +if [ "$?" == "1" ]; then + echo "docker-compose is needed to use this type of deployment" + exit 1 +fi + +if [ ! -f ./deploy/.env ]; then + echo "The .env file not found in the 'deploy' directory" + exit 3 +fi + +docker-compose images bridge-contracts >/dev/null 2>/dev/null +if [ "$?" == "1" ]; then + echo "Docker image 'bridge-contracts' not found" + exit 2 +fi + +docker-compose run bridge-contracts deploy.sh "$@" diff --git a/deploy/src/utils/deployERC20Token.js b/deploy/src/utils/deployERC20Token.js new file mode 100644 index 000000000..4e2f73095 --- /dev/null +++ b/deploy/src/utils/deployERC20Token.js @@ -0,0 +1,48 @@ +const assert = require('assert') +const Web3Utils = require('web3-utils') +const env = require('../loadEnv') + +const { deployContract, privateKeyToAddress, sendRawTxForeign } = require('../deploymentUtils') +const { web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL } = require('../web3') + +const ERC677BridgeToken = require('../../../build/contracts/ERC677BridgeToken.json') + +const { + DEPLOYMENT_ACCOUNT_PRIVATE_KEY, + BRIDGEABLE_TOKEN_NAME, + BRIDGEABLE_TOKEN_SYMBOL, + BRIDGEABLE_TOKEN_DECIMALS +} = env + +const DEPLOYMENT_ACCOUNT_ADDRESS = privateKeyToAddress(DEPLOYMENT_ACCOUNT_PRIVATE_KEY) + +async function deployToken() { + let foreignNonce = await web3Foreign.eth.getTransactionCount(DEPLOYMENT_ACCOUNT_ADDRESS) + console.log('\n[Foreign] deploying ERC20 token') + const erc677token = await deployContract( + ERC677BridgeToken, + [BRIDGEABLE_TOKEN_NAME, BRIDGEABLE_TOKEN_SYMBOL, BRIDGEABLE_TOKEN_DECIMALS], + { from: DEPLOYMENT_ACCOUNT_ADDRESS, network: 'foreign', nonce: foreignNonce } + ) + foreignNonce++ + console.log('[Foreign] ERC20 Token: ', erc677token.options.address) + + console.log('[Foreign] minting 100 tokens and transfer them to ', DEPLOYMENT_ACCOUNT_ADDRESS) + const mintData = await erc677token.methods + .mint(DEPLOYMENT_ACCOUNT_ADDRESS, '100000000000000000000') + .encodeABI({ from: DEPLOYMENT_ACCOUNT_ADDRESS }) + const txMint = await sendRawTxForeign({ + data: mintData, + nonce: foreignNonce, + to: erc677token.options.address, + privateKey: deploymentPrivateKey, + url: FOREIGN_RPC_URL + }) + assert.equal(Web3Utils.hexToNumber(txMint.status), 1, 'Transaction Failed') + + console.log('\nToken deployment is completed\n') + return { + erc677tokenAddress: erc677token.options.address, + } +} +module.exports = deployToken diff --git a/deploy/testenv-deploy.js b/deploy/testenv-deploy.js new file mode 100644 index 000000000..e0368f348 --- /dev/null +++ b/deploy/testenv-deploy.js @@ -0,0 +1,23 @@ +const env = require('./src/loadEnv') + +const deployToken = require('./src/utils/deployERC20Token') + +const mode = process.argv[2] + +async function main() { + //If other components of testing env needs to be initialized + //the script must be modified to handle the corresponding + //component through 'switch-case + switch(mode) { + case 'token': + const token = await deployToken() + break + case 'block-reward': + console.log('The mode "block-reward" is not implemented yet.') + break + default: + console.log('Use either "token" or "block-reward" as the parameter') + } +} + +main().catch(e => console.log('Error:', e)) From bce5ff3db7633c85298bbb6623ac8cc6475396bc Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Fri, 2 Nov 2018 22:45:42 +0300 Subject: [PATCH 70/77] fixed comments raised on the review --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 434732839..d65cc931f 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,9 @@ Responsibilities and roles of the bridge: ## Usage -There are two ways to deploy contracts: one option is to install and use NodeJS directly on the system, -another way is for those systems where it is more preferable to use NodeJS in the docker environment. +There are two ways to deploy contracts: +* install and use NodeJS +* use Docker to deploy ### Deployment with NodeJS @@ -68,7 +69,7 @@ npm test ``` #### Flatten -The flatten contracts can be used to verify code of contracts in a block explorer like BlockScout or Etherscan. +Fattened contracts can be used to verify the contract code in a block explorer like BlockScout or Etherscan. The following command will prepare flattened version of the contracts: ```bash @@ -77,8 +78,8 @@ npm run flatten The flattened contracts can be found in the `flats` directory. ### Deployment in the Docker environment -[Docker](https://www.docker.com/community-edition) and [Docker Compose](https://docs.docker.com/compose/install/) could be used to deploy contracts without NodeJS installation on the system. -f you are on Linux, it's also recommended that you [create a docker group and add your user to it](https://docs.docker.com/install/linux/linux-postinstall/), so that you can use the CLI without `sudo`. +[Docker](https://www.docker.com/community-edition) and [Docker Compose](https://docs.docker.com/compose/install/) can be used to deploy contracts without NodeJS installed on the system. +If you are on Linux, we recommend you [create a docker group and add your user to it](https://docs.docker.com/install/linux/linux-postinstall/), so that you can use the CLI without `sudo`. #### Prepare the docker container ```bash @@ -115,7 +116,7 @@ docker-compose down ``` ### Gas Consumption -See the [GAS_CONSUMPTION](GAS_CONSUMPTION.md) document to get a description of gas consumption. +The [GAS_CONSUMPTION](GAS_CONSUMPTION.md) file includes Min, Max, and Avg gas consumption figures for contracts associated with each bridge mode. ### Testing environment In order to test the bridge scripts working in `ERC20-to-ERC20` mode in testnet like Sokol or Kovan, it is required to deploy an ERC20 token to From dbfd8f2676e777dd573aa544ba83174ac26d70f6 Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Fri, 2 Nov 2018 22:49:52 +0300 Subject: [PATCH 71/77] wording updates --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d65cc931f..67bd9a84d 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ docker-compose up --build _Note: The container must be rebuild every time when you change the code of contracts or the deployment scripts._ #### Deploy the contracts -1. Create the `.env` file in the `deploy` directory as it is described in deployment [README.md](deploy/README.md). +1. Create the `.env` file in the `deploy` directory as it is described in the deployment [README](deploy/README.md). 2. Run deployment process by ```bash docker-compose run bridge-contracts deploy.sh @@ -103,7 +103,7 @@ _Note: The container must be rebuild every time when you change the code of cont ```bash docker-compose images bridge-contracts ``` -2. Use contaner name in the following comand to copy flatten sources to the current workin directory. Sources will be located in the `flats` directory. +2. Use the contaner name in the following comand to copy the flattened code of the contracts to the current workin directory. The contracts will be located in the `flats` directory. ```bash docker cp name-of-your-container:/contracts/flats ./ ``` From fdce86c2b1b97dff219754fc5c5d3e9d6e57ff78 Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Fri, 2 Nov 2018 22:50:46 +0300 Subject: [PATCH 72/77] Typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67bd9a84d..415c215da 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ _Note: The container must be rebuild every time when you change the code of cont ```bash docker-compose images bridge-contracts ``` -2. Use the contaner name in the following comand to copy the flattened code of the contracts to the current workin directory. The contracts will be located in the `flats` directory. +2. Use the contaner name in the following comand to copy the flattened code of the contracts to the current working directory. The contracts will be located in the `flats` directory. ```bash docker cp name-of-your-container:/contracts/flats ./ ``` From 9404b8f105e5396c2ebbc56f55f0c3447290a08e Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Mon, 5 Nov 2018 20:16:27 +0300 Subject: [PATCH 73/77] Made format unification for bridgeDeploymentResults.json --- deploy/deploy.js | 22 +++++++++++----------- deploy/src/erc_to_erc/foreign.js | 1 + deploy/src/erc_to_erc/home.js | 10 ++++++---- deploy/src/erc_to_native/foreign.js | 1 + deploy/src/erc_to_native/home.js | 8 +++++--- deploy/src/native_to_erc/foreign.js | 1 + deploy/src/native_to_erc/home.js | 8 +++++--- 7 files changed, 30 insertions(+), 21 deletions(-) diff --git a/deploy/deploy.js b/deploy/deploy.js index 76a76aff4..d953aef58 100644 --- a/deploy/deploy.js +++ b/deploy/deploy.js @@ -11,7 +11,7 @@ async function deployNativeToErc() { const deployHome = require('./src/native_to_erc/home') const deployForeign = require('./src/native_to_erc/foreign') - const homeBridge = await deployHome() + const { homeBridge } = await deployHome() const { foreignBridge, erc677 } = await deployForeign() console.log('\nDeployment has been completed.\n\n') console.log( @@ -22,7 +22,7 @@ async function deployNativeToErc() { foreignBridge.deployedBlockNumber }` ) - console.log(`[ Foreign ] POA20: ${erc677.address}`) + console.log(`[ Foreign ] ERC677 Bridgeable Token: ${erc677.address}`) fs.writeFileSync( deployResultsPath, JSON.stringify( @@ -31,9 +31,9 @@ async function deployNativeToErc() { ...homeBridge }, foreignBridge: { - ...foreignBridge + ...foreignBridge, + erc677 }, - erc677 }, null, 4 @@ -46,24 +46,24 @@ async function deployErcToErc() { const deployHome = require('./src/erc_to_erc/home') const deployForeign = require('./src/erc_to_erc/foreign') - const { homeBridgeAddress, erc677tokenAddress, deployedBlockNumber } = await deployHome() + const { homeBridge, erc677 } = await deployHome() const { foreignBridge } = await deployForeign() console.log('\nDeployment has been completed.\n\n') - console.log(`[ Home ] HomeBridge: ${homeBridgeAddress} at block ${deployedBlockNumber}`) + console.log(`[ Home ] HomeBridge: ${homeBridge.address} at block ${homeBridge.deployedBlockNumber}`) + console.log(`[ Home ] ERC677 Bridgeable Token: ${erc677.address}`) console.log( `[ Foreign ] ForeignBridge: ${foreignBridge.address} at block ${ foreignBridge.deployedBlockNumber }` ) console.log(`[ Foreign ] ERC20 Token: ${ERC20_TOKEN_ADDRESS}`) - console.log(`[ Home ] ERC677 Bridgeble Token: ${erc677tokenAddress}`) fs.writeFileSync( deployResultsPath, JSON.stringify( { homeBridge: { - homeBridgeAddress, - erc677tokenAddress + ...homeBridge, + erc677 }, foreignBridge: { ...foreignBridge @@ -80,11 +80,11 @@ async function deployErcToNative() { const deployHome = require('./src/erc_to_native/home') const deployForeign = require('./src/erc_to_native/foreign') - const homeBridge = await deployHome() + const { homeBridge } = await deployHome() const { foreignBridge } = await deployForeign() console.log('\nDeployment has been completed.\n\n') console.log( - `[ Home ] HomeBridge: ${homeBridge.homeBridgeAddress} at block ${ + `[ Home ] HomeBridge: ${homeBridge.address} at block ${ homeBridge.deployedBlockNumber }` ) diff --git a/deploy/src/erc_to_erc/foreign.js b/deploy/src/erc_to_erc/foreign.js index 9127d5f1e..64cde02dc 100644 --- a/deploy/src/erc_to_erc/foreign.js +++ b/deploy/src/erc_to_erc/foreign.js @@ -170,6 +170,7 @@ async function deployForeign() { assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed') foreignNonce++ + console.log('\nForeign Deployment Bridge completed\n') return { foreignBridge: { address: foreignBridgeStorage.options.address, diff --git a/deploy/src/erc_to_erc/home.js b/deploy/src/erc_to_erc/home.js index db8a040ff..9d2691fb2 100644 --- a/deploy/src/erc_to_erc/home.js +++ b/deploy/src/erc_to_erc/home.js @@ -208,11 +208,13 @@ async function deployHome() { assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed') homeNonce++ - console.log('\nHome Deployment Bridge is complete\n') + console.log('\nHome Deployment Bridge completed\n') return { - homeBridgeAddress: homeBridgeStorage.options.address, - erc677tokenAddress: erc677token.options.address, - deployedBlockNumber: Web3Utils.hexToNumber(homeBridgeStorage.deployedBlockNumber) + homeBridge: { + address: homeBridgeStorage.options.address, + deployedBlockNumber: Web3Utils.hexToNumber(homeBridgeStorage.deployedBlockNumber) + }, + erc677: { address: erc677token.options.address } } } module.exports = deployHome diff --git a/deploy/src/erc_to_native/foreign.js b/deploy/src/erc_to_native/foreign.js index b7bc4d203..fa7983ab1 100644 --- a/deploy/src/erc_to_native/foreign.js +++ b/deploy/src/erc_to_native/foreign.js @@ -170,6 +170,7 @@ async function deployForeign() { assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed') foreignNonce++ + console.log('\nForeign Deployment Bridge completed\n') return { foreignBridge: { address: foreignBridgeStorage.options.address, diff --git a/deploy/src/erc_to_native/home.js b/deploy/src/erc_to_native/home.js index 2c08abbb6..a9316a7e1 100644 --- a/deploy/src/erc_to_native/home.js +++ b/deploy/src/erc_to_native/home.js @@ -167,10 +167,12 @@ async function deployHome() { assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed') homeNonce++ - console.log('\nHome Deployment Bridge is complete\n') + console.log('\nHome Deployment Bridge completed\n') return { - homeBridgeAddress: homeBridgeStorage.options.address, - deployedBlockNumber: Web3Utils.hexToNumber(homeBridgeStorage.deployedBlockNumber) + homeBridge: { + address: homeBridgeStorage.options.address, + deployedBlockNumber: Web3Utils.hexToNumber(homeBridgeStorage.deployedBlockNumber) + } } } module.exports = deployHome diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index 52d1cfc7b..2dcb914c0 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -222,6 +222,7 @@ async function deployForeign() { assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed') foreignNonce++ + console.log('\nForeign Deployment Bridge completed\n') return { foreignBridge: { address: foreignBridgeStorage.options.address, diff --git a/deploy/src/native_to_erc/home.js b/deploy/src/native_to_erc/home.js index fa524f5e3..4b94fd8ce 100644 --- a/deploy/src/native_to_erc/home.js +++ b/deploy/src/native_to_erc/home.js @@ -166,10 +166,12 @@ async function deployHome() { assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed') homeNonce++ - console.log('\nHome Deployment Bridge is complete\n') + console.log('\nHome Deployment Bridge completed\n') return { - address: homeBridgeStorage.options.address, - deployedBlockNumber: Web3Utils.hexToNumber(homeBridgeStorage.deployedBlockNumber) + homeBridge: { + address: homeBridgeStorage.options.address, + deployedBlockNumber: Web3Utils.hexToNumber(homeBridgeStorage.deployedBlockNumber) + } } } module.exports = deployHome From f464c1b5445cf72a08d7d5c419ec9aa06c5dfd72 Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Mon, 5 Nov 2018 21:10:50 +0300 Subject: [PATCH 74/77] Fixed comments raised on the code review --- README.md | 23 +++++++++++------------ deploy/testenv-deploy.js | 3 --- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d65cc931f..3c77a4518 100644 --- a/README.md +++ b/README.md @@ -85,32 +85,31 @@ If you are on Linux, we recommend you [create a docker group and add your user t ```bash docker-compose up --build ``` -_Note: The container must be rebuild every time when you change the code of contracts or the deployment scripts._ +_Note: The container must be rebuilt every time the code in a contract or deployment script is changed._ #### Deploy the contracts -1. Create the `.env` file in the `deploy` directory as it is described in deployment [README.md](deploy/README.md). -2. Run deployment process by +1. Create the `.env` file in the `deploy` directory as described in deployment [README.md](deploy/README.md). +2. Run deployment process: ```bash docker-compose run bridge-contracts deploy.sh ``` - or (in case of Linux system) + or with Linux: ```bash ./deploy.sh ``` -#### Copy flatten sources (if it is needed) -1. Discover the container name by +#### Copy flatten sources (if needed) +1. Discover the container name: ```bash docker-compose images bridge-contracts ``` -2. Use contaner name in the following comand to copy flatten sources to the current workin directory. Sources will be located in the `flats` directory. +2. In the following command, use the container name to copy the flattened contracts code to the current working directory. The contracts will be located in the `flats` directory. ```bash docker cp name-of-your-container:/contracts/flats ./ ``` #### Shutdown the container -If the container is not needed any more it could be shutdown by the command - +If the container is no longer needed, it can be shutdown: ```bash docker-compose down ``` @@ -119,13 +118,13 @@ docker-compose down The [GAS_CONSUMPTION](GAS_CONSUMPTION.md) file includes Min, Max, and Avg gas consumption figures for contracts associated with each bridge mode. ### Testing environment -In order to test the bridge scripts working in `ERC20-to-ERC20` mode in testnet like Sokol or Kovan, it is required to deploy an ERC20 token to -the Foreign network. This can be done by running the following command: +To test the bridge scripts in ERC20-to-ERC20 mode on a testnet like Sokol or Kovan, you must deploy an ERC20 token to the foreign network. +This can be done by running the following command: ```bash cd deploy node testenv-deploy.js token ``` -or in case of usage of Docker environment +or with Docker: ```bash ./deploy.sh token ``` diff --git a/deploy/testenv-deploy.js b/deploy/testenv-deploy.js index e0368f348..2d27c9530 100644 --- a/deploy/testenv-deploy.js +++ b/deploy/testenv-deploy.js @@ -5,9 +5,6 @@ const deployToken = require('./src/utils/deployERC20Token') const mode = process.argv[2] async function main() { - //If other components of testing env needs to be initialized - //the script must be modified to handle the corresponding - //component through 'switch-case switch(mode) { case 'token': const token = await deployToken() From 8533008ed6ce40b65aa98f6a85596b746c02a768 Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Tue, 6 Nov 2018 01:22:42 +0300 Subject: [PATCH 75/77] Modified the way to check the status of transactions --- deploy/.env.example.swp | Bin 12288 -> 0 bytes deploy/src/erc_to_erc/foreign.js | 12 ++++++------ deploy/src/erc_to_erc/home.js | 16 ++++++++-------- deploy/src/erc_to_native/foreign.js | 12 ++++++------ deploy/src/erc_to_native/home.js | 12 ++++++------ deploy/src/native_to_erc/foreign.js | 16 ++++++++-------- deploy/src/native_to_erc/home.js | 12 ++++++------ 7 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 deploy/.env.example.swp diff --git a/deploy/.env.example.swp b/deploy/.env.example.swp deleted file mode 100644 index 35fb64f131cde4021d7f1f7776b7a4371e82976a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2J#W)M7{{*+NC*lDrY^|1ups5FEwn;1l4D=PDSioOJ2YZArHv_7(wvnTS{UF1 z@CiU{3?MP`Jz(HvC^HfRUjSHmY^Q0O(9#w3Soz7x-QVZCpYH}Mw_2<-TUpF65ID{f zQvLPvPV@K$@^yxgwrqBi;=dh9F4t*Bv5XFlK2Cy#^^G{!3nSSt)Of!T$!2b~x6xV; zb8E62_nK>Qzt9S!j(k|ihusJHaJ#t~b;3g%#!57R29980n#|9Yib-%*y{Mc&7aZXl zjGzHDfCkV28bAYR01co4H1NL|h@&a;1O{_#FrdqW^VHaR@DopH01co4G=K)s02)98 zXaEhM0W^RH(7-=vpxGki(n&%-0?GgXyYK(s&Jgkrcnv%S`TzrN0yDtR(}a8hc7V6Q z3t$VV16P0_(}cVS-T=>mXMh9(AP1ZPc1{uU3U~x~zzskJrh!wycj(h+;M1UgACf-e zfd#JyGM#pc?Eh+$|j5 zu57tRRT!?b%($)l%ym3%X&AE^+{|_Z#}_r|l)s`~Esh_1VSQyRyf~RouO41v>da~g zi`mTAN(Y3Cd%X^76|S39FIyBGB%LdBW>%zhYDa#zmXxh9zq4PjPS<|C3 z=f|JY@OPG-w6te3z58Tfzs58)=`bxmg23!<>4VIsv`GzS>lUnu(vnIhs=bC?b}dcy zsptQp+R<&QsSSC*r#Ru3QcgFmw-jHt!>&q5h5CY1gR+`0nB!9pV}UQiW|qY~3bWtz zv_u&(Y0YvQHiZelZ{3WQXESyolRA2lZW!5W;jFIvR8(n0ySA9mmlg(N61Hnn&4HCx Tr?8p@ENe2G4L7TTg5C1pyt8K3 diff --git a/deploy/src/erc_to_erc/foreign.js b/deploy/src/erc_to_erc/foreign.js index 64cde02dc..9aa2a8fec 100644 --- a/deploy/src/erc_to_erc/foreign.js +++ b/deploy/src/erc_to_erc/foreign.js @@ -65,7 +65,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txUpgradeToBridgeVForeign.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToBridgeVForeign.status), 1, 'Transaction Failed') foreignNonce++ console.log('\ninitializing Foreign Bridge Validators with following parameters:\n') @@ -83,7 +83,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txInitializeForeign.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitializeForeign.status), 1, 'Transaction Failed') foreignNonce++ console.log('\nTransferring ownership of ValidatorsProxy\n') @@ -97,7 +97,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txValidatorsForeignOwnershipData.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txValidatorsForeignOwnershipData.status), 1, 'Transaction Failed') foreignNonce++ console.log('\ndeploying foreignBridge storage\n') @@ -132,7 +132,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txUpgradeToForeignBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToForeignBridge.status), 1, 'Transaction Failed') foreignNonce++ console.log('\ninitializing Foreign Bridge with following parameters:\n') @@ -154,7 +154,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txInitializeBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitializeBridge.status), 1, 'Transaction Failed') foreignNonce++ const bridgeOwnershipData = await foreignBridgeStorage.methods @@ -167,7 +167,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txBridgeOwnershipData.status), 1, 'Transaction Failed') foreignNonce++ console.log('\nForeign Deployment Bridge completed\n') diff --git a/deploy/src/erc_to_erc/home.js b/deploy/src/erc_to_erc/home.js index 9d2691fb2..96fe54852 100644 --- a/deploy/src/erc_to_erc/home.js +++ b/deploy/src/erc_to_erc/home.js @@ -59,7 +59,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToBridgeVHome.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToBridgeVHome.status), 1, 'Transaction Failed') homeNonce++ console.log('\ninitializing Home Bridge Validators with following parameters:\n') @@ -77,7 +77,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txInitialize.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitialize.status), 1, 'Transaction Failed') homeNonce++ console.log('transferring proxy ownership to multisig for Validators Proxy contract') @@ -91,7 +91,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txProxyDataTransfer.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txProxyDataTransfer.status), 1, 'Transaction Failed') homeNonce++ console.log('\ndeploying homeBridge storage\n') @@ -121,7 +121,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToHomeBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToHomeBridge.status), 1, 'Transaction Failed') homeNonce++ console.log('\n[Home] deploying Bridgeble token') @@ -144,7 +144,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(setBridgeContract.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(setBridgeContract.status), 1, 'Transaction Failed') homeNonce++ console.log('transferring ownership of Bridgeble token to homeBridge contract') @@ -158,7 +158,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txOwnership.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txOwnership.status), 1, 'Transaction Failed') homeNonce++ console.log('\ninitializing Home Bridge with following parameters:\n') @@ -191,7 +191,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txInitializeHomeBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitializeHomeBridge.status), 1, 'Transaction Failed') homeNonce++ console.log('transferring proxy ownership to multisig for Home bridge Proxy contract') @@ -205,7 +205,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txhomeBridgeProxyData.status), 1, 'Transaction Failed') homeNonce++ console.log('\nHome Deployment Bridge completed\n') diff --git a/deploy/src/erc_to_native/foreign.js b/deploy/src/erc_to_native/foreign.js index fa7983ab1..9112b404a 100644 --- a/deploy/src/erc_to_native/foreign.js +++ b/deploy/src/erc_to_native/foreign.js @@ -65,7 +65,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txUpgradeToBridgeVForeign.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToBridgeVForeign.status), 1, 'Transaction Failed') foreignNonce++ console.log('\ninitializing Foreign Bridge Validators with following parameters:\n') @@ -83,7 +83,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txInitializeForeign.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitializeForeign.status), 1, 'Transaction Failed') foreignNonce++ console.log('\nTransferring ownership of ValidatorsProxy\n') @@ -97,7 +97,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txValidatorsForeignOwnershipData.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txValidatorsForeignOwnershipData.status), 1, 'Transaction Failed') foreignNonce++ console.log('\ndeploying foreignBridge storage\n') @@ -132,7 +132,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txUpgradeToForeignBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToForeignBridge.status), 1, 'Transaction Failed') foreignNonce++ console.log('\ninitializing Foreign Bridge with following parameters:\n') @@ -154,7 +154,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txInitializeBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitializeBridge.status), 1, 'Transaction Failed') foreignNonce++ const bridgeOwnershipData = await foreignBridgeStorage.methods @@ -167,7 +167,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txBridgeOwnershipData.status), 1, 'Transaction Failed') foreignNonce++ console.log('\nForeign Deployment Bridge completed\n') diff --git a/deploy/src/erc_to_native/home.js b/deploy/src/erc_to_native/home.js index a9316a7e1..554d5fa37 100644 --- a/deploy/src/erc_to_native/home.js +++ b/deploy/src/erc_to_native/home.js @@ -56,7 +56,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToBridgeVHome.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToBridgeVHome.status), 1, 'Transaction Failed') homeNonce++ console.log('\ninitializing Home Bridge Validators with following parameters:\n') @@ -74,7 +74,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txInitialize.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitialize.status), 1, 'Transaction Failed') homeNonce++ console.log('transferring proxy ownership to multisig for Validators Proxy contract') @@ -88,7 +88,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txProxyDataTransfer.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txProxyDataTransfer.status), 1, 'Transaction Failed') homeNonce++ console.log('\ndeploying homeBridge storage\n') @@ -118,7 +118,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToHomeBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToHomeBridge.status), 1, 'Transaction Failed') homeNonce++ console.log('\ninitializing Home Bridge with following parameters:\n') @@ -150,7 +150,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txInitializeHomeBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitializeHomeBridge.status), 1, 'Transaction Failed') homeNonce++ console.log('transferring proxy ownership to multisig for Home bridge Proxy contract') @@ -164,7 +164,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txhomeBridgeProxyData.status), 1, 'Transaction Failed') homeNonce++ console.log('\nHome Deployment Bridge completed\n') diff --git a/deploy/src/native_to_erc/foreign.js b/deploy/src/native_to_erc/foreign.js index 2dcb914c0..dfd1877d0 100644 --- a/deploy/src/native_to_erc/foreign.js +++ b/deploy/src/native_to_erc/foreign.js @@ -77,7 +77,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txUpgradeToBridgeVForeign.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToBridgeVForeign.status), 1, 'Transaction Failed') foreignNonce++ console.log('\ninitializing Foreign Bridge Validators with following parameters:\n') @@ -95,7 +95,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txInitializeForeign.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitializeForeign.status), 1, 'Transaction Failed') foreignNonce++ console.log('\nTransferring ownership of ValidatorsProxy\n') @@ -109,7 +109,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txValidatorsForeignOwnershipData.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txValidatorsForeignOwnershipData.status), 1, 'Transaction Failed') foreignNonce++ console.log('\ndeploying foreignBridge storage\n') @@ -144,7 +144,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txUpgradeToForeignBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToForeignBridge.status), 1, 'Transaction Failed') foreignNonce++ console.log('\ninitializing Foreign Bridge with following parameters:\n') @@ -178,7 +178,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txInitializeBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitializeBridge.status), 1, 'Transaction Failed') foreignNonce++ console.log('\nset bridge contract on ERC677BridgeToken') @@ -192,7 +192,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(setBridgeContract.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(setBridgeContract.status), 1, 'Transaction Failed') foreignNonce++ console.log('transferring ownership of ERC677BridgeToken token to foreignBridge contract') @@ -206,7 +206,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txOwnership.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txOwnership.status), 1, 'Transaction Failed') foreignNonce++ const bridgeOwnershipData = await foreignBridgeStorage.methods @@ -219,7 +219,7 @@ async function deployForeign() { privateKey: deploymentPrivateKey, url: FOREIGN_RPC_URL }) - assert.equal(txBridgeOwnershipData.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txBridgeOwnershipData.status), 1, 'Transaction Failed') foreignNonce++ console.log('\nForeign Deployment Bridge completed\n') diff --git a/deploy/src/native_to_erc/home.js b/deploy/src/native_to_erc/home.js index 4b94fd8ce..3d6bf828f 100644 --- a/deploy/src/native_to_erc/home.js +++ b/deploy/src/native_to_erc/home.js @@ -55,7 +55,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToBridgeVHome.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToBridgeVHome.status), 1, 'Transaction Failed') homeNonce++ console.log('\ninitializing Home Bridge Validators with following parameters:\n') @@ -73,7 +73,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txInitialize.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitialize.status), 1, 'Transaction Failed') homeNonce++ console.log('transferring proxy ownership to multisig for Validators Proxy contract') @@ -87,7 +87,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txProxyDataTransfer.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txProxyDataTransfer.status), 1, 'Transaction Failed') homeNonce++ console.log('\ndeploying homeBridge storage\n') @@ -117,7 +117,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txUpgradeToHomeBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txUpgradeToHomeBridge.status), 1, 'Transaction Failed') homeNonce++ console.log('\ninitializing Home Bridge with following parameters:\n') @@ -149,7 +149,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txInitializeHomeBridge.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txInitializeHomeBridge.status), 1, 'Transaction Failed') homeNonce++ console.log('transferring proxy ownership to multisig for Home bridge Proxy contract') @@ -163,7 +163,7 @@ async function deployHome() { privateKey: deploymentPrivateKey, url: HOME_RPC_URL }) - assert.equal(txhomeBridgeProxyData.status, '0x1', 'Transaction Failed') + assert.equal(Web3Utils.hexToNumber(txhomeBridgeProxyData.status), 1, 'Transaction Failed') homeNonce++ console.log('\nHome Deployment Bridge completed\n') From 917a11977548119818cf891467c9515b388d9851 Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Tue, 6 Nov 2018 01:26:54 +0300 Subject: [PATCH 76/77] Clarifications in README * Description for the parameters related to the gas price was updated * Ambiguity for unused parameters was eliminated --- deploy/README.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/deploy/README.md b/deploy/README.md index 74c2bff05..77c9051d0 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -186,7 +186,7 @@ HOME_MIN_AMOUNT_PER_TX=500000000000000000 # rolled back. HOME_REQUIRED_BLOCK_CONFIRMATIONS=1 # The default gas price (in Wei) used to send Home Network signature -# transactions for deposit or withdrawl confirmations. This price is used if +# transactions for deposit or withdrawal confirmations. This price is used if # the Gas price oracle is unreachable. HOME_GAS_PRICE=1000000000 @@ -203,9 +203,9 @@ FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS=0x FOREIGN_UPGRADEABLE_ADMIN_BRIDGE=0x # These three parameters are not used in this mode, but the deployment script # requires it to be set to some value. -FOREIGN_DAILY_LIMIT=15000000000000000000000000 -FOREIGN_MAX_AMOUNT_PER_TX=750000000000000000000000 -FOREIGN_MIN_AMOUNT_PER_TX=500000000000000000 +FOREIGN_DAILY_LIMIT=0 +FOREIGN_MAX_AMOUNT_PER_TX=0 +FOREIGN_MIN_AMOUNT_PER_TX=0 # The finalization threshold. The number of blocks issued after the block with # the corresponding deposit transaction to guarantee the transaction will not be # rolled back. @@ -244,10 +244,10 @@ DEPLOYMENT_ACCOUNT_PRIVATE_KEY=67..14 # The "gas" parameter set in every deployment/configuration transaction. DEPLOYMENT_GAS_LIMIT=4000000 # The "gasPrice" parameter set in every deployment/configuration transaction on -# home network. +# Home network (in Wei). HOME_DEPLOYMENT_GAS_PRICE=10000000000 # The "gasPrice" parameter set in every deployment/configuration transaction on -# foreign network. +# Foreign network (in Wei). FOREIGN_DEPLOYMENT_GAS_PRICE=10000000000 # The timeout limit to wait for receipt of the deployment/configuration # transaction. @@ -278,10 +278,10 @@ HOME_MIN_AMOUNT_PER_TX=500000000000000000 # the corresponding deposit transaction to guarantee the transaction will not be # rolled back. HOME_REQUIRED_BLOCK_CONFIRMATIONS=1 -# The default gas price used to send Home Network signature transactions for -# deposit or withdrawl confirmations. This price is used if the Gas price oracle -# is unreachable. -HOME_GAS_PRICE=1 +# The default gas price (in Wei) used to send Home Network signature +# transactions for deposit or withdrawal confirmations. This price is used if +# the Gas price oracle is unreachable. +HOME_GAS_PRICE=1000000000 # The address of the existing smart contract for block reward calculation on Home network. BLOCK_REWARD_ADDRESS=0x @@ -299,16 +299,17 @@ FOREIGN_UPGRADEABLE_ADMIN_VALIDATORS=0x FOREIGN_UPGRADEABLE_ADMIN_BRIDGE=0x # These three parameters are not used in this mode, but the deployment script # requires it to be set to some value. -FOREIGN_DAILY_LIMIT=15000000000000000000000000 -FOREIGN_MAX_AMOUNT_PER_TX=750000000000000000000000 -FOREIGN_MIN_AMOUNT_PER_TX=500000000000000000 +FOREIGN_DAILY_LIMIT=0 +FOREIGN_MAX_AMOUNT_PER_TX=0 +FOREIGN_MIN_AMOUNT_PER_TX=0 # The finalization threshold. The number of blocks issued after the block with # the corresponding deposit transaction to guarantee the transaction will not be # rolled back. FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS=8 -# The default gas price used to send Foreign network transactions finalizing -# asset deposits. This price is used if the Gas price oracle is unreachable. -FOREIGN_GAS_PRICE=10 +# The default gas price (in Wei) used to send Foreign network transactions +# finalizing asset deposits. This price is used if the Gas price oracle is +# unreachable. +FOREIGN_GAS_PRICE=10000000000 # The address of the existing ERC20 compatible token in the Foreign network to # be exchanged to the native coins on Home. From 7877b08086497802c7d2a27d862bf482619ed702 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Tue, 6 Nov 2018 14:38:41 +0300 Subject: [PATCH 77/77] avoid storing the result of the deployToken method in the token variable Co-Authored-By: akolotov --- deploy/testenv-deploy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/testenv-deploy.js b/deploy/testenv-deploy.js index 2d27c9530..6571f2797 100644 --- a/deploy/testenv-deploy.js +++ b/deploy/testenv-deploy.js @@ -7,7 +7,7 @@ const mode = process.argv[2] async function main() { switch(mode) { case 'token': - const token = await deployToken() + await deployToken() break case 'block-reward': console.log('The mode "block-reward" is not implemented yet.')