From c019299279cba64fba8213618d9ade90bde17432 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Thu, 6 Dec 2018 17:20:47 +0530 Subject: [PATCH 01/24] Reward is not transferred to facilitator if reward is 0. --- contracts/gateway/EIP20CoGateway.sol | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index 1f46186a..a9f2679b 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -1080,12 +1080,12 @@ contract EIP20CoGateway is GatewayBase { * @notice This is internal method for process minting contains common logic. * * @param _messageHash Message hash. - * @param _initialGas initial gas during progress process. + * @param _initialGas Initial gas during progress process. * - * @param _proofProgress true if progress with proof, false if progress + * @param _proofProgress True if progress with proof, false if progress * with hashlock. - * @param _unlockSecret unlock secret to progress, zero in case of progress - * with proof + * @param _unlockSecret Unlock secret to progress, zero in case of progress + * with proof. * * @return beneficiary_ Address to which the utility tokens will be * transferred after minting. @@ -1094,9 +1094,8 @@ contract EIP20CoGateway is GatewayBase { * is given to the facilitator. * @return mintedAmount_ Actual minted amount, after deducting the reward * from the total amount. - * @return rewardAmount_ Reward amount that is transferred to facilitator + * @return rewardAmount_ Reward amount that is transferred to facilitator. */ - function progressMintInternal( bytes32 _messageHash, uint256 _initialGas, @@ -1128,16 +1127,18 @@ contract EIP20CoGateway is GatewayBase { mintedAmount_ = stakeAmount_.sub(rewardAmount_); - //Mint token after subtracting reward amount + // Mint token after subtracting reward amount. UtilityTokenInterface(utilityToken).mint(beneficiary_, mintedAmount_); - //reward beneficiary with the reward amount - UtilityTokenInterface(utilityToken).mint(msg.sender, rewardAmount_); + if(rewardAmount_ != 0) { + // Reward beneficiary with the reward amount. + UtilityTokenInterface(utilityToken).mint(msg.sender, rewardAmount_); + } - // delete the mint data + // Delete the mint data. delete mints[_messageHash]; - // Emit MintProgressed event + // Emit MintProgressed event. emit MintProgressed( _messageHash, message.sender, From ad2723df79c61cda683a41c2c8dac196038226d5 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Fri, 7 Dec 2018 11:38:59 +0530 Subject: [PATCH 02/24] Added getter to calculate penalty amount --- contracts/gateway/EIP20CoGateway.sol | 15 +++++++++++++++ contracts/gateway/EIP20Gateway.sol | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index a9f2679b..2ee9dc69 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -740,6 +740,7 @@ contract EIP20CoGateway is GatewayBase { ); } + /* Public functions */ /** @@ -996,6 +997,20 @@ contract EIP20CoGateway is GatewayBase { ); } + /** + * + * + */ + function getPenaltyAmount(bytes32 _messageHash) + public + view + returns(uint256) + { + require(_messageHash == bytes32(0),"Input message hash is empty."); + return redeems[_messageHash].bounty.mul(REVOCATION_PENALTY).div(100); + } + + /* Private functions */ /** diff --git a/contracts/gateway/EIP20Gateway.sol b/contracts/gateway/EIP20Gateway.sol index 30171eb0..58d5ad96 100644 --- a/contracts/gateway/EIP20Gateway.sol +++ b/contracts/gateway/EIP20Gateway.sol @@ -895,6 +895,22 @@ contract EIP20Gateway is GatewayBase { progressUnstakeInternal(_messageHash, initialGas, bytes32(0), true); } + /** + * + * + */ + function getPenaltyAmount(bytes32 _messageHash) + public + view + returns(uint256) + { + require(_messageHash == bytes32(0),"Input message hash is empty."); + return stakes[_messageHash].bounty.mul(REVOCATION_PENALTY).div(100); + } + + + /** External methods */ + /** * @notice Declare redeem revert intent. * This will set message status to revoked. This method will also From a2eff7fa2972039c64262e92e000eea5aefe6f16 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Mon, 10 Dec 2018 12:54:17 +0530 Subject: [PATCH 03/24] Added unit test cases to verify that mint was called only for non-zero reward to facilitator --- contracts/gateway/EIP20CoGateway.sol | 2 +- contracts/test/MockUtilityToken.sol | 61 +++++++ contracts/test/TestEIP20CoGateway.sol | 138 +++++++++++++++ migrations/2_deploy_contracts.js | 5 +- .../eip20_cogateway/progress_mint_internal.js | 161 ++++++++++++++++++ 5 files changed, 364 insertions(+), 3 deletions(-) create mode 100644 contracts/test/MockUtilityToken.sol create mode 100644 contracts/test/TestEIP20CoGateway.sol create mode 100644 test/gateway/eip20_cogateway/progress_mint_internal.js diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index 2ee9dc69..47b77970 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -1145,7 +1145,7 @@ contract EIP20CoGateway is GatewayBase { // Mint token after subtracting reward amount. UtilityTokenInterface(utilityToken).mint(beneficiary_, mintedAmount_); - if(rewardAmount_ != 0) { + if(rewardAmount_ > 0) { // Reward beneficiary with the reward amount. UtilityTokenInterface(utilityToken).mint(msg.sender, rewardAmount_); } diff --git a/contracts/test/MockUtilityToken.sol b/contracts/test/MockUtilityToken.sol new file mode 100644 index 00000000..bb115d91 --- /dev/null +++ b/contracts/test/MockUtilityToken.sol @@ -0,0 +1,61 @@ +pragma solidity ^0.5.0; + +// Copyright 2017 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ---------------------------------------------------------------------------- +// Auxiliary chain: MockUtilityToken +// +// http://www.simpletoken.org/ +// +// ---------------------------------------------------------------------------- + +contract MockUtilityToken { + + /* Storage */ + + /** + * Address to which the utility tokens will be transferred after minting. + */ + address public beneficiary; + + /* Amount received by beneficiary. */ + uint256 public amount; + + + /* External functions */ + + /** + * @notice Mints the utility token + * + * @dev Adds _amount tokens to beneficiary balance and increases the + * totalTokenSupply. Can be called only by CoGateway. + * + * @param _beneficiary Address of tokens beneficiary. + * @param _amount Amount of tokens to mint. + * + * @return True if mint is successful, false otherwise. + */ + function mint( + address _beneficiary, + uint256 _amount + ) + external + returns (bool /* success */) + { + beneficiary = _beneficiary; + amount = _amount; + return true; + } +} diff --git a/contracts/test/TestEIP20CoGateway.sol b/contracts/test/TestEIP20CoGateway.sol new file mode 100644 index 00000000..0f4969c1 --- /dev/null +++ b/contracts/test/TestEIP20CoGateway.sol @@ -0,0 +1,138 @@ +pragma solidity ^0.5.0; + +import "../gateway/EIP20CoGateway.sol"; + +/** + * @title TestEIP20CoGateway contract. + * + * @notice Used for test only. + */ +contract TestEIP20CoGateway is EIP20CoGateway { + + /* Constructor */ + + /** + * @notice Initialise the contract by providing the Gateway contract + * address for which the CoGateway will enable facilitation of + * minting and redeeming. + * + * @param _valueToken The value token contract address. + * @param _utilityToken The utility token address that will be used for + * minting the utility token. + * @param _core Core contract address. + * @param _bounty The amount that facilitator will stakes to initiate the + * staking process. + * @param _organisation Organisation address. + * @param _gateway Gateway contract address. + */ + constructor( + address _valueToken, + address _utilityToken, + CoreInterface _core, + uint256 _bounty, + address _organisation, + address _gateway + ) + EIP20CoGateway( + _valueToken, + _utilityToken, + _core, + _bounty, + _organisation, + _gateway + ) + public + { + + } + + + /* Public Functions */ + + /** + * @notice It is used to set the messagehash. + * + * @dev It is for test purposes only. + * + * @param _intentHash Intent hash. + * @param _stakerNonce Nonce of the staker address. + * @param _gasPrice Gas price that staker is ready to pay to get the stake + * and mint process done. + * @param _gasLimit Gas limit that staker is ready to pay. + * @param _hashLock Hash Lock provided by the facilitator. + * @param _staker Staker address. + * + * @return messageHash_ Hash unique for every request. + */ + function setMessage( + bytes32 _intentHash, + uint256 _stakerNonce, + uint256 _gasPrice, + uint256 _gasLimit, + bytes32 _hashLock, + address _staker + ) + public + returns (bytes32 messageHash_) + { + + messageHash_ = MessageBus.messageDigest( + STAKE_TYPEHASH, + _intentHash, + _stakerNonce, + _gasPrice, + _gasLimit + ); + + messages[messageHash_] = getMessage( + _staker, + _stakerNonce, + _gasPrice, + _gasLimit, + _intentHash, + _hashLock + ); + + return messageHash_; + + } + + /** + * @notice It sets the mints mapping with respect to the messageHash. + * + * @dev It is for test purposes only. + * + * @param _messageHash Hash for which mints mapping is updated. + * @param _beneficiary Beneficiary Address to which the utility tokens + * will be transferred after minting. + * @param _amount Total amount for which the stake was initiated. The + * reward amount is deducted from the total amount and + * is given to the facilitator. + */ + function setMints( + bytes32 _messageHash, + address _beneficiary, + uint256 _amount + ) + public + { + mints[_messageHash] = Mint({ + amount : _amount, + beneficiary : _beneficiary + }); + } + + /** + * @notice It sets the status of inbox to Declared. + * + * @dev It is for test purposes only. + * + * @param _messageHash Hash for which status is set to Declared. + */ + function setInboxStatus(bytes32 _messageHash) public { + + messageBox.inbox[_messageHash] = MessageBus.MessageStatus.Declared; + + } + +} diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index d6d55a24..ab14c05b 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -8,6 +8,7 @@ const MetaBlock = artifacts.require("../contracts/lib/MetaBlock.sol"); const BlockStore = artifacts.require("../contracts/BlockStore.sol"); const TestEIP20Gateway = artifacts.require("TestEIP20Gateway"); const EIP20CoGateway = artifacts.require("EIP20CoGateway"); +const TestEIP20CoGateway = artifacts.require("TestEIP20CoGateway"); const AuxiliaryBlockStore = artifacts.require( "../contracts/AuxiliaryBlockStore.sol" ); @@ -35,8 +36,8 @@ module.exports = function (deployer) { deployer.deploy(GatewayLib); deployer.deploy(MockGatewayLib); deployer.deploy(MetaBlock); - deployer.link(GatewayLib, [GatewayBase, EIP20Gateway, TestEIP20Gateway, EIP20CoGateway]); - deployer.link(MessageBus, [EIP20CoGateway,TestEIP20Gateway, EIP20Gateway]); + deployer.link(GatewayLib, [GatewayBase, EIP20Gateway, TestEIP20Gateway, EIP20CoGateway, TestEIP20CoGateway]); + deployer.link(MessageBus, [EIP20CoGateway, TestEIP20CoGateway, TestEIP20Gateway, EIP20Gateway]); deployer.link(MockGatewayLib, [MockGatewayBase, TestEIP20Gateway]); deployer.link(MetaBlock, [BlockStore, AuxiliaryBlockStore]); diff --git a/test/gateway/eip20_cogateway/progress_mint_internal.js b/test/gateway/eip20_cogateway/progress_mint_internal.js new file mode 100644 index 00000000..0f34bea4 --- /dev/null +++ b/test/gateway/eip20_cogateway/progress_mint_internal.js @@ -0,0 +1,161 @@ +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ---------------------------------------------------------------------------- +// Test: progress_mint_internal.js +// +// http://www.simpletoken.org/ +// +// ---------------------------------------------------------------------------- + +const EIP20CoGateway = artifacts.require('EIP20CoGateway'), + Core = artifacts.require('MockCore'), + MessageBus = artifacts.require('MessageBus'), + UtilityToken = artifacts.require('UtilityToken'), + EIP20Token = artifacts.require('EIP20Token'), + BN = require('bn.js'), + Utils = require("../../test_lib/utils"), + TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), + MockUtilityToken = artifacts.require('MockUtilityToken'); + +let eip20CoGateway, + stateRoot = "0x70b4172eb30c495bf20b5b12224cd2380fccdd7ffa2292416b9dbdfc8511585d", + valueToken, + core, + organization, + gateway, + utilityToken, + bountyAmount, + owner, + staker, + stakerBalance; + +async function _setup(accounts) { + + valueToken = accounts[0]; + core = await Core.new(1, 2, 0, stateRoot, accounts[1]); + organization = accounts[2]; + gateway = accounts[3]; + owner = accounts[8]; + utilityToken = await MockUtilityToken.new(); + bountyAmount = new BN(100); + staker = accounts[7]; + stakerBalance = new BN(1000000); + + eip20CoGateway = await EIP20CoGateway.new( + valueToken, + utilityToken.address, + core.address, + bountyAmount, + organization, + gateway, + ); + +} + +contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { + + let amount, + beneficiary = accounts[4], + gasPrice = new BN(10), + gasLimit = new BN(10), + nonce = new BN(1), + hashLockObj = Utils.generateHashLock(), + hashLock = hashLockObj.l, + unlockSecret = hashLockObj.s, + facilitator = accounts[5], + intentHash = "0x193fa194eef3c001da102ee129c23b1e13a723cb9335edefe9100e85132c77d8", + mockEIP20CoGateway; + + beforeEach(async function () { + + await _setup(accounts); + amount = new BN(100); + intentHash = "0x193fa194eef3c001da102ee129c23b1e13a723cb9335edefe9100e85132c77d8"; + mockEIP20CoGateway = await TestEIP20CoGateway.new( + valueToken, + utilityToken.address, + core.address, + bountyAmount, + organization, + gateway, + ); + + }); + + it('should pass when facilitator is rewarded', async function () { + + let messageHash = await mockEIP20CoGateway.setMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await mockEIP20CoGateway.setMessage( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker + ); + await mockEIP20CoGateway.setInboxStatus(messageHash); + await mockEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + await mockEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from : facilitator}, + ); + assert.strictEqual((await utilityToken.beneficiary()), facilitator); + + }); + + + it('should fail when facilitator is not rewarded', async function () { + + gasPrice = new BN(0); + + let messageHash = await mockEIP20CoGateway.setMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + + await mockEIP20CoGateway.setMessage(intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await mockEIP20CoGateway.setInboxStatus(messageHash); + await mockEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + await mockEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from : facilitator}, + ); + + assert.notStrictEqual((await utilityToken.beneficiary()), facilitator); + + }); + +}); \ No newline at end of file From 251451de9088f7129032f7e83d3f786c368d0842 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Mon, 10 Dec 2018 13:21:07 +0530 Subject: [PATCH 04/24] Added test to verify the reward amount for facilitator --- contracts/test/TestEIP20CoGateway.sol | 6 ++--- .../eip20_cogateway/progress_mint_internal.js | 25 ++++++++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/contracts/test/TestEIP20CoGateway.sol b/contracts/test/TestEIP20CoGateway.sol index 0f4969c1..be80ff9b 100644 --- a/contracts/test/TestEIP20CoGateway.sol +++ b/contracts/test/TestEIP20CoGateway.sol @@ -22,7 +22,7 @@ contract TestEIP20CoGateway is EIP20CoGateway { * @param _core Core contract address. * @param _bounty The amount that facilitator will stakes to initiate the * staking process. - * @param _organisation Organisation address. + * @param _membersManager Organisation address. * @param _gateway Gateway contract address. */ constructor( @@ -30,7 +30,7 @@ contract TestEIP20CoGateway is EIP20CoGateway { address _utilityToken, CoreInterface _core, uint256 _bounty, - address _organisation, + IsMemberInterface _membersManager, address _gateway ) EIP20CoGateway( @@ -38,7 +38,7 @@ contract TestEIP20CoGateway is EIP20CoGateway { _utilityToken, _core, _bounty, - _organisation, + _membersManager, _gateway ) public diff --git a/test/gateway/eip20_cogateway/progress_mint_internal.js b/test/gateway/eip20_cogateway/progress_mint_internal.js index 0f34bea4..a5ecae4a 100644 --- a/test/gateway/eip20_cogateway/progress_mint_internal.js +++ b/test/gateway/eip20_cogateway/progress_mint_internal.js @@ -39,7 +39,8 @@ let eip20CoGateway, bountyAmount, owner, staker, - stakerBalance; + stakerBalance, + rewardAmount; async function _setup(accounts) { @@ -51,7 +52,8 @@ async function _setup(accounts) { utilityToken = await MockUtilityToken.new(); bountyAmount = new BN(100); staker = accounts[7]; - stakerBalance = new BN(1000000); + stakerBalance = new BN(1000000), + rewardAmount = new BN(100); eip20CoGateway = await EIP20CoGateway.new( valueToken, @@ -120,7 +122,18 @@ contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { unlockSecret, {from : facilitator}, ); - assert.strictEqual((await utilityToken.beneficiary()), facilitator); + + assert.strictEqual( + (await utilityToken.beneficiary()), + facilitator, + "Facilitator address is incorrect", + ); + + assert.strictEqual( + (await utilityToken.amount()).eq(rewardAmount), + true, + "Facilitator address is incorrect", + ); }); @@ -154,7 +167,11 @@ contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { {from : facilitator}, ); - assert.notStrictEqual((await utilityToken.beneficiary()), facilitator); + assert.notStrictEqual( + (await utilityToken.beneficiary()), + facilitator, + "Facilitator address is not correct", + ); }); From 50431487e34ec4d17d745541a2d61ca0dc2696d6 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Mon, 10 Dec 2018 17:18:35 +0530 Subject: [PATCH 05/24] Removed getPenalty method --- contracts/gateway/EIP20CoGateway.sol | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index c561358a..52da4232 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -981,19 +981,6 @@ contract EIP20CoGateway is GatewayBase { ); } - /** - * - * - */ - function getPenaltyAmount(bytes32 _messageHash) - public - view - returns(uint256) - { - require(_messageHash == bytes32(0),"Input message hash is empty."); - return redeems[_messageHash].bounty.mul(REVOCATION_PENALTY).div(100); - } - /* Private functions */ From 7913fd3f63519d45577a37572239c194476acd69 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Mon, 10 Dec 2018 17:23:47 +0530 Subject: [PATCH 06/24] Removed getPenalty method --- contracts/gateway/EIP20Gateway.sol | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/contracts/gateway/EIP20Gateway.sol b/contracts/gateway/EIP20Gateway.sol index 3f24d16c..65bfb9ff 100644 --- a/contracts/gateway/EIP20Gateway.sol +++ b/contracts/gateway/EIP20Gateway.sol @@ -897,19 +897,6 @@ contract EIP20Gateway is GatewayBase { progressUnstakeInternal(_messageHash, initialGas, bytes32(0), true); } - /** - * - * - */ - function getPenaltyAmount(bytes32 _messageHash) - public - view - returns(uint256) - { - require(_messageHash == bytes32(0),"Input message hash is empty."); - return stakes[_messageHash].bounty.mul(REVOCATION_PENALTY).div(100); - } - /** External methods */ From 03c98d08d930f642d39e06b48cea7ca595728e95 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Tue, 11 Dec 2018 21:10:15 +0530 Subject: [PATCH 07/24] PR feedback changes --- contracts/gateway/EIP20CoGateway.sol | 2 +- contracts/gateway/UtilityTokenInterface.sol | 2 - contracts/test/MockUtilityToken.sol | 52 +++++++- contracts/test/TestEIP20CoGateway.sol | 43 ++++--- .../gateway/eip20_cogateway/helpers/helper.js | 75 +++++++++++ ...ress_mint_internal.js => progress_mint.js} | 120 ++++++++++++++---- 6 files changed, 242 insertions(+), 52 deletions(-) create mode 100644 test/gateway/eip20_cogateway/helpers/helper.js rename test/gateway/eip20_cogateway/{progress_mint_internal.js => progress_mint.js} (58%) diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index f284d523..5749ad7d 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -1164,7 +1164,7 @@ contract EIP20CoGateway is GatewayBase { redeemer_ = message.sender; redeemAmount_ = redeems[_messageHash].amount; // Burn the redeem amount. - UtilityTokenInterface(utilityToken).burn(address(this), redeemAmount_); + UtilityTokenInterface(utilityToken).burn(redeemAmount_); // Transfer the bounty amount to the facilitator msg.sender.transfer(redeems[_messageHash].bounty); diff --git a/contracts/gateway/UtilityTokenInterface.sol b/contracts/gateway/UtilityTokenInterface.sol index beda72da..9842ef77 100644 --- a/contracts/gateway/UtilityTokenInterface.sol +++ b/contracts/gateway/UtilityTokenInterface.sol @@ -73,13 +73,11 @@ contract UtilityTokenInterface { * @dev only burns the amount from CoGateway address, So to burn * transfer the amount to CoGateway. * - * @param _burner Burner address. * @param _amount Amount of tokens to burn. * * @return bool `true` if burn is successful, false otherwise. */ function burn( - address _burner, uint256 _amount ) external diff --git a/contracts/test/MockUtilityToken.sol b/contracts/test/MockUtilityToken.sol index bb115d91..ff8dcdac 100644 --- a/contracts/test/MockUtilityToken.sol +++ b/contracts/test/MockUtilityToken.sol @@ -21,7 +21,21 @@ pragma solidity ^0.5.0; // // ---------------------------------------------------------------------------- -contract MockUtilityToken { + +import "../gateway/UtilityToken.sol"; + +/** + * @title MockUtilityToken contract. + * + * @notice This is for testing purpose. + * + */ +contract MockUtilityToken is UtilityToken { + + /* Usings */ + + using SafeMath for uint256; + /* Storage */ @@ -34,10 +48,40 @@ contract MockUtilityToken { uint256 public amount; + /* Constructor */ + + /** + * @notice Contract constructor. + * + * @dev This is for testing purpose. + * + * @param _symbol Symbol of token. + * @param _name Name of token. + * @param _decimals Decimal of token. + * @param _valueToken Address of value branded token. + */ + constructor( + string memory _symbol, + string memory _name, + uint8 _decimals, + address _valueToken + ) + public + UtilityToken(_symbol, _name, _decimals, _valueToken) + { + require( + _valueToken != address(0), + "ERC20 token should not be zero" + ); + + valueToken = _valueToken; + } + + /* External functions */ /** - * @notice Mints the utility token + * @notice Mints the utility token. This is for testing purpose. * * @dev Adds _amount tokens to beneficiary balance and increases the * totalTokenSupply. Can be called only by CoGateway. @@ -52,10 +96,12 @@ contract MockUtilityToken { uint256 _amount ) external - returns (bool /* success */) + returns (bool) { beneficiary = _beneficiary; amount = _amount; return true; } + } + diff --git a/contracts/test/TestEIP20CoGateway.sol b/contracts/test/TestEIP20CoGateway.sol index be80ff9b..07498a28 100644 --- a/contracts/test/TestEIP20CoGateway.sol +++ b/contracts/test/TestEIP20CoGateway.sol @@ -5,7 +5,7 @@ import "../gateway/EIP20CoGateway.sol"; /** * @title TestEIP20CoGateway contract. * - * @notice Used for test only. + * @notice This is used for testing purpose. */ contract TestEIP20CoGateway is EIP20CoGateway { @@ -14,7 +14,7 @@ contract TestEIP20CoGateway is EIP20CoGateway { /** * @notice Initialise the contract by providing the Gateway contract * address for which the CoGateway will enable facilitation of - * minting and redeeming. + * minting and redeeming.This is used for testing purpose. * * @param _valueToken The value token contract address. * @param _utilityToken The utility token address that will be used for @@ -33,14 +33,14 @@ contract TestEIP20CoGateway is EIP20CoGateway { IsMemberInterface _membersManager, address _gateway ) - EIP20CoGateway( - _valueToken, - _utilityToken, - _core, - _bounty, - _membersManager, - _gateway - ) + EIP20CoGateway( + _valueToken, + _utilityToken, + _core, + _bounty, + _membersManager, + _gateway + ) public { @@ -50,9 +50,9 @@ contract TestEIP20CoGateway is EIP20CoGateway { /* Public Functions */ /** - * @notice It is used to set the messagehash. + * @notice It is used to set the message. * - * @dev It is for test purposes only. + * @dev This is used for testing purpose. * * @param _intentHash Intent hash. * @param _stakerNonce Nonce of the staker address. @@ -64,7 +64,7 @@ contract TestEIP20CoGateway is EIP20CoGateway { * * @return messageHash_ Hash unique for every request. */ - function setMessage( + function setStakeMessage( bytes32 _intentHash, uint256 _stakerNonce, uint256 _gasPrice, @@ -100,7 +100,7 @@ contract TestEIP20CoGateway is EIP20CoGateway { /** * @notice It sets the mints mapping with respect to the messageHash. * - * @dev It is for test purposes only. + * @dev This is used for testing purpose. * * @param _messageHash Hash for which mints mapping is updated. * @param _beneficiary Beneficiary Address to which the utility tokens @@ -123,15 +123,20 @@ contract TestEIP20CoGateway is EIP20CoGateway { } /** - * @notice It sets the status of inbox to Declared. + * @notice It sets the status of inbox to declared. * - * @dev It is for test purposes only. + * @dev This is used for testing purpose. * - * @param _messageHash Hash for which status is set to Declared. + * @param _messageHash It sets the status of the inbox to declared status. */ - function setInboxStatus(bytes32 _messageHash) public { + function setInboxStatus( + bytes32 _messageHash, + MessageBus.MessageStatus status + ) + public + { - messageBox.inbox[_messageHash] = MessageBus.MessageStatus.Declared; + messageBox.inbox[_messageHash] = status; } diff --git a/test/gateway/eip20_cogateway/helpers/helper.js b/test/gateway/eip20_cogateway/helpers/helper.js new file mode 100644 index 00000000..02e87a17 --- /dev/null +++ b/test/gateway/eip20_cogateway/helpers/helper.js @@ -0,0 +1,75 @@ +'use strict'; + +const web3 = require('../../../test_lib/web3.js'); + + +const EIP20CoGatewayHelper = function() { + +}; + +EIP20CoGatewayHelper.prototype = { + + /** + * It sets the cogateway address. + */ + setGateway: async function(coGateway) { + + this.coGateway = coGateway; + + }, + + /** + * Generate the stake type hash. This is as per EIP-712 + * + * @return {string} message type hash. + */ + redeemTypeHash: async function() { + return web3.utils.soliditySha3( + web3.eth.abi.encodeParameter( + 'string', + 'Redeem(uint256 amount,address beneficiary,MessageBus.Message message)' + ) + ); + }, + + /** + * Generate the stake intent hash + * + * @param {object} amount Staking amount. + * @param {string} beneficiary Beneficiary address. + * @param {string} redeemer Redeemer address. + * @param {object} nonce Nonce of staker (Big Number). + * @param {object} gasPrice Gas price (Big Number). + * @param {object} gasLimit Gas limit (Big Number). + * @param {string} token EIP20 token address. + * + * @return {string} redeem intent hash. + */ + hashRedeemIntent: async function ( + amount, + beneficiary, + redeemer, + nonce, + gasPrice, + gasLimit, + token) { + + return web3.utils.soliditySha3( + { t: 'uint256', v: amount }, + { t: 'address', v: beneficiary }, + { t: 'address', v: redeemer }, + { t: 'uint256', v: nonce }, + { t: 'uint256', v: gasPrice }, + { t: 'uint256', v: gasLimit }, + { t: 'address', v: token } + ); + }, + + getNonce: async function (address) { + const oThis = this; + return await oThis.coGateway.getNonce.call(address); + } + +}; + +module.exports = EIP20CoGatewayHelper; diff --git a/test/gateway/eip20_cogateway/progress_mint_internal.js b/test/gateway/eip20_cogateway/progress_mint.js similarity index 58% rename from test/gateway/eip20_cogateway/progress_mint_internal.js rename to test/gateway/eip20_cogateway/progress_mint.js index a5ecae4a..3e689e48 100644 --- a/test/gateway/eip20_cogateway/progress_mint_internal.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -13,19 +13,19 @@ // limitations under the License. // // ---------------------------------------------------------------------------- -// Test: progress_mint_internal.js // // http://www.simpletoken.org/ // // ---------------------------------------------------------------------------- -const EIP20CoGateway = artifacts.require('EIP20CoGateway'), +const BN = require('bn.js'), + Utils = require("../../test_lib/utils"), + EIP20CoGatewayHelper = require("./helpers/helper"); + EIP20CoGateway = artifacts.require('EIP20CoGateway'), Core = artifacts.require('MockCore'), MessageBus = artifacts.require('MessageBus'), UtilityToken = artifacts.require('UtilityToken'), EIP20Token = artifacts.require('EIP20Token'), - BN = require('bn.js'), - Utils = require("../../test_lib/utils"), TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), MockUtilityToken = artifacts.require('MockUtilityToken'); @@ -40,7 +40,19 @@ let eip20CoGateway, owner, staker, stakerBalance, - rewardAmount; + rewardAmount, + symbol = "OST", + name = "Simple Token", + decimals = 18, + helper; + +let MessageStatusEnum = { + Undeclared: 0, + Declared: 1, + Progressed: 2, + DeclaredRevocation: 3, + Revoked: 4 +}; async function _setup(accounts) { @@ -49,10 +61,15 @@ async function _setup(accounts) { organization = accounts[2]; gateway = accounts[3]; owner = accounts[8]; - utilityToken = await MockUtilityToken.new(); + utilityToken = await MockUtilityToken.new( + symbol, + name, + decimals, + valueToken, + ); bountyAmount = new BN(100); staker = accounts[7]; - stakerBalance = new BN(1000000), + stakerBalance = new BN(1000000); rewardAmount = new BN(100); eip20CoGateway = await EIP20CoGateway.new( @@ -64,11 +81,11 @@ async function _setup(accounts) { gateway, ); -} + } -contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { +contract('EIP20CoGateway.progressMint() ', function (accounts) { - let amount, + let amount = new BN(100), beneficiary = accounts[4], gasPrice = new BN(10), gasLimit = new BN(10), @@ -77,15 +94,25 @@ contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { hashLock = hashLockObj.l, unlockSecret = hashLockObj.s, facilitator = accounts[5], - intentHash = "0x193fa194eef3c001da102ee129c23b1e13a723cb9335edefe9100e85132c77d8", - mockEIP20CoGateway; + intentHash, + testEIP20CoGateway; + helper = new EIP20CoGatewayHelper(); beforeEach(async function () { await _setup(accounts); amount = new BN(100); - intentHash = "0x193fa194eef3c001da102ee129c23b1e13a723cb9335edefe9100e85132c77d8"; - mockEIP20CoGateway = await TestEIP20CoGateway.new( + await helper.setGateway(eip20CoGateway.address); + intentHash = await helper.hashRedeemIntent( + amount, + beneficiary, + facilitator, + nonce, + gasPrice, + gasLimit, + valueToken, + ); + testEIP20CoGateway = await TestEIP20CoGateway.new( valueToken, utilityToken.address, core.address, @@ -98,7 +125,7 @@ contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { it('should pass when facilitator is rewarded', async function () { - let messageHash = await mockEIP20CoGateway.setMessage.call( + let messageHash = await testEIP20CoGateway.setStakeMessage.call( intentHash, nonce, gasPrice, @@ -106,18 +133,53 @@ contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { hashLock, staker, ); - await mockEIP20CoGateway.setMessage( + await testEIP20CoGateway.setStakeMessage( intentHash, nonce, gasPrice, gasLimit, hashLock, - staker + staker, + ); + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Declared, + ); + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + let progressMintValues = await testEIP20CoGateway.progressMint.call( + messageHash, + unlockSecret, + {from : facilitator}, + ); + let expectedMintedToken = new BN(0), + expectedReward = new BN(100); + + assert.strictEqual( + progressMintValues.beneficiary_, + beneficiary, + "Incorrect beneficiary address", + ); + + assert.strictEqual( + amount.eq(progressMintValues.stakeAmount_), + true, + "Incorrect staked amount", + ); + + assert.strictEqual( + expectedMintedToken.eq(progressMintValues.mintedAmount_), + true, + "Incorrect minted amount", + ); + + assert.strictEqual( + expectedReward.eq(progressMintValues.rewardAmount_), + true, + "Incorrect reward to facilitator", ); - await mockEIP20CoGateway.setInboxStatus(messageHash); - await mockEIP20CoGateway.setMints(messageHash, beneficiary, amount); - await mockEIP20CoGateway.progressMint( + await testEIP20CoGateway.progressMint( messageHash, unlockSecret, {from : facilitator}, @@ -138,11 +200,11 @@ contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { }); - it('should fail when facilitator is not rewarded', async function () { + it('should not mint reward for zero reward amount', async function () { gasPrice = new BN(0); - let messageHash = await mockEIP20CoGateway.setMessage.call( + let messageHash = await testEIP20CoGateway.setStakeMessage.call( intentHash, nonce, gasPrice, @@ -151,17 +213,21 @@ contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { staker, ); - await mockEIP20CoGateway.setMessage(intentHash, + await testEIP20CoGateway.setStakeMessage( + intentHash, nonce, gasPrice, gasLimit, hashLock, staker, ); - await mockEIP20CoGateway.setInboxStatus(messageHash); - await mockEIP20CoGateway.setMints(messageHash, beneficiary, amount); + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Declared, + ); + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); - await mockEIP20CoGateway.progressMint( + await testEIP20CoGateway.progressMint( messageHash, unlockSecret, {from : facilitator}, @@ -175,4 +241,4 @@ contract('EIP20CoGateway.progressMintInternal() ', function (accounts) { }); -}); \ No newline at end of file +}); From f6d379f421a91125c40909d7b166b7490f977f8c Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Tue, 11 Dec 2018 21:13:12 +0530 Subject: [PATCH 08/24] Changed parameter type to StateRootInterface --- contracts/test/TestEIP20CoGateway.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/test/TestEIP20CoGateway.sol b/contracts/test/TestEIP20CoGateway.sol index 07498a28..20eae2c5 100644 --- a/contracts/test/TestEIP20CoGateway.sol +++ b/contracts/test/TestEIP20CoGateway.sol @@ -28,7 +28,7 @@ contract TestEIP20CoGateway is EIP20CoGateway { constructor( address _valueToken, address _utilityToken, - CoreInterface _core, + StateRootInterface _core, uint256 _bounty, IsMemberInterface _membersManager, address _gateway From b579027b254de9c3108780cdb4edea4368632029 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Tue, 11 Dec 2018 21:16:54 +0530 Subject: [PATCH 09/24] Added documentation for zero reward. --- contracts/gateway/EIP20CoGateway.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index 965ccffe..9235ef85 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -1062,6 +1062,7 @@ contract EIP20CoGateway is GatewayBase { /** * @notice This is internal method for process minting contains common logic. + * It doesn't mint reward if reward is 0. * * @param _messageHash Message hash. * @param _initialGas Initial gas during progress process. From 1b22697b2a41f9a289701457277b468682013ce3 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Tue, 11 Dec 2018 21:47:54 +0530 Subject: [PATCH 10/24] Changes done to incorporate MockSafeCore --- test/gateway/eip20_cogateway/progress_mint.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index 3e689e48..8a421f15 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -22,7 +22,7 @@ const BN = require('bn.js'), Utils = require("../../test_lib/utils"), EIP20CoGatewayHelper = require("./helpers/helper"); EIP20CoGateway = artifacts.require('EIP20CoGateway'), - Core = artifacts.require('MockCore'), + MockSafeCore = artifacts.require('MockSafeCore'), MessageBus = artifacts.require('MessageBus'), UtilityToken = artifacts.require('UtilityToken'), EIP20Token = artifacts.require('EIP20Token'), @@ -32,7 +32,7 @@ const BN = require('bn.js'), let eip20CoGateway, stateRoot = "0x70b4172eb30c495bf20b5b12224cd2380fccdd7ffa2292416b9dbdfc8511585d", valueToken, - core, + mockSafeCore, organization, gateway, utilityToken, @@ -57,7 +57,7 @@ let MessageStatusEnum = { async function _setup(accounts) { valueToken = accounts[0]; - core = await Core.new(1, 2, 0, stateRoot, accounts[1]); + mockSafeCore = await MockSafeCore.new(1, 2, stateRoot, accounts[1]); organization = accounts[2]; gateway = accounts[3]; owner = accounts[8]; @@ -75,7 +75,7 @@ async function _setup(accounts) { eip20CoGateway = await EIP20CoGateway.new( valueToken, utilityToken.address, - core.address, + mockSafeCore.address, bountyAmount, organization, gateway, @@ -115,7 +115,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { testEIP20CoGateway = await TestEIP20CoGateway.new( valueToken, utilityToken.address, - core.address, + mockSafeCore.address, bountyAmount, organization, gateway, From 0bca4d2ebdb483d83cce398f25214c82d976be22 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Wed, 12 Dec 2018 12:26:13 +0530 Subject: [PATCH 11/24] Indentation changes --- test/gateway/eip20_cogateway/progress_mint.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index 8a421f15..457ad029 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -80,7 +80,6 @@ async function _setup(accounts) { organization, gateway, ); - } contract('EIP20CoGateway.progressMint() ', function (accounts) { From e64bac5e7958c98cb004c7854410702e7a0c02c0 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Thu, 13 Dec 2018 11:02:41 +0530 Subject: [PATCH 12/24] Mocking for mint method is removed and correct unlockSecret value is passed from progressMint method --- contracts/gateway/EIP20CoGateway.sol | 2 +- contracts/test/MockUtilityToken.sol | 37 +- contracts/test/TestEIP20CoGateway.sol | 11 +- package-lock.json | 1278 ++++++++--------- .../gateway/eip20_cogateway/helpers/helper.js | 30 +- test/gateway/eip20_cogateway/progress_mint.js | 106 +- 6 files changed, 738 insertions(+), 726 deletions(-) diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index 9235ef85..334f66dc 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -298,7 +298,7 @@ contract EIP20CoGateway is GatewayBase { stakeAmount_, mintedAmount_, rewardAmount_) = - progressMintInternal(_messageHash, initialGas, true, bytes32(0)); + progressMintInternal(_messageHash, initialGas, true, _unlockSecret); } /** diff --git a/contracts/test/MockUtilityToken.sol b/contracts/test/MockUtilityToken.sol index ff8dcdac..084bf44c 100644 --- a/contracts/test/MockUtilityToken.sol +++ b/contracts/test/MockUtilityToken.sol @@ -37,17 +37,6 @@ contract MockUtilityToken is UtilityToken { using SafeMath for uint256; - /* Storage */ - - /** - * Address to which the utility tokens will be transferred after minting. - */ - address public beneficiary; - - /* Amount received by beneficiary. */ - uint256 public amount; - - /* Constructor */ /** @@ -69,38 +58,20 @@ contract MockUtilityToken is UtilityToken { public UtilityToken(_symbol, _name, _decimals, _valueToken) { - require( - _valueToken != address(0), - "ERC20 token should not be zero" - ); - valueToken = _valueToken; } /* External functions */ /** - * @notice Mints the utility token. This is for testing purpose. - * - * @dev Adds _amount tokens to beneficiary balance and increases the - * totalTokenSupply. Can be called only by CoGateway. + * @notice It sets the coGateway address. This is for testing purpose. * - * @param _beneficiary Address of tokens beneficiary. - * @param _amount Amount of tokens to mint. - * - * @return True if mint is successful, false otherwise. + * @param _coGateway CoGateway address to be set. */ - function mint( - address _beneficiary, - uint256 _amount - ) - external - returns (bool) + function setCoGateway(address _coGateway) external returns (bool) { - beneficiary = _beneficiary; - amount = _amount; - return true; + coGateway = _coGateway; } } diff --git a/contracts/test/TestEIP20CoGateway.sol b/contracts/test/TestEIP20CoGateway.sol index 20eae2c5..c564828c 100644 --- a/contracts/test/TestEIP20CoGateway.sol +++ b/contracts/test/TestEIP20CoGateway.sol @@ -123,21 +123,20 @@ contract TestEIP20CoGateway is EIP20CoGateway { } /** - * @notice It sets the status of inbox to declared. + * @notice It sets the status of message in inbox. * * @dev This is used for testing purpose. * - * @param _messageHash It sets the status of the inbox to declared status. + * @param _messageHash Message for which status is to be set. + * @param _status State of the message. */ function setInboxStatus( bytes32 _messageHash, - MessageBus.MessageStatus status + MessageBus.MessageStatus _status ) public { - - messageBox.inbox[_messageHash] = status; - + messageBox.inbox[_messageHash] = _status; } } diff --git a/package-lock.json b/package-lock.json index e94e176a..371a6b65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "integrity": "sha512-y2OKSEW4gf2838Eavc56vQY9V46zaXkf3Jl1WpTfUBbzAVrXSr4JRZAAWv55Tv9s5WNz1rVgBgz5d2aJIL1QCg==", "dev": true, "requires": { - "web3": "^0.18.4" + "web3": "0.18.4" }, "dependencies": { "web3": { @@ -32,10 +32,10 @@ "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": "*" + "crypto-js": "3.1.8", + "utf8": "2.1.2", + "xhr2": "0.1.4", + "xmlhttprequest": "1.8.0" } } } @@ -46,7 +46,7 @@ "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "dev": true, "requires": { - "mime-types": "~2.1.18", + "mime-types": "2.1.20", "negotiator": "0.6.1" } }, @@ -62,10 +62,10 @@ "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" } }, "amdefine": { @@ -93,12 +93,12 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "~1.0.2" + "sprintf-js": "1.0.3" } }, "array-flatten": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "dev": true }, @@ -108,7 +108,7 @@ "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "dev": true, "requires": { - "safer-buffer": "~2.1.0" + "safer-buffer": "2.1.2" } }, "asn1.js": { @@ -117,9 +117,9 @@ "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "bn.js": "4.11.8", + "inherits": "2.0.1", + "minimalistic-assert": "1.0.1" } }, "assert": { @@ -139,7 +139,7 @@ }, "async": { "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, @@ -186,12 +186,11 @@ "dev": true, "optional": true, "requires": { - "tweetnacl": "^0.14.3" + "tweetnacl": "0.14.5" } }, "bignumber.js": { "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "from": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", "dev": true }, "bindings": { @@ -202,12 +201,12 @@ }, "bl": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "dev": true, "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" + "readable-stream": "2.3.6", + "safe-buffer": "5.1.2" } }, "block-stream": { @@ -216,7 +215,7 @@ "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "dev": true, "requires": { - "inherits": "~2.0.0" + "inherits": "2.0.1" } }, "bluebird": { @@ -238,15 +237,15 @@ "dev": true, "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.2", + "http-errors": "1.6.3", "iconv-lite": "0.4.23", - "on-finished": "~2.3.0", + "on-finished": "2.3.0", "qs": "6.5.2", "raw-body": "2.3.3", - "type-is": "~1.6.16" + "type-is": "1.6.16" }, "dependencies": { "debug": { @@ -266,7 +265,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "^1.0.0", + "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, @@ -288,12 +287,12 @@ "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { - "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" + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.1", + "safe-buffer": "5.1.2" } }, "browserify-cipher": { @@ -302,9 +301,9 @@ "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "dev": true, "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" + "browserify-aes": "1.2.0", + "browserify-des": "1.0.2", + "evp_bytestokey": "1.0.3" } }, "browserify-des": { @@ -313,10 +312,10 @@ "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", "dev": true, "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.1", + "safe-buffer": "5.1.2" } }, "browserify-rsa": { @@ -325,8 +324,8 @@ "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" + "bn.js": "4.11.8", + "randombytes": "2.0.6" } }, "browserify-sha3": { @@ -335,7 +334,7 @@ "integrity": "sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE=", "dev": true, "requires": { - "js-sha3": "^0.3.1" + "js-sha3": "0.3.1" } }, "browserify-sign": { @@ -344,13 +343,13 @@ "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", "dev": true, "requires": { - "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" + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "elliptic": "6.4.1", + "inherits": "2.0.1", + "parse-asn1": "5.1.1" } }, "buffer": { @@ -359,8 +358,8 @@ "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", "dev": true, "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" + "base64-js": "1.3.0", + "ieee754": "1.1.12" } }, "buffer-alloc": { @@ -369,8 +368,8 @@ "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", "dev": true, "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" + "buffer-alloc-unsafe": "1.1.0", + "buffer-fill": "1.0.0" } }, "buffer-alloc-unsafe": { @@ -439,8 +438,8 @@ "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.1", + "safe-buffer": "5.1.2" } }, "cliui": { @@ -449,9 +448,9 @@ "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" } }, "co": { @@ -472,7 +471,7 @@ "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "dev": true, "requires": { - "delayed-stream": "~1.0.0" + "delayed-stream": "1.0.0" } }, "commander": { @@ -529,8 +528,8 @@ "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", "dev": true, "requires": { - "object-assign": "^4", - "vary": "^1" + "object-assign": "4.1.1", + "vary": "1.1.2" } }, "create-ecdh": { @@ -539,8 +538,8 @@ "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", "dev": true, "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" + "bn.js": "4.11.8", + "elliptic": "6.4.1" } }, "create-hash": { @@ -549,11 +548,11 @@ "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" + "cipher-base": "1.0.4", + "inherits": "2.0.1", + "md5.js": "1.3.4", + "ripemd160": "2.0.2", + "sha.js": "2.4.11" } }, "create-hmac": { @@ -562,12 +561,12 @@ "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { - "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" + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "inherits": "2.0.1", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" } }, "cross-spawn": { @@ -576,9 +575,9 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "lru-cache": "4.1.3", + "shebang-command": "1.2.0", + "which": "1.3.1" } }, "crypto-browserify": { @@ -587,17 +586,17 @@ "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, "requires": { - "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" + "browserify-cipher": "1.0.1", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.3", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "diffie-hellman": "5.0.3", + "inherits": "2.0.1", + "pbkdf2": "3.0.16", + "public-encrypt": "4.0.2", + "randombytes": "2.0.6", + "randomfill": "1.0.4" } }, "crypto-js": { @@ -612,7 +611,7 @@ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { - "assert-plus": "^1.0.0" + "assert-plus": "1.0.0" } }, "death": { @@ -648,14 +647,14 @@ "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", "dev": true, "requires": { - "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-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.3.0", + "pify": "2.3.0", + "strip-dirs": "2.1.0" } }, "decompress-response": { @@ -664,7 +663,7 @@ "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "dev": true, "requires": { - "mimic-response": "^1.0.0" + "mimic-response": "1.0.1" } }, "decompress-tar": { @@ -673,9 +672,9 @@ "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "dev": true, "requires": { - "file-type": "^5.2.0", - "is-stream": "^1.1.0", - "tar-stream": "^1.5.2" + "file-type": "5.2.0", + "is-stream": "1.1.0", + "tar-stream": "1.6.2" } }, "decompress-tarbz2": { @@ -684,11 +683,11 @@ "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", "dev": true, "requires": { - "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" + "decompress-tar": "4.1.1", + "file-type": "6.2.0", + "is-stream": "1.1.0", + "seek-bzip": "1.0.5", + "unbzip2-stream": "1.3.0" }, "dependencies": { "file-type": { @@ -705,9 +704,9 @@ "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", "dev": true, "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": { @@ -716,26 +715,26 @@ "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", "dev": true, "requires": { - "file-type": "^3.8.0", - "get-stream": "^2.2.0", - "pify": "^2.3.0", - "yauzl": "^2.4.2" + "file-type": "3.9.0", + "get-stream": "2.3.1", + "pify": "2.3.0", + "yauzl": "2.10.0" }, "dependencies": { "file-type": { "version": "3.9.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "resolved": "http://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", "dev": true }, "get-stream": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", "dev": true, "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" + "object-assign": "4.1.1", + "pinkie-promise": "2.0.1" } } } @@ -764,8 +763,8 @@ "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", "dev": true, "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "inherits": "2.0.1", + "minimalistic-assert": "1.0.1" } }, "destroy": { @@ -786,9 +785,9 @@ "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.0.6" } }, "dom-walk": { @@ -810,8 +809,8 @@ "dev": true, "optional": true, "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" + "jsbn": "0.1.1", + "safer-buffer": "2.1.2" } }, "ee-first": { @@ -826,13 +825,13 @@ "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", "dev": true, "requires": { - "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" + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.5", + "hmac-drbg": "1.0.1", + "inherits": "2.0.1", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" } }, "encodeurl": { @@ -847,7 +846,7 @@ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { - "once": "^1.4.0" + "once": "1.4.0" } }, "error-ex": { @@ -856,7 +855,7 @@ "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { - "is-arrayish": "^0.2.1" + "is-arrayish": "0.2.1" } }, "escape-html": { @@ -877,21 +876,21 @@ "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "dev": true, "requires": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" }, "dependencies": { "source-map": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", "dev": true, "optional": true, "requires": { - "amdefine": ">=0.0.4" + "amdefine": "1.0.1" } } } @@ -926,8 +925,8 @@ "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", "dev": true, "requires": { - "idna-uts46-hx": "^2.3.1", - "js-sha3": "^0.5.7" + "idna-uts46-hx": "2.3.1", + "js-sha3": "0.5.7" }, "dependencies": { "js-sha3": { @@ -944,13 +943,13 @@ "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", "dev": true, "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.0.0", - "xhr-request-promise": "^0.1.2" + "bn.js": "4.11.8", + "elliptic": "6.4.1", + "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" } }, "ethereumjs-testrpc-sc": { @@ -959,7 +958,7 @@ "integrity": "sha512-iv2qiGBFgk9mn5Nq2enX8dG5WQ7Lk+FCqpnxfPfH4Ns8KLPwttmNOy264nh3SXDJJvcQwz/XnlLteDQVILotbg==", "dev": true, "requires": { - "source-map-support": "^0.5.3" + "source-map-support": "0.5.9" } }, "ethers": { @@ -968,9 +967,9 @@ "integrity": "sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw==", "dev": true, "requires": { - "@types/node": "^10.3.2", + "@types/node": "10.10.3", "aes-js": "3.0.0", - "bn.js": "^4.4.0", + "bn.js": "4.11.8", "elliptic": "6.3.3", "hash.js": "1.1.3", "js-sha3": "0.5.7", @@ -986,10 +985,10 @@ "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", "dev": true, "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "inherits": "^2.0.1" + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "inherits": "2.0.1" } }, "hash.js": { @@ -998,8 +997,8 @@ "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "dev": true, "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" }, "dependencies": { "inherits": { @@ -1024,7 +1023,7 @@ }, "uuid": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "resolved": "http://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", "dev": true } @@ -1060,8 +1059,8 @@ "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" + "md5.js": "1.3.4", + "safe-buffer": "5.1.2" } }, "execa": { @@ -1070,13 +1069,13 @@ "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { - "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" + "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" } }, "express": { @@ -1085,36 +1084,36 @@ "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", "dev": true, "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.4", "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": { "body-parser": { @@ -1124,15 +1123,15 @@ "dev": true, "requires": { "bytes": "3.0.0", - "content-type": "~1.0.4", + "content-type": "1.0.4", "debug": "2.6.9", - "depd": "~1.1.1", - "http-errors": "~1.6.2", + "depd": "1.1.2", + "http-errors": "1.6.3", "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.15" + "type-is": "1.6.16" } }, "debug": { @@ -1189,7 +1188,7 @@ "depd": "1.1.1", "inherits": "2.0.3", "setprototypeof": "1.0.3", - "statuses": ">= 1.3.1 < 2" + "statuses": "1.4.0" } }, "setprototypeof": { @@ -1250,7 +1249,7 @@ "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "dev": true, "requires": { - "pend": "~1.2.0" + "pend": "1.2.0" } }, "file-type": { @@ -1261,17 +1260,17 @@ }, "finalhandler": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "dev": true, "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": { @@ -1297,8 +1296,8 @@ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" } }, "for-each": { @@ -1307,7 +1306,7 @@ "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "requires": { - "is-callable": "^1.1.3" + "is-callable": "1.1.4" } }, "forever-agent": { @@ -1322,9 +1321,9 @@ "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "dev": true, "requires": { - "asynckit": "^0.4.0", + "asynckit": "0.4.0", "combined-stream": "1.0.6", - "mime-types": "^2.1.12" + "mime-types": "2.1.20" }, "dependencies": { "combined-stream": { @@ -1333,7 +1332,7 @@ "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { - "delayed-stream": "~1.0.0" + "delayed-stream": "1.0.0" } } } @@ -1362,11 +1361,11 @@ "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "klaw": "1.3.1", + "path-is-absolute": "1.0.1", + "rimraf": "2.6.2" } }, "fs-promise": { @@ -1375,10 +1374,10 @@ "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", "dev": true, "requires": { - "any-promise": "^1.3.0", - "fs-extra": "^2.0.0", - "mz": "^2.6.0", - "thenify-all": "^1.6.0" + "any-promise": "1.3.0", + "fs-extra": "2.1.2", + "mz": "2.7.0", + "thenify-all": "1.6.0" }, "dependencies": { "fs-extra": { @@ -1387,8 +1386,8 @@ "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0" + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0" } } } @@ -1405,10 +1404,10 @@ "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" + "graceful-fs": "4.1.11", + "inherits": "2.0.1", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" } }, "ganache-cli": { @@ -1417,7 +1416,7 @@ "integrity": "sha512-yXzteu4SIgUL31mnpm9j+x6dpHUw0p/nsRVkcySKq0w+1vDxH9jMErP1QhZAJuTVE6ni4nfvGSNkaQx5cD3jfg==", "dev": true, "requires": { - "source-map-support": "^0.5.3" + "source-map-support": "0.5.9" } }, "get-caller-file": { @@ -1428,7 +1427,7 @@ }, "get-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, @@ -1438,7 +1437,7 @@ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, "requires": { - "assert-plus": "^1.0.0" + "assert-plus": "1.0.0" } }, "glob": { @@ -1447,11 +1446,11 @@ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "dev": true, "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "global": { @@ -1460,8 +1459,8 @@ "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", "dev": true, "requires": { - "min-document": "^2.19.0", - "process": "~0.5.1" + "min-document": "2.19.0", + "process": "0.5.2" } }, "got": { @@ -1470,20 +1469,20 @@ "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", "dev": true, "requires": { - "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" + "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.2", + "timed-out": "4.0.1", + "url-parse-lax": "1.0.0", + "url-to-options": "1.0.1" } }, "graceful-fs": { @@ -1510,10 +1509,10 @@ "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", "dev": true, "requires": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" + "async": "2.6.1", + "optimist": "0.6.1", + "source-map": "0.6.1", + "uglify-js": "3.4.9" }, "dependencies": { "async": { @@ -1522,7 +1521,7 @@ "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "dev": true, "requires": { - "lodash": "^4.17.10" + "lodash": "4.17.11" } } } @@ -1539,8 +1538,8 @@ "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", "dev": true, "requires": { - "ajv": "^5.3.0", - "har-schema": "^2.0.0" + "ajv": "5.5.2", + "har-schema": "2.0.0" } }, "has-flag": { @@ -1561,7 +1560,7 @@ "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", "dev": true, "requires": { - "has-symbol-support-x": "^1.4.1" + "has-symbol-support-x": "1.4.2" } }, "hash-base": { @@ -1570,8 +1569,8 @@ "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "dev": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.1", + "safe-buffer": "5.1.2" } }, "hash.js": { @@ -1580,8 +1579,8 @@ "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", "dev": true, "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" }, "dependencies": { "inherits": { @@ -1604,9 +1603,9 @@ "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" + "hash.js": "1.1.5", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" } }, "hosted-git-info": { @@ -1621,10 +1620,10 @@ "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "dev": true, "requires": { - "depd": "~1.1.2", + "depd": "1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" + "statuses": "1.5.0" }, "dependencies": { "inherits": { @@ -1647,9 +1646,9 @@ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.14.2" } }, "iconv-lite": { @@ -1658,7 +1657,7 @@ "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "dev": true, "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": "2.1.2" } }, "idna-uts46-hx": { @@ -1690,8 +1689,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "^1.3.0", - "wrappy": "1" + "once": "1.4.0", + "wrappy": "1.0.2" } }, "inherits": { @@ -1730,7 +1729,7 @@ "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { - "builtin-modules": "^1.0.0" + "builtin-modules": "1.1.1" } }, "is-callable": { @@ -1745,7 +1744,7 @@ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "^1.0.0" + "number-is-nan": "1.0.1" } }, "is-function": { @@ -1826,20 +1825,20 @@ "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", "dev": true, "requires": { - "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" + "abbrev": "1.0.9", + "async": "1.5.2", + "escodegen": "1.8.1", + "esprima": "2.7.3", + "glob": "5.0.15", + "handlebars": "4.0.12", + "js-yaml": "3.12.0", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "once": "1.4.0", + "resolve": "1.1.7", + "supports-color": "3.2.3", + "which": "1.3.1", + "wordwrap": "1.0.0" } }, "isurl": { @@ -1848,8 +1847,8 @@ "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "dev": true, "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" + "has-to-string-tag-x": "1.4.1", + "is-object": "1.0.1" } }, "js-sha3": { @@ -1864,8 +1863,8 @@ "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "1.0.10", + "esprima": "4.0.1" }, "dependencies": { "esprima": { @@ -1907,7 +1906,7 @@ "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "dev": true, "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "4.1.11" } }, "jsprim": { @@ -1928,10 +1927,10 @@ "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "dev": true, "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" + "bindings": "1.3.0", + "inherits": "2.0.3", + "nan": "2.11.0", + "safe-buffer": "5.1.2" }, "dependencies": { "inherits": { @@ -1948,8 +1947,8 @@ "integrity": "sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0=", "dev": true, "requires": { - "browserify-sha3": "^0.0.1", - "sha3": "^1.1.0" + "browserify-sha3": "0.0.1", + "sha3": "1.2.2" } }, "klaw": { @@ -1958,7 +1957,7 @@ "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "dev": true, "requires": { - "graceful-fs": "^4.1.9" + "graceful-fs": "4.1.11" } }, "lcid": { @@ -1967,7 +1966,7 @@ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { - "invert-kv": "^1.0.0" + "invert-kv": "1.0.0" } }, "levn": { @@ -1976,8 +1975,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" } }, "load-json-file": { @@ -1986,11 +1985,11 @@ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" } }, "locate-path": { @@ -1999,8 +1998,8 @@ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "p-locate": "2.0.0", + "path-exists": "3.0.0" }, "dependencies": { "path-exists": { @@ -2035,8 +2034,8 @@ "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "pseudomap": "1.0.2", + "yallist": "2.1.2" } }, "make-dir": { @@ -2045,7 +2044,7 @@ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { - "pify": "^3.0.0" + "pify": "3.0.0" }, "dependencies": { "pify": { @@ -2062,13 +2061,13 @@ "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", "dev": true, "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" + "hash-base": "3.0.4", + "inherits": "2.0.1" } }, "media-typer": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, @@ -2078,7 +2077,7 @@ "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { - "mimic-fn": "^1.0.0" + "mimic-fn": "1.2.0" } }, "memorystream": { @@ -2105,8 +2104,8 @@ "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" + "bn.js": "4.11.8", + "brorand": "1.1.0" } }, "mime": { @@ -2127,7 +2126,7 @@ "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", "dev": true, "requires": { - "mime-db": "~1.36.0" + "mime-db": "1.36.0" } }, "mimic-fn": { @@ -2148,7 +2147,7 @@ "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", "dev": true, "requires": { - "dom-walk": "^0.1.0" + "dom-walk": "0.1.1" } }, "minimalistic-assert": { @@ -2169,7 +2168,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -2201,7 +2200,7 @@ "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", "dev": true, "requires": { - "mkdirp": "*" + "mkdirp": "0.5.1" } }, "mocha": { @@ -2234,12 +2233,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "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" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "has-flag": { @@ -2254,7 +2253,7 @@ "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", "dev": true, "requires": { - "has-flag": "^2.0.0" + "has-flag": "2.0.0" } } } @@ -2283,9 +2282,9 @@ "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "dev": true, "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" + "any-promise": "1.3.0", + "object-assign": "4.1.1", + "thenify-all": "1.6.0" } }, "nan": { @@ -2312,7 +2311,7 @@ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1" + "abbrev": "1.0.9" } }, "normalize-package-data": { @@ -2321,10 +2320,10 @@ "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" + "hosted-git-info": "2.7.1", + "is-builtin-module": "1.0.0", + "semver": "5.5.1", + "validate-npm-package-license": "3.0.4" } }, "npm-run-path": { @@ -2333,7 +2332,7 @@ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { - "path-key": "^2.0.0" + "path-key": "2.0.1" } }, "number-is-nan": { @@ -2378,7 +2377,7 @@ "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", "dev": true, "requires": { - "http-https": "^1.0.0" + "http-https": "1.0.0" } }, "on-finished": { @@ -2396,7 +2395,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1" + "wrappy": "1.0.2" } }, "optimist": { @@ -2405,8 +2404,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" + "minimist": "0.0.10", + "wordwrap": "0.0.3" }, "dependencies": { "wordwrap": { @@ -2423,12 +2422,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "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" + "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" } }, "original-require": { @@ -2443,7 +2442,7 @@ "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "dev": true, "requires": { - "lcid": "^1.0.0" + "lcid": "1.0.0" } }, "p-cancelable": { @@ -2464,7 +2463,7 @@ "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "p-try": "^1.0.0" + "p-try": "1.0.0" } }, "p-locate": { @@ -2473,7 +2472,7 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "^1.1.0" + "p-limit": "1.3.0" } }, "p-timeout": { @@ -2482,7 +2481,7 @@ "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", "dev": true, "requires": { - "p-finally": "^1.0.0" + "p-finally": "1.0.0" } }, "p-try": { @@ -2497,11 +2496,11 @@ "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "dev": true, "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3" + "asn1.js": "4.10.1", + "browserify-aes": "1.2.0", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.16" } }, "parse-headers": { @@ -2510,7 +2509,7 @@ "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", "dev": true, "requires": { - "for-each": "^0.3.2", + "for-each": "0.3.3", "trim": "0.0.1" } }, @@ -2520,7 +2519,7 @@ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "^1.2.0" + "error-ex": "1.3.2" } }, "parseurl": { @@ -2535,12 +2534,12 @@ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { - "pinkie-promise": "^2.0.0" + "pinkie-promise": "2.0.1" } }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, @@ -2562,9 +2561,9 @@ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" } }, "pbkdf2": { @@ -2573,11 +2572,11 @@ "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", "dev": true, "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" } }, "pegjs": { @@ -2600,7 +2599,7 @@ }, "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, @@ -2616,7 +2615,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "^2.0.0" + "pinkie": "2.0.4" } }, "prelude-ls": { @@ -2649,7 +2648,7 @@ "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", "dev": true, "requires": { - "forwarded": "~0.1.2", + "forwarded": "0.1.2", "ipaddr.js": "1.8.0" } }, @@ -2671,11 +2670,11 @@ "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", "dev": true, "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1" + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "parse-asn1": "5.1.1", + "randombytes": "2.0.6" } }, "punycode": { @@ -2692,13 +2691,13 @@ }, "query-string": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "resolved": "http://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "dev": true, "requires": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" + "decode-uri-component": "0.2.0", + "object-assign": "4.1.1", + "strict-uri-encode": "1.1.0" } }, "randombytes": { @@ -2707,7 +2706,7 @@ "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", "dev": true, "requires": { - "safe-buffer": "^5.1.0" + "safe-buffer": "5.1.2" } }, "randomfill": { @@ -2716,8 +2715,8 @@ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" + "randombytes": "2.0.6", + "safe-buffer": "5.1.2" } }, "randomhex": { @@ -2750,9 +2749,9 @@ "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" } }, "read-pkg-up": { @@ -2761,8 +2760,8 @@ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" + "find-up": "1.1.2", + "read-pkg": "1.1.0" } }, "readable-stream": { @@ -2771,13 +2770,13 @@ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { - "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" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" }, "dependencies": { "inherits": { @@ -2794,25 +2793,25 @@ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "resolve": "^1.1.6" + "resolve": "1.1.7" } }, "req-cwd": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/req-cwd/-/req-cwd-1.0.1.tgz", "integrity": "sha1-DXOurpJm5penj3l2AZZ352rPD/8=", "dev": true, "requires": { - "req-from": "^1.0.1" + "req-from": "1.0.1" } }, "req-from": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/req-from/-/req-from-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/req-from/-/req-from-1.0.1.tgz", "integrity": "sha1-v4HaUUeUfTLRO5R9wSpYrUWHNQ4=", "dev": true, "requires": { - "resolve-from": "^2.0.0" + "resolve-from": "2.0.0" } }, "request": { @@ -2821,26 +2820,26 @@ "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "dev": true, "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" + "aws-sign2": "0.7.0", + "aws4": "1.8.0", + "caseless": "0.12.0", + "combined-stream": "1.0.7", + "extend": "3.0.2", + "forever-agent": "0.6.1", + "form-data": "2.3.2", + "har-validator": "5.1.0", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.20", + "oauth-sign": "0.9.0", + "performance-now": "2.1.0", + "qs": "6.5.2", + "safe-buffer": "5.1.2", + "tough-cookie": "2.4.3", + "tunnel-agent": "0.6.0", + "uuid": "3.3.2" } }, "require-directory": { @@ -2879,7 +2878,7 @@ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "7.1.3" }, "dependencies": { "glob": { @@ -2888,12 +2887,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "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" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } } } @@ -2904,8 +2903,8 @@ "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" + "hash-base": "3.0.4", + "inherits": "2.0.1" } }, "rlp": { @@ -2914,7 +2913,7 @@ "integrity": "sha512-93U7IKH5j7nmXFVg19MeNBGzQW5uXW1pmCuKY8veeKIhYTE32C2d0mOegfiIAfXcHOKJjjPlJisn8iHDF5AezA==", "dev": true, "requires": { - "safe-buffer": "^5.1.1" + "safe-buffer": "5.1.2" } }, "safe-buffer": { @@ -2935,12 +2934,12 @@ "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", "dev": true, "requires": { - "nan": "^2.0.8" + "nan": "2.11.0" } }, "scrypt-js": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "resolved": "http://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", "dev": true }, @@ -2950,8 +2949,8 @@ "integrity": "sha1-r40UZbcemZARC+38WTuUeeA6ito=", "dev": true, "requires": { - "scrypt": "^6.0.2", - "scryptsy": "^1.2.1" + "scrypt": "6.0.3", + "scryptsy": "1.2.1" } }, "scryptsy": { @@ -2960,7 +2959,7 @@ "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", "dev": true, "requires": { - "pbkdf2": "^3.0.3" + "pbkdf2": "3.0.16" } }, "seek-bzip": { @@ -2969,7 +2968,7 @@ "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", "dev": true, "requires": { - "commander": "~2.8.1" + "commander": "2.8.1" }, "dependencies": { "commander": { @@ -2978,7 +2977,7 @@ "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "dev": true, "requires": { - "graceful-readlink": ">= 1.0.0" + "graceful-readlink": "1.0.1" } } } @@ -2996,18 +2995,18 @@ "dev": true, "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.3", "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": { @@ -3033,9 +3032,9 @@ "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "dev": true, "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" } }, @@ -3045,11 +3044,11 @@ "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", "dev": true, "requires": { - "body-parser": "^1.16.0", - "cors": "^2.8.1", - "express": "^4.14.0", - "request": "^2.79.0", - "xhr": "^2.3.3" + "body-parser": "1.18.3", + "cors": "2.8.4", + "express": "4.16.3", + "request": "2.88.0", + "xhr": "2.5.0" } }, "set-blocking": { @@ -3076,8 +3075,8 @@ "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.1", + "safe-buffer": "5.1.2" } }, "sha3": { @@ -3091,7 +3090,7 @@ "dependencies": { "nan": { "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "resolved": "http://registry.npmjs.org/nan/-/nan-2.10.0.tgz", "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "dev": true } @@ -3103,7 +3102,7 @@ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "1.0.0" } }, "shebang-regex": { @@ -3118,9 +3117,9 @@ "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" + "glob": "7.1.3", + "interpret": "1.1.0", + "rechoir": "0.6.2" }, "dependencies": { "glob": { @@ -3129,12 +3128,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "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" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } } } @@ -3157,9 +3156,9 @@ "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", "dev": true, "requires": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" + "decompress-response": "3.3.0", + "once": "1.4.0", + "simple-concat": "1.0.0" } }, "sol-explore": { @@ -3174,12 +3173,12 @@ "integrity": "sha512-mdLHDl9WeYrN+FIKcMc9PlPfnA9DG9ur5QpCDKcv6VC4RINAsTF4EMuXMZMKoQTvZhtLyJIVH/BZ+KU830Z8Xg==", "dev": true, "requires": { - "fs-extra": "^0.30.0", - "keccak": "^1.0.2", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", - "yargs": "^11.0.0" + "fs-extra": "0.30.0", + "keccak": "1.4.0", + "memorystream": "0.3.1", + "require-from-string": "2.0.2", + "semver": "5.5.1", + "yargs": "11.1.0" }, "dependencies": { "ansi-regex": { @@ -3293,16 +3292,16 @@ "integrity": "sha512-qikdsSi6+9XbfvwA0aI7HUVpF9fIFNqRWTw23M89GMDY+b6Gj0wWU9IngJS0fimoZIAdEp3bfChxvpfVcrUesg==", "dev": true, "requires": { - "death": "^1.1.0", + "death": "1.1.0", "ethereumjs-testrpc-sc": "6.1.6", - "istanbul": "^0.4.5", - "keccakjs": "^0.2.1", - "req-cwd": "^1.0.1", - "shelljs": "^0.7.4", - "sol-explore": "^1.6.2", + "istanbul": "0.4.5", + "keccakjs": "0.2.1", + "req-cwd": "1.0.1", + "shelljs": "0.7.8", + "sol-explore": "1.6.2", "solidity-parser-sc": "0.4.11", - "tree-kill": "^1.2.0", - "web3": "^0.18.4" + "tree-kill": "1.2.0", + "web3": "0.18.4" }, "dependencies": { "solidity-parser-sc": { @@ -3311,9 +3310,9 @@ "integrity": "sha512-1kV5iC7m3CtMDfmHaVNwz2saSGQVIuF16rIxU417Al38MVCWHMQQ5vT6cmLsNwDe60S74auobWij9vNawSeOyw==", "dev": true, "requires": { - "mocha": "^4.1.0", - "pegjs": "^0.10.0", - "yargs": "^4.6.0" + "mocha": "4.1.0", + "pegjs": "0.10.0", + "yargs": "4.8.1" } }, "web3": { @@ -3323,10 +3322,10 @@ "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": "*" + "crypto-js": "3.1.8", + "utf8": "2.1.2", + "xhr2": "0.1.4", + "xmlhttprequest": "1.8.0" } } } @@ -3337,9 +3336,9 @@ "integrity": "sha512-t7tvtR6KU6QfPYLMv1nlCh9DA8HYIu5tbjHpKu0fhGFZ1NuSp0KKDHfFHv07g6v1xgcuUY3rVqNFjZt5b9+5qA==", "dev": true, "requires": { - "mocha": "^4.0.1", - "pegjs": "^0.10.0", - "yargs": "^10.0.3" + "mocha": "4.1.0", + "pegjs": "0.10.0", + "yargs": "10.1.2" }, "dependencies": { "ansi-regex": { @@ -3360,9 +3359,9 @@ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" } }, "find-up": { @@ -3371,7 +3370,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "^2.0.0" + "locate-path": "2.0.0" } }, "is-fullwidth-code-point": { @@ -3386,9 +3385,9 @@ "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "dev": true, "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" } }, "string-width": { @@ -3397,8 +3396,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": { @@ -3407,7 +3406,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "3.0.0" } }, "which-module": { @@ -3422,18 +3421,18 @@ "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", "dev": true, "requires": { - "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": "^8.1.0" + "cliui": "4.1.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.3", + "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": "8.1.0" } }, "yargs-parser": { @@ -3442,7 +3441,7 @@ "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", "dev": true, "requires": { - "camelcase": "^4.1.0" + "camelcase": "4.1.0" } } } @@ -3459,8 +3458,8 @@ "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "buffer-from": "1.1.1", + "source-map": "0.6.1" } }, "spdx-correct": { @@ -3469,8 +3468,8 @@ "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.1" } }, "spdx-exceptions": { @@ -3485,8 +3484,8 @@ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.1" } }, "spdx-license-ids": { @@ -3507,15 +3506,15 @@ "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", "dev": true, "requires": { - "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", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" + "asn1": "0.2.4", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.2", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.2", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "safer-buffer": "2.1.2", + "tweetnacl": "0.14.5" } }, "statuses": { @@ -3536,27 +3535,27 @@ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" } }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "5.1.2" } }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "2.1.1" } }, "strip-bom": { @@ -3565,7 +3564,7 @@ "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { - "is-utf8": "^0.2.0" + "is-utf8": "0.2.1" } }, "strip-dirs": { @@ -3574,12 +3573,12 @@ "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", "dev": true, "requires": { - "is-natural-number": "^4.0.1" + "is-natural-number": "4.0.1" } }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, @@ -3598,7 +3597,7 @@ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "dev": true, "requires": { - "has-flag": "^1.0.0" + "has-flag": "1.0.0" } }, "swarm-js": { @@ -3607,19 +3606,19 @@ "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", "dev": true, "requires": { - "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" + "bluebird": "3.5.2", + "buffer": "5.2.1", + "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.20", + "mkdirp-promise": "5.0.1", + "mock-fs": "4.7.0", + "setimmediate": "1.0.5", + "tar.gz": "1.0.7", + "xhr-request-promise": "0.1.2" }, "dependencies": { "fs-extra": { @@ -3628,21 +3627,21 @@ "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0" + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0" } } } }, "tar": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.1" } }, "tar-stream": { @@ -3651,13 +3650,13 @@ "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", "dev": true, "requires": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", - "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" + "bl": "1.2.2", + "buffer-alloc": "1.2.0", + "end-of-stream": "1.4.1", + "fs-constants": "1.0.0", + "readable-stream": "2.3.6", + "to-buffer": "1.1.1", + "xtend": "4.0.1" } }, "tar.gz": { @@ -3666,11 +3665,11 @@ "integrity": "sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg==", "dev": true, "requires": { - "bluebird": "^2.9.34", - "commander": "^2.8.1", - "fstream": "^1.0.8", - "mout": "^0.11.0", - "tar": "^2.1.1" + "bluebird": "2.11.0", + "commander": "2.17.1", + "fstream": "1.0.11", + "mout": "0.11.1", + "tar": "2.2.1" }, "dependencies": { "bluebird": { @@ -3687,7 +3686,7 @@ "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", "dev": true, "requires": { - "any-promise": "^1.0.0" + "any-promise": "1.3.0" } }, "thenify-all": { @@ -3696,7 +3695,7 @@ "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", "dev": true, "requires": { - "thenify": ">= 3.1.0 < 4" + "thenify": "3.3.0" } }, "through": { @@ -3723,8 +3722,8 @@ "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" + "psl": "1.1.29", + "punycode": "1.4.1" } }, "tree-kill": { @@ -3745,9 +3744,9 @@ "integrity": "sha512-D15MsJeKWRNxbx2Vmy50gH8z4gjBYecJIUADBBBL593hkVnhZ1ADgkIujCvvrbD6Pj69Vg5Ky/nJXl7M9TCjsg==", "dev": true, "requires": { - "mocha": "^4.1.0", + "mocha": "4.1.0", "original-require": "1.0.1", - "solc": "^0.5.0" + "solc": "0.5.0" } }, "tunnel-agent": { @@ -3756,7 +3755,7 @@ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "requires": { - "safe-buffer": "^5.0.1" + "safe-buffer": "5.1.2" } }, "tweetnacl": { @@ -3772,7 +3771,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "1.1.2" } }, "type-is": { @@ -3782,7 +3781,7 @@ "dev": true, "requires": { "media-typer": "0.3.0", - "mime-types": "~2.1.18" + "mime-types": "2.1.20" } }, "typedarray-to-buffer": { @@ -3791,7 +3790,7 @@ "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, "requires": { - "is-typedarray": "^1.0.0" + "is-typedarray": "1.0.0" } }, "uglify-js": { @@ -3801,8 +3800,8 @@ "dev": true, "optional": true, "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" + "commander": "2.17.1", + "source-map": "0.6.1" } }, "ultron": { @@ -3817,8 +3816,8 @@ "integrity": "sha512-kE2WkurNnPUMcryNioS68DDbhoPB8Qxsd8btHSj+sd5Pjh2GsjmeHLzMSqV9HHziAo8FzVxVCJl9ZYhk7yY1pA==", "dev": true, "requires": { - "buffer": "^3.0.1", - "through": "^2.3.6" + "buffer": "3.6.0", + "through": "2.3.8" }, "dependencies": { "base64-js": { @@ -3858,7 +3857,7 @@ "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "dev": true, "requires": { - "prepend-http": "^1.0.1" + "prepend-http": "1.0.4" } }, "url-set-query": { @@ -3875,13 +3874,13 @@ }, "utf8": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", + "resolved": "http://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=", "dev": true }, "util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -3912,8 +3911,8 @@ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" } }, "vary": { @@ -3928,9 +3927,9 @@ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { - "assert-plus": "^1.0.0", + "assert-plus": "1.0.0", "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "extsprintf": "1.3.0" } }, "web3": { @@ -4085,14 +4084,14 @@ "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", "dev": true, "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" + "bn.js": "4.11.8", + "elliptic": "6.4.1", + "xhr-request-promise": "0.1.2" } }, "uuid": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "resolved": "http://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", "dev": true } @@ -4239,7 +4238,7 @@ }, "utf8": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", + "resolved": "http://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", "integrity": "sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g=", "dev": true } @@ -4247,13 +4246,12 @@ }, "websocket": { "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", - "from": "websocket@git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", "dev": true, "requires": { - "debug": "^2.2.0", - "nan": "^2.3.3", - "typedarray-to-buffer": "^3.1.2", - "yaeti": "^0.0.6" + "debug": "2.6.9", + "nan": "2.11.0", + "typedarray-to-buffer": "3.1.5", + "yaeti": "0.0.6" }, "dependencies": { "debug": { @@ -4273,7 +4271,7 @@ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "^2.0.0" + "isexe": "2.0.0" } }, "which-module": { @@ -4300,8 +4298,8 @@ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "string-width": "1.0.2", + "strip-ansi": "3.0.1" } }, "wrappy": { @@ -4316,9 +4314,9 @@ "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "dev": true, "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" + "async-limiter": "1.0.0", + "safe-buffer": "5.1.2", + "ultron": "1.1.1" } }, "xhr": { @@ -4327,10 +4325,10 @@ "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", "dev": true, "requires": { - "global": "~4.3.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" + "global": "4.3.2", + "is-function": "1.0.1", + "parse-headers": "2.0.1", + "xtend": "4.0.1" } }, "xhr-request": { @@ -4339,13 +4337,13 @@ "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", "dev": true, "requires": { - "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" + "buffer-to-arraybuffer": "0.0.5", + "object-assign": "4.1.1", + "query-string": "5.1.1", + "simple-get": "2.8.1", + "timed-out": "4.0.1", + "url-set-query": "1.0.0", + "xhr": "2.5.0" } }, "xhr-request-promise": { @@ -4354,7 +4352,7 @@ "integrity": "sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0=", "dev": true, "requires": { - "xhr-request": "^1.0.1" + "xhr-request": "1.1.0" } }, "xhr2": { @@ -4369,7 +4367,7 @@ "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", "dev": true, "requires": { - "cookiejar": "^2.1.1" + "cookiejar": "2.1.2" } }, "xmlhttprequest": { @@ -4408,30 +4406,30 @@ "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", "dev": true, "requires": { - "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" + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.3", + "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" } }, "yargs-parser": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "resolved": "http://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", "dev": true, "requires": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" + "camelcase": "3.0.0", + "lodash.assign": "4.2.0" } }, "yauzl": { @@ -4440,8 +4438,8 @@ "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", "dev": true, "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" + "buffer-crc32": "0.2.13", + "fd-slicer": "1.1.0" } } } diff --git a/test/gateway/eip20_cogateway/helpers/helper.js b/test/gateway/eip20_cogateway/helpers/helper.js index 02e87a17..1005f336 100644 --- a/test/gateway/eip20_cogateway/helpers/helper.js +++ b/test/gateway/eip20_cogateway/helpers/helper.js @@ -1,3 +1,23 @@ +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ---------------------------------------------------------------------------- +// +// http://www.simpletoken.org/ +// +// ---------------------------------------------------------------------------- + 'use strict'; const web3 = require('../../../test_lib/web3.js'); @@ -12,23 +32,21 @@ EIP20CoGatewayHelper.prototype = { /** * It sets the cogateway address. */ - setGateway: async function(coGateway) { + setCoGateway: async function(coGateway) { this.coGateway = coGateway; }, /** - * Generate the stake type hash. This is as per EIP-712 + * Generate the stake type hash. This is as per EIP-712. * * @return {string} message type hash. */ redeemTypeHash: async function() { return web3.utils.soliditySha3( - web3.eth.abi.encodeParameter( 'string', 'Redeem(uint256 amount,address beneficiary,MessageBus.Message message)' - ) ); }, @@ -66,8 +84,8 @@ EIP20CoGatewayHelper.prototype = { }, getNonce: async function (address) { - const oThis = this; - return await oThis.coGateway.getNonce.call(address); + + return await this.coGateway.getNonce.call(address); } }; diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index 457ad029..2777c937 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -20,8 +20,7 @@ const BN = require('bn.js'), Utils = require("../../test_lib/utils"), - EIP20CoGatewayHelper = require("./helpers/helper"); - EIP20CoGateway = artifacts.require('EIP20CoGateway'), + EIP20CoGatewayHelper = require("./helpers/helper"), MockSafeCore = artifacts.require('MockSafeCore'), MessageBus = artifacts.require('MessageBus'), UtilityToken = artifacts.require('UtilityToken'), @@ -29,12 +28,11 @@ const BN = require('bn.js'), TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), MockUtilityToken = artifacts.require('MockUtilityToken'); -let eip20CoGateway, - stateRoot = "0x70b4172eb30c495bf20b5b12224cd2380fccdd7ffa2292416b9dbdfc8511585d", +let stateRoot = "0x70b4172eb30c495bf20b5b12224cd2380fccdd7ffa2292416b9dbdfc8511585d", valueToken, mockSafeCore, organization, - gateway, + coGateway, utilityToken, bountyAmount, owner, @@ -59,7 +57,7 @@ async function _setup(accounts) { valueToken = accounts[0]; mockSafeCore = await MockSafeCore.new(1, 2, stateRoot, accounts[1]); organization = accounts[2]; - gateway = accounts[3]; + coGateway = accounts[3]; owner = accounts[8]; utilityToken = await MockUtilityToken.new( symbol, @@ -72,19 +70,11 @@ async function _setup(accounts) { stakerBalance = new BN(1000000); rewardAmount = new BN(100); - eip20CoGateway = await EIP20CoGateway.new( - valueToken, - utilityToken.address, - mockSafeCore.address, - bountyAmount, - organization, - gateway, - ); - } +} contract('EIP20CoGateway.progressMint() ', function (accounts) { - let amount = new BN(100), + let amount = new BN(200), beneficiary = accounts[4], gasPrice = new BN(10), gasLimit = new BN(10), @@ -95,13 +85,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { facilitator = accounts[5], intentHash, testEIP20CoGateway; - helper = new EIP20CoGatewayHelper(); + helper = new EIP20CoGatewayHelper(); beforeEach(async function () { await _setup(accounts); - amount = new BN(100); - await helper.setGateway(eip20CoGateway.address); + amount = new BN(200); + intentHash = await helper.hashRedeemIntent( amount, beneficiary, @@ -117,9 +107,12 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { mockSafeCore.address, bountyAmount, organization, - gateway, + coGateway, ); + await utilityToken.setCoGateway(testEIP20CoGateway.address); + await helper.setCoGateway(testEIP20CoGateway.address); + }); it('should pass when facilitator is rewarded', async function () { @@ -145,13 +138,14 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { MessageStatusEnum.Declared, ); await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); - + let progressMintValues = await testEIP20CoGateway.progressMint.call( messageHash, unlockSecret, - {from : facilitator}, + {from: facilitator}, ); - let expectedMintedToken = new BN(0), + + let expectedMintedToken = new BN(100), expectedReward = new BN(100); assert.strictEqual( @@ -159,46 +153,69 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { beneficiary, "Incorrect beneficiary address", ); - + assert.strictEqual( amount.eq(progressMintValues.stakeAmount_), true, "Incorrect staked amount", ); - + assert.strictEqual( expectedMintedToken.eq(progressMintValues.mintedAmount_), true, "Incorrect minted amount", ); - + assert.strictEqual( expectedReward.eq(progressMintValues.rewardAmount_), true, "Incorrect reward to facilitator", ); - await testEIP20CoGateway.progressMint( + let response = await testEIP20CoGateway.progressMint( messageHash, unlockSecret, - {from : facilitator}, + {from: facilitator}, ); + let facilitatorBalance = await utilityToken.balanceOf(facilitator); + let beneficiaryBalance = await utilityToken.balanceOf(beneficiary); + assert.strictEqual( - (await utilityToken.beneficiary()), - facilitator, - "Facilitator address is incorrect", + facilitatorBalance.eq(expectedReward), + true, + 'Facilitator didnt receive reward' ); - + assert.strictEqual( - (await utilityToken.amount()).eq(rewardAmount), + beneficiaryBalance.eq(new BN(amount - expectedReward)), true, - "Facilitator address is incorrect", + 'Minting is not done for beneficiary' + ); + + let expectedEvent = { + MintProgressed: { + _messageHash: messageHash, + _staker: staker, + _stakeAmount: amount, + _mintedAmount: expectedMintedToken, + _rewardAmount: expectedReward, + _proofProgress: true, + _unlockSecret: unlockSecret + } + }; + + assert.equal( + response.receipt.status, + 1, + "Receipt status is unsuccessful" ); + + let eventData = response.logs; + await Utils.validateEvents(eventData, expectedEvent); }); - it('should not mint reward for zero reward amount', async function () { gasPrice = new BN(0); @@ -229,13 +246,22 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { await testEIP20CoGateway.progressMint( messageHash, unlockSecret, - {from : facilitator}, + {from: facilitator}, ); - assert.notStrictEqual( - (await utilityToken.beneficiary()), - facilitator, - "Facilitator address is not correct", + let facilitatorBalance = await utilityToken.balanceOf(facilitator); + let beneficiaryBalance = await utilityToken.balanceOf(beneficiary); + + assert.strictEqual( + beneficiaryBalance.eq(amount), + true, + 'Balance for beneficiary should be ${amount}' + ); + + assert.strictEqual( + facilitatorBalance.eq(new BN(0)), + true, + 'Facilitator should not receive reward' ); }); From c06ddd962324174471ec2daf6be1197bfab6412b Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Thu, 13 Dec 2018 12:10:59 +0530 Subject: [PATCH 13/24] Added test case when message hash is zero --- contracts/gateway/EIP20CoGateway.sol | 2 +- test/gateway/eip20_cogateway/progress_mint.js | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index 334f66dc..e047aacf 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -281,7 +281,7 @@ contract EIP20CoGateway is GatewayBase { require( _messageHash != bytes32(0), - "Message hash must not be zero" + "Message hash must not be zero." ); MessageBus.Message storage message = messages[_messageHash]; diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index 2777c937..7c823948 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -266,4 +266,43 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { }); + it('should fail when messagehash is zero', async function () { + + let messageHash = await testEIP20CoGateway.setStakeMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setStakeMessage( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Declared, + ); + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + const zeroBytes = + "0x0000000000000000000000000000000000000000000000000000000000000000"; + + messageHash = zeroBytes; + + await Utils.expectRevert(testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + "Message hash must not be zero." + ); + + }); + }); From 695b646589347ba4044b2c4cac917f25cc49e9fd Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Fri, 14 Dec 2018 00:38:57 +0530 Subject: [PATCH 14/24] Added test-cases --- contracts/gateway/MessageBus.sol | 4 +- contracts/test/TestEIP20Gateway.sol | 2 +- test/gateway/eip20_cogateway/progress_mint.js | 223 ++++++++++++++++-- 3 files changed, 209 insertions(+), 20 deletions(-) diff --git a/contracts/gateway/MessageBus.sol b/contracts/gateway/MessageBus.sol index 277f284d..03e084a3 100644 --- a/contracts/gateway/MessageBus.sol +++ b/contracts/gateway/MessageBus.sol @@ -359,7 +359,7 @@ library MessageBus { // verify the unlock secret require( _message.hashLock == keccak256(abi.encode(_unlockSecret)), - "Invalid unlock secret" + "Invalid unlock secret." ); // Get the message hash @@ -374,7 +374,7 @@ library MessageBus { // Verify the current message status is `Declared` require( _messageBox.inbox[messageHash_] == MessageStatus.Declared, - "Message status must be Declared" + "Message status must be Declared." ); // Update the message status of outbox to `Progressed` diff --git a/contracts/test/TestEIP20Gateway.sol b/contracts/test/TestEIP20Gateway.sol index 27e91654..1be857b4 100644 --- a/contracts/test/TestEIP20Gateway.sol +++ b/contracts/test/TestEIP20Gateway.sol @@ -48,7 +48,7 @@ contract TestEIP20Gateway is EIP20Gateway { StateRootInterface _core, uint256 _bounty, IsMemberInterface _membersManager, - address _burner +` address payable _burner ) EIP20Gateway( _token, diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index 7c823948..0a55b0b8 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -28,8 +28,8 @@ const BN = require('bn.js'), TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), MockUtilityToken = artifacts.require('MockUtilityToken'); -let stateRoot = "0x70b4172eb30c495bf20b5b12224cd2380fccdd7ffa2292416b9dbdfc8511585d", - valueToken, +let valueToken, + burner, mockSafeCore, organization, coGateway, @@ -44,6 +44,9 @@ let stateRoot = "0x70b4172eb30c495bf20b5b12224cd2380fccdd7ffa2292416b9dbdfc85115 decimals = 18, helper; +const zeroBytes = + "0x0000000000000000000000000000000000000000000000000000000000000000"; + let MessageStatusEnum = { Undeclared: 0, Declared: 1, @@ -55,7 +58,8 @@ let MessageStatusEnum = { async function _setup(accounts) { valueToken = accounts[0]; - mockSafeCore = await MockSafeCore.new(1, 2, stateRoot, accounts[1]); + burner = accounts[10]; + mockSafeCore = accounts[11]; organization = accounts[2]; coGateway = accounts[3]; owner = accounts[8]; @@ -80,10 +84,10 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { gasLimit = new BN(10), nonce = new BN(1), hashLockObj = Utils.generateHashLock(), - hashLock = hashLockObj.l, - unlockSecret = hashLockObj.s, facilitator = accounts[5], intentHash, + hashLock, + unlockSecret, testEIP20CoGateway; helper = new EIP20CoGatewayHelper(); @@ -104,14 +108,17 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { testEIP20CoGateway = await TestEIP20CoGateway.new( valueToken, utilityToken.address, - mockSafeCore.address, + mockSafeCore, bountyAmount, organization, coGateway, + burner, ); await utilityToken.setCoGateway(testEIP20CoGateway.address); await helper.setCoGateway(testEIP20CoGateway.address); + hashLock = hashLockObj.l; + unlockSecret = hashLockObj.s; }); @@ -192,7 +199,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { true, 'Minting is not done for beneficiary' ); - + let expectedEvent = { MintProgressed: { _messageHash: messageHash, @@ -204,13 +211,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { _unlockSecret: unlockSecret } }; - + assert.equal( response.receipt.status, 1, "Receipt status is unsuccessful" ); - + let eventData = response.logs; await Utils.validateEvents(eventData, expectedEvent); @@ -255,13 +262,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { assert.strictEqual( beneficiaryBalance.eq(amount), true, - 'Balance for beneficiary should be ${amount}' + 'Balance for beneficiary should be ${amount}', ); assert.strictEqual( facilitatorBalance.eq(new BN(0)), true, - 'Facilitator should not receive reward' + 'Facilitator should not receive reward', ); }); @@ -289,20 +296,202 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { MessageStatusEnum.Declared, ); await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); - - const zeroBytes = - "0x0000000000000000000000000000000000000000000000000000000000000000"; messageHash = zeroBytes; - await Utils.expectRevert(testEIP20CoGateway.progressMint( + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + "Message hash must not be zero.", + ); + + }); + + it('should fail when status of the messagehash is declared revocation', async function () { + + let messageHash = await testEIP20CoGateway.setStakeMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setStakeMessage( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.DeclaredRevocation, + ); + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + "Message status must be Declared." + ); + + }); + + it('should fail when status of the messagehash is revoked', async function () { + + let messageHash = await testEIP20CoGateway.setStakeMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setStakeMessage( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Revoked, + ); + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + "Message status must be Declared." + ); + + }); + + it('should fail when status of the messagehash is undeclared', async function () { + + let messageHash = await testEIP20CoGateway.setStakeMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setStakeMessage( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Undeclared, + ); + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + "Message status must be Declared." + ); + + }); + + it('should fail when unlock provided is zero', async function () { + + let messageHash = await testEIP20CoGateway.setStakeMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setStakeMessage( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Undeclared, + ); + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + unlockSecret = zeroBytes; + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + "Invalid unlock secret." + ); + + }); + + it('should fail when message status is already progressed', async function () { + + let messageHash = await testEIP20CoGateway.setStakeMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setStakeMessage( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Declared, + ); + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + await testEIP20CoGateway.progressMint( messageHash, unlockSecret, {from: facilitator}, + ); + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, ), - "Message hash must not be zero." + "Message status must be Declared.", ); - + }); + }); From 15c32c69df72bab8506ff861e49c4337e6fba903 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Fri, 14 Dec 2018 13:32:42 +0530 Subject: [PATCH 15/24] Renamed the MockUtilityToken to TestUtilityToken,added documentation and moved the setting up of message in before each --- contracts/test/TestEIP20CoGateway.sol | 2 +- contracts/test/TestEIP20Gateway.sol | 2 +- ...kUtilityToken.sol => TestUtilityToken.sol} | 6 +- .../gateway/eip20_cogateway/helpers/helper.js | 42 ++-- test/gateway/eip20_cogateway/progress_mint.js | 191 +++++------------- 5 files changed, 78 insertions(+), 165 deletions(-) rename contracts/test/{MockUtilityToken.sol => TestUtilityToken.sol} (94%) diff --git a/contracts/test/TestEIP20CoGateway.sol b/contracts/test/TestEIP20CoGateway.sol index 27999e40..4e0a4a75 100644 --- a/contracts/test/TestEIP20CoGateway.sol +++ b/contracts/test/TestEIP20CoGateway.sol @@ -70,7 +70,7 @@ contract TestEIP20CoGateway is EIP20CoGateway { /* Public Functions */ /** - * @notice It is used to set the message. + * @notice It is used to set the stake message. * * @dev This is used for testing purpose. * diff --git a/contracts/test/TestEIP20Gateway.sol b/contracts/test/TestEIP20Gateway.sol index 1be857b4..f5a3a22e 100644 --- a/contracts/test/TestEIP20Gateway.sol +++ b/contracts/test/TestEIP20Gateway.sol @@ -48,7 +48,7 @@ contract TestEIP20Gateway is EIP20Gateway { StateRootInterface _core, uint256 _bounty, IsMemberInterface _membersManager, -` address payable _burner + address payable _burner ) EIP20Gateway( _token, diff --git a/contracts/test/MockUtilityToken.sol b/contracts/test/TestUtilityToken.sol similarity index 94% rename from contracts/test/MockUtilityToken.sol rename to contracts/test/TestUtilityToken.sol index 084bf44c..e768a5f0 100644 --- a/contracts/test/MockUtilityToken.sol +++ b/contracts/test/TestUtilityToken.sol @@ -1,6 +1,6 @@ pragma solidity ^0.5.0; -// Copyright 2017 OpenST Ltd. +// Copyright 2018 OpenST Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,13 +15,11 @@ pragma solidity ^0.5.0; // limitations under the License. // // ---------------------------------------------------------------------------- -// Auxiliary chain: MockUtilityToken // // http://www.simpletoken.org/ // // ---------------------------------------------------------------------------- - import "../gateway/UtilityToken.sol"; /** @@ -30,7 +28,7 @@ import "../gateway/UtilityToken.sol"; * @notice This is for testing purpose. * */ -contract MockUtilityToken is UtilityToken { +contract TestUtilityToken is UtilityToken { /* Usings */ diff --git a/test/gateway/eip20_cogateway/helpers/helper.js b/test/gateway/eip20_cogateway/helpers/helper.js index 1005f336..73dedc7a 100644 --- a/test/gateway/eip20_cogateway/helpers/helper.js +++ b/test/gateway/eip20_cogateway/helpers/helper.js @@ -23,7 +23,7 @@ const web3 = require('../../../test_lib/web3.js'); -const EIP20CoGatewayHelper = function() { +const EIP20CoGatewayHelper = function () { }; @@ -31,27 +31,28 @@ EIP20CoGatewayHelper.prototype = { /** * It sets the cogateway address. + * @param coGateway CoGateway contract address. */ - setCoGateway: async function(coGateway) { - + setCoGateway: async function (coGateway) { + this.coGateway = coGateway; - + }, /** * Generate the stake type hash. This is as per EIP-712. * - * @return {string} message type hash. + * @return {string} Message type hash. */ - redeemTypeHash: async function() { + redeemTypeHash: async function () { return web3.utils.soliditySha3( - 'string', - 'Redeem(uint256 amount,address beneficiary,MessageBus.Message message)' + 'string', + 'Redeem(uint256 amount,address beneficiary,MessageBus.Message message)' ); }, /** - * Generate the stake intent hash + * Generate the redeem intent hash. * * @param {object} amount Staking amount. * @param {string} beneficiary Beneficiary address. @@ -61,7 +62,7 @@ EIP20CoGatewayHelper.prototype = { * @param {object} gasLimit Gas limit (Big Number). * @param {string} token EIP20 token address. * - * @return {string} redeem intent hash. + * @return {string} Redeem intent hash. */ hashRedeemIntent: async function ( amount, @@ -73,16 +74,23 @@ EIP20CoGatewayHelper.prototype = { token) { return web3.utils.soliditySha3( - { t: 'uint256', v: amount }, - { t: 'address', v: beneficiary }, - { t: 'address', v: redeemer }, - { t: 'uint256', v: nonce }, - { t: 'uint256', v: gasPrice }, - { t: 'uint256', v: gasLimit }, - { t: 'address', v: token } + {t: 'uint256', v: amount}, + {t: 'address', v: beneficiary}, + {t: 'address', v: redeemer}, + {t: 'uint256', v: nonce}, + {t: 'uint256', v: gasPrice}, + {t: 'uint256', v: gasLimit}, + {t: 'address', v: token} ); }, + /** + * It returns the nonce value for the account address. + * + * @param address Account for which nonce is required. + * + * @returns {Promise} Nonce of the address. + */ getNonce: async function (address) { return await this.coGateway.getNonce.call(address); diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index 0a55b0b8..d41a587c 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -19,28 +19,27 @@ // ---------------------------------------------------------------------------- const BN = require('bn.js'), - Utils = require("../../test_lib/utils"), - EIP20CoGatewayHelper = require("./helpers/helper"), + Utils = require('../../test_lib/utils'), + EIP20CoGatewayHelper = require('./helpers/helper'), MockSafeCore = artifacts.require('MockSafeCore'), MessageBus = artifacts.require('MessageBus'), - UtilityToken = artifacts.require('UtilityToken'), EIP20Token = artifacts.require('EIP20Token'), TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), - MockUtilityToken = artifacts.require('MockUtilityToken'); + TestUtilityToken = artifacts.require('TestUtilityToken'); let valueToken, burner, mockSafeCore, - organization, + membersManager, coGateway, - utilityToken, + testUtilityToken, bountyAmount, owner, staker, stakerBalance, rewardAmount, - symbol = "OST", - name = "Simple Token", + symbol = 'OST', + name = 'Simple Token', decimals = 18, helper; @@ -60,10 +59,10 @@ async function _setup(accounts) { valueToken = accounts[0]; burner = accounts[10]; mockSafeCore = accounts[11]; - organization = accounts[2]; + membersManager = accounts[2]; coGateway = accounts[3]; owner = accounts[8]; - utilityToken = await MockUtilityToken.new( + testUtilityToken = await TestUtilityToken.new( symbol, name, decimals, @@ -80,21 +79,26 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { let amount = new BN(200), beneficiary = accounts[4], - gasPrice = new BN(10), - gasLimit = new BN(10), + gasPrice, + gasLimit, nonce = new BN(1), hashLockObj = Utils.generateHashLock(), facilitator = accounts[5], intentHash, hashLock, unlockSecret, - testEIP20CoGateway; + testEIP20CoGateway, + messageHash; helper = new EIP20CoGatewayHelper(); beforeEach(async function () { await _setup(accounts); amount = new BN(200); + hashLock = hashLockObj.l; + unlockSecret = hashLockObj.s; + gasPrice = new BN(10); + gasLimit = new BN(10); intentHash = await helper.hashRedeemIntent( amount, @@ -107,24 +111,18 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { ); testEIP20CoGateway = await TestEIP20CoGateway.new( valueToken, - utilityToken.address, + testUtilityToken.address, mockSafeCore, bountyAmount, - organization, + membersManager, coGateway, burner, ); - await utilityToken.setCoGateway(testEIP20CoGateway.address); + await testUtilityToken.setCoGateway(testEIP20CoGateway.address); await helper.setCoGateway(testEIP20CoGateway.address); - hashLock = hashLockObj.l; - unlockSecret = hashLockObj.s; - - }); - - it('should pass when facilitator is rewarded', async function () { - let messageHash = await testEIP20CoGateway.setStakeMessage.call( + messageHash = await testEIP20CoGateway.setStakeMessage.call( intentHash, nonce, gasPrice, @@ -140,6 +138,11 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { hashLock, staker, ); + + }); + + it('should mint reward to facilitator', async function () { + await testEIP20CoGateway.setInboxStatus( messageHash, MessageStatusEnum.Declared, @@ -158,25 +161,25 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { assert.strictEqual( progressMintValues.beneficiary_, beneficiary, - "Incorrect beneficiary address", + 'Beneficiary address should be ${beneficiary}', ); assert.strictEqual( amount.eq(progressMintValues.stakeAmount_), true, - "Incorrect staked amount", + 'Staked amount should be ${amount}.', ); assert.strictEqual( expectedMintedToken.eq(progressMintValues.mintedAmount_), true, - "Incorrect minted amount", + 'Minted amount should be ${expectedMintedToken}.', ); assert.strictEqual( expectedReward.eq(progressMintValues.rewardAmount_), true, - "Incorrect reward to facilitator", + 'Reward to facilitator should be ${expectedReward}.', ); let response = await testEIP20CoGateway.progressMint( @@ -185,19 +188,19 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { {from: facilitator}, ); - let facilitatorBalance = await utilityToken.balanceOf(facilitator); - let beneficiaryBalance = await utilityToken.balanceOf(beneficiary); + let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); + let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); assert.strictEqual( facilitatorBalance.eq(expectedReward), true, - 'Facilitator didnt receive reward' + 'Facilitator reward should be ${expectedReward}.', ); assert.strictEqual( - beneficiaryBalance.eq(new BN(amount - expectedReward)), + beneficiaryBalance.eq(amount.sub(expectedReward)), true, - 'Minting is not done for beneficiary' + 'Beneficiary balance should be ${amount.sub(expectedReward)}.' ); let expectedEvent = { @@ -215,15 +218,15 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { assert.equal( response.receipt.status, 1, - "Receipt status is unsuccessful" + 'Receipt status is unsuccessful.', ); let eventData = response.logs; - await Utils.validateEvents(eventData, expectedEvent); + Utils.validateEvents(eventData, expectedEvent); }); - it('should not mint reward for zero reward amount', async function () { + it('should not mint reward to facilitator', async function () { gasPrice = new BN(0); @@ -256,8 +259,8 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { {from: facilitator}, ); - let facilitatorBalance = await utilityToken.balanceOf(facilitator); - let beneficiaryBalance = await utilityToken.balanceOf(beneficiary); + let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); + let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); assert.strictEqual( beneficiaryBalance.eq(amount), @@ -268,29 +271,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { assert.strictEqual( facilitatorBalance.eq(new BN(0)), true, - 'Facilitator should not receive reward', + 'Facilitator reward should be zero', ); }); it('should fail when messagehash is zero', async function () { - let messageHash = await testEIP20CoGateway.setStakeMessage.call( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - await testEIP20CoGateway.setStakeMessage( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); await testEIP20CoGateway.setInboxStatus( messageHash, MessageStatusEnum.Declared, @@ -305,29 +292,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - "Message hash must not be zero.", + 'Message hash must not be zero.', ); }); it('should fail when status of the messagehash is declared revocation', async function () { - let messageHash = await testEIP20CoGateway.setStakeMessage.call( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - await testEIP20CoGateway.setStakeMessage( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); await testEIP20CoGateway.setInboxStatus( messageHash, MessageStatusEnum.DeclaredRevocation, @@ -340,29 +311,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - "Message status must be Declared." + 'Message status must be Declared.' ); }); it('should fail when status of the messagehash is revoked', async function () { - let messageHash = await testEIP20CoGateway.setStakeMessage.call( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - await testEIP20CoGateway.setStakeMessage( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); await testEIP20CoGateway.setInboxStatus( messageHash, MessageStatusEnum.Revoked, @@ -375,29 +330,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - "Message status must be Declared." + 'Message status must be Declared.' ); }); it('should fail when status of the messagehash is undeclared', async function () { - let messageHash = await testEIP20CoGateway.setStakeMessage.call( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - await testEIP20CoGateway.setStakeMessage( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); await testEIP20CoGateway.setInboxStatus( messageHash, MessageStatusEnum.Undeclared, @@ -410,29 +349,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - "Message status must be Declared." + 'Message status must be Declared.' ); }); - it('should fail when unlock provided is zero', async function () { + it('should fail when unlock secret is zero', async function () { - let messageHash = await testEIP20CoGateway.setStakeMessage.call( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - await testEIP20CoGateway.setStakeMessage( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); await testEIP20CoGateway.setInboxStatus( messageHash, MessageStatusEnum.Undeclared, @@ -447,29 +370,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - "Invalid unlock secret." + 'Invalid unlock secret.' ); }); it('should fail when message status is already progressed', async function () { - let messageHash = await testEIP20CoGateway.setStakeMessage.call( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - await testEIP20CoGateway.setStakeMessage( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); await testEIP20CoGateway.setInboxStatus( messageHash, MessageStatusEnum.Declared, @@ -488,10 +395,10 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - "Message status must be Declared.", + 'Message status must be Declared.', ); }); - }); + From 6336a6cdbbafe72ff5a7e84e69e2b9f48d491abe Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Mon, 17 Dec 2018 12:51:40 +0530 Subject: [PATCH 16/24] Code cleanup and updated the documentation --- contracts/test/TestUtilityToken.sol | 8 ++--- .../gateway/eip20_cogateway/helpers/helper.js | 4 +-- test/gateway/eip20_cogateway/progress_mint.js | 32 ++++++++----------- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/contracts/test/TestUtilityToken.sol b/contracts/test/TestUtilityToken.sol index e768a5f0..09ac8b9e 100644 --- a/contracts/test/TestUtilityToken.sol +++ b/contracts/test/TestUtilityToken.sol @@ -23,9 +23,9 @@ pragma solidity ^0.5.0; import "../gateway/UtilityToken.sol"; /** - * @title MockUtilityToken contract. + * @title TestUtilityToken contract. * - * @notice This is for testing purpose. + * @notice This is for testing purpose. * */ contract TestUtilityToken is UtilityToken { @@ -55,9 +55,7 @@ contract TestUtilityToken is UtilityToken { ) public UtilityToken(_symbol, _name, _decimals, _valueToken) - { - - } + { } /* External functions */ diff --git a/test/gateway/eip20_cogateway/helpers/helper.js b/test/gateway/eip20_cogateway/helpers/helper.js index 73dedc7a..e22252ce 100644 --- a/test/gateway/eip20_cogateway/helpers/helper.js +++ b/test/gateway/eip20_cogateway/helpers/helper.js @@ -40,7 +40,7 @@ EIP20CoGatewayHelper.prototype = { }, /** - * Generate the stake type hash. This is as per EIP-712. + * Generate the redeem type hash. This is as per EIP-712. * * @return {string} Message type hash. */ @@ -54,7 +54,7 @@ EIP20CoGatewayHelper.prototype = { /** * Generate the redeem intent hash. * - * @param {object} amount Staking amount. + * @param {object} amount Redeem amount. * @param {string} beneficiary Beneficiary address. * @param {string} redeemer Redeemer address. * @param {object} nonce Nonce of staker (Big Number). diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index d41a587c..12bf1ee5 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -21,7 +21,6 @@ const BN = require('bn.js'), Utils = require('../../test_lib/utils'), EIP20CoGatewayHelper = require('./helpers/helper'), - MockSafeCore = artifacts.require('MockSafeCore'), MessageBus = artifacts.require('MessageBus'), EIP20Token = artifacts.require('EIP20Token'), TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), @@ -138,16 +137,17 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { hashLock, staker, ); + + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); }); - it('should mint reward to facilitator', async function () { + it('should mint and reward to facilitator', async function () { await testEIP20CoGateway.setInboxStatus( messageHash, MessageStatusEnum.Declared, ); - await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); let progressMintValues = await testEIP20CoGateway.progressMint.call( messageHash, @@ -161,25 +161,25 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { assert.strictEqual( progressMintValues.beneficiary_, beneficiary, - 'Beneficiary address should be ${beneficiary}', + `Beneficiary address should be ${beneficiary}`, ); assert.strictEqual( amount.eq(progressMintValues.stakeAmount_), true, - 'Staked amount should be ${amount}.', + `Staked amount should be ${amount}.`, ); assert.strictEqual( expectedMintedToken.eq(progressMintValues.mintedAmount_), true, - 'Minted amount should be ${expectedMintedToken}.', + `Minted amount should be ${expectedMintedToken}.`, ); assert.strictEqual( expectedReward.eq(progressMintValues.rewardAmount_), true, - 'Reward to facilitator should be ${expectedReward}.', + `Reward to facilitator should be ${expectedReward}.`, ); let response = await testEIP20CoGateway.progressMint( @@ -194,13 +194,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { assert.strictEqual( facilitatorBalance.eq(expectedReward), true, - 'Facilitator reward should be ${expectedReward}.', + `Facilitator reward should be ${expectedReward}.`, ); assert.strictEqual( beneficiaryBalance.eq(amount.sub(expectedReward)), true, - 'Beneficiary balance should be ${amount.sub(expectedReward)}.' + `Beneficiary balance should be ${amount.sub(expectedReward)}.` ); let expectedEvent = { @@ -226,7 +226,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { }); - it('should not mint reward to facilitator', async function () { + it('should mint and not reward to facilitator', async function () { gasPrice = new BN(0); @@ -265,13 +265,13 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { assert.strictEqual( beneficiaryBalance.eq(amount), true, - 'Balance for beneficiary should be ${amount}', + `Balance for beneficiary should be ${amount}`, ); assert.strictEqual( facilitatorBalance.eq(new BN(0)), true, - 'Facilitator reward should be zero', + `Facilitator reward should be zero`, ); }); @@ -282,7 +282,6 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { messageHash, MessageStatusEnum.Declared, ); - await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); messageHash = zeroBytes; @@ -303,7 +302,6 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { messageHash, MessageStatusEnum.DeclaredRevocation, ); - await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); await Utils.expectRevert( testEIP20CoGateway.progressMint( @@ -322,7 +320,6 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { messageHash, MessageStatusEnum.Revoked, ); - await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); await Utils.expectRevert( testEIP20CoGateway.progressMint( @@ -341,7 +338,6 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { messageHash, MessageStatusEnum.Undeclared, ); - await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); await Utils.expectRevert( testEIP20CoGateway.progressMint( @@ -354,13 +350,12 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { }); - it('should fail when unlock secret is zero', async function () { + it('should fail when unlock secret is invalid', async function () { await testEIP20CoGateway.setInboxStatus( messageHash, MessageStatusEnum.Undeclared, ); - await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); unlockSecret = zeroBytes; @@ -381,7 +376,6 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { messageHash, MessageStatusEnum.Declared, ); - await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); await testEIP20CoGateway.progressMint( messageHash, From 8c6232fea55b8a357fbe22f796adee7c14c277e2 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Mon, 17 Dec 2018 13:04:18 +0530 Subject: [PATCH 17/24] Updated test-case statements --- test/gateway/eip20_cogateway/progress_mint.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index 12bf1ee5..c69bc594 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -142,7 +142,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { }); - it('should mint and reward to facilitator', async function () { + it('should mint for non-zero facilitator reward', async function () { await testEIP20CoGateway.setInboxStatus( messageHash, @@ -226,7 +226,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { }); - it('should mint and not reward to facilitator', async function () { + it('should mint for zero facilitator reward', async function () { gasPrice = new BN(0); @@ -271,7 +271,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { assert.strictEqual( facilitatorBalance.eq(new BN(0)), true, - `Facilitator reward should be zero`, + 'Facilitator reward should be zero', ); }); From 0d15dd308d024aa7bb5bd9de3e45c967f2d6fb35 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Mon, 17 Dec 2018 22:13:48 +0530 Subject: [PATCH 18/24] Removed TestUtilityToken under test directory, updated unit test-case statements, passing false for _proofProgress param for progressMintInternal --- contracts/gateway/EIP20CoGateway.sol | 5 +- contracts/test/TestUtilityToken.sol | 74 -- contracts/test/gateway/TestUtilityToken.sol | 6 +- .../gateway/eip20_cogateway/helpers/helper.js | 132 ++-- test/gateway/eip20_cogateway/progress_mint.js | 743 +++++++++--------- 5 files changed, 455 insertions(+), 505 deletions(-) delete mode 100644 contracts/test/TestUtilityToken.sol diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index 3fe9eb82..59fdf147 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -302,7 +302,7 @@ contract EIP20CoGateway is GatewayBase { stakeAmount_, mintedAmount_, rewardAmount_) = - progressMintInternal(_messageHash, initialGas, true, _unlockSecret); + progressMintInternal(_messageHash, initialGas, false, _unlockSecret); } /** @@ -1110,8 +1110,6 @@ contract EIP20CoGateway is GatewayBase { mintedAmount_ = stakeAmount_.sub(rewardAmount_); - // Mint token after subtracting reward amount. - UtilityTokenInterface(utilityToken).mint(beneficiary_, mintedAmount_); // Mint token after subtracting reward amount. UtilityTokenInterface(utilityToken).increaseSupply( beneficiary_, @@ -1124,7 +1122,6 @@ contract EIP20CoGateway is GatewayBase { msg.sender, rewardAmount_ ); - } // Delete the mint data. diff --git a/contracts/test/TestUtilityToken.sol b/contracts/test/TestUtilityToken.sol deleted file mode 100644 index 09ac8b9e..00000000 --- a/contracts/test/TestUtilityToken.sol +++ /dev/null @@ -1,74 +0,0 @@ -pragma solidity ^0.5.0; - -// Copyright 2018 OpenST Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ---------------------------------------------------------------------------- -// -// http://www.simpletoken.org/ -// -// ---------------------------------------------------------------------------- - -import "../gateway/UtilityToken.sol"; - -/** - * @title TestUtilityToken contract. - * - * @notice This is for testing purpose. - * - */ -contract TestUtilityToken is UtilityToken { - - /* Usings */ - - using SafeMath for uint256; - - - /* Constructor */ - - /** - * @notice Contract constructor. - * - * @dev This is for testing purpose. - * - * @param _symbol Symbol of token. - * @param _name Name of token. - * @param _decimals Decimal of token. - * @param _valueToken Address of value branded token. - */ - constructor( - string memory _symbol, - string memory _name, - uint8 _decimals, - address _valueToken - ) - public - UtilityToken(_symbol, _name, _decimals, _valueToken) - { } - - - /* External functions */ - - /** - * @notice It sets the coGateway address. This is for testing purpose. - * - * @param _coGateway CoGateway address to be set. - */ - function setCoGateway(address _coGateway) external returns (bool) - { - coGateway = _coGateway; - } - -} - diff --git a/contracts/test/gateway/TestUtilityToken.sol b/contracts/test/gateway/TestUtilityToken.sol index 88d004e9..b78d708f 100644 --- a/contracts/test/gateway/TestUtilityToken.sol +++ b/contracts/test/gateway/TestUtilityToken.sol @@ -30,9 +30,9 @@ contract TestUtilityToken is UtilityToken { * @dev This is used for testing by mocking certain variables. * * @param _token Address of branded token. - * @param _symbol Symbol of token - * @param _name Name of token - * @param _decimals Decimal of token + * @param _symbol Symbol of token. + * @param _name Name of token. + * @param _decimals Decimal of token. */ constructor( EIP20Interface _token, diff --git a/test/gateway/eip20_cogateway/helpers/helper.js b/test/gateway/eip20_cogateway/helpers/helper.js index e22252ce..a994c5df 100644 --- a/test/gateway/eip20_cogateway/helpers/helper.js +++ b/test/gateway/eip20_cogateway/helpers/helper.js @@ -28,74 +28,78 @@ const EIP20CoGatewayHelper = function () { }; EIP20CoGatewayHelper.prototype = { + + /** + * It sets the cogateway address. + * @param coGateway CoGateway contract address. + */ + setCoGateway: async function (coGateway) + { - /** - * It sets the cogateway address. - * @param coGateway CoGateway contract address. - */ - setCoGateway: async function (coGateway) { - - this.coGateway = coGateway; - - }, + this.coGateway = coGateway; - /** - * Generate the redeem type hash. This is as per EIP-712. - * - * @return {string} Message type hash. - */ - redeemTypeHash: async function () { - return web3.utils.soliditySha3( - 'string', - 'Redeem(uint256 amount,address beneficiary,MessageBus.Message message)' - ); - }, + }, + + /** + * Generate the redeem type hash. This is as per EIP-712. + * + * @return {string} Message type hash. + */ + redeemTypeHash: async function () + { + return web3.utils.soliditySha3( + 'string', + 'Redeem(uint256 amount,address beneficiary,MessageBus.Message message)' + ); + }, + + /** + * Generate the redeem intent hash. + * + * @param {object} amount Redeem amount. + * @param {string} beneficiary Beneficiary address. + * @param {string} redeemer Redeemer address. + * @param {object} nonce Nonce of staker (Big Number). + * @param {object} gasPrice Gas price (Big Number). + * @param {object} gasLimit Gas limit (Big Number). + * @param {string} token EIP20 token address. + * + * @return {string} Redeem intent hash. + */ + hashRedeemIntent: async function ( + amount, + beneficiary, + redeemer, + nonce, + gasPrice, + gasLimit, + token) + { - /** - * Generate the redeem intent hash. - * - * @param {object} amount Redeem amount. - * @param {string} beneficiary Beneficiary address. - * @param {string} redeemer Redeemer address. - * @param {object} nonce Nonce of staker (Big Number). - * @param {object} gasPrice Gas price (Big Number). - * @param {object} gasLimit Gas limit (Big Number). - * @param {string} token EIP20 token address. - * - * @return {string} Redeem intent hash. - */ - hashRedeemIntent: async function ( - amount, - beneficiary, - redeemer, - nonce, - gasPrice, - gasLimit, - token) { - - return web3.utils.soliditySha3( - {t: 'uint256', v: amount}, - {t: 'address', v: beneficiary}, - {t: 'address', v: redeemer}, - {t: 'uint256', v: nonce}, - {t: 'uint256', v: gasPrice}, - {t: 'uint256', v: gasLimit}, - {t: 'address', v: token} - ); - }, - - /** - * It returns the nonce value for the account address. - * - * @param address Account for which nonce is required. - * - * @returns {Promise} Nonce of the address. - */ - getNonce: async function (address) { - - return await this.coGateway.getNonce.call(address); - } + return web3.utils.soliditySha3( + {t: 'uint256', v: amount}, + {t: 'address', v: beneficiary}, + {t: 'address', v: redeemer}, + {t: 'uint256', v: nonce}, + {t: 'uint256', v: gasPrice}, + {t: 'uint256', v: gasLimit}, + {t: 'address', v: token} + ); + }, + + /** + * It returns the nonce value for the account address. + * + * @param address Account for which nonce is required. + * + * @returns {Promise} Nonce of the address. + */ + getNonce: async function (address) + { + return await this.coGateway.getNonce.call(address); + } + }; module.exports = EIP20CoGatewayHelper; diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index c69bc594..40848c57 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -19,380 +19,403 @@ // ---------------------------------------------------------------------------- const BN = require('bn.js'), - Utils = require('../../test_lib/utils'), - EIP20CoGatewayHelper = require('./helpers/helper'), - MessageBus = artifacts.require('MessageBus'), - EIP20Token = artifacts.require('EIP20Token'), - TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), - TestUtilityToken = artifacts.require('TestUtilityToken'); + Utils = require('../../test_lib/utils'), + EIP20CoGatewayHelper = require('./helpers/helper'), + MessageBus = artifacts.require('MessageBus'), + EIP20Token = artifacts.require('EIP20Token'), + TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), + TestUtilityToken = artifacts.require('TestUtilityToken'); let valueToken, - burner, - mockSafeCore, - membersManager, - coGateway, - testUtilityToken, - bountyAmount, - owner, - staker, - stakerBalance, - rewardAmount, - symbol = 'OST', - name = 'Simple Token', - decimals = 18, - helper; + burner, + mockSafeCore, + membersManager, + coGateway, + testUtilityToken, + bountyAmount, + owner, + staker, + stakerBalance, + rewardAmount, + symbol = 'OST', + name = 'Simple Token', + decimals = 18, + helper; const zeroBytes = - "0x0000000000000000000000000000000000000000000000000000000000000000"; + "0x0000000000000000000000000000000000000000000000000000000000000000"; let MessageStatusEnum = { - Undeclared: 0, - Declared: 1, - Progressed: 2, - DeclaredRevocation: 3, - Revoked: 4 + Undeclared: 0, + Declared: 1, + Progressed: 2, + DeclaredRevocation: 3, + Revoked: 4 }; async function _setup(accounts) { - - valueToken = accounts[0]; - burner = accounts[10]; - mockSafeCore = accounts[11]; - membersManager = accounts[2]; - coGateway = accounts[3]; - owner = accounts[8]; - testUtilityToken = await TestUtilityToken.new( - symbol, - name, - decimals, - valueToken, - ); - bountyAmount = new BN(100); - staker = accounts[7]; - stakerBalance = new BN(1000000); - rewardAmount = new BN(100); - + + valueToken = accounts[0]; + burner = accounts[10]; + mockSafeCore = accounts[11]; + membersManager = accounts[2]; + coGateway = accounts[3]; + owner = accounts[8]; + testUtilityToken = await TestUtilityToken.new( + valueToken, + symbol, + name, + decimals, + membersManager + ); + bountyAmount = new BN(100); + staker = accounts[7]; + stakerBalance = new BN(1000000); + rewardAmount = new BN(100); + } contract('EIP20CoGateway.progressMint() ', function (accounts) { + + let amount = new BN(200), + beneficiary = accounts[4], + gasPrice, + gasLimit, + nonce = new BN(1), + hashLockObj = Utils.generateHashLock(), + facilitator = accounts[5], + intentHash, + hashLock, + unlockSecret, + testEIP20CoGateway, + messageHash; + helper = new EIP20CoGatewayHelper(); + + beforeEach(async function () { + + await _setup(accounts); + amount = new BN(200); + hashLock = hashLockObj.l; + unlockSecret = hashLockObj.s; + gasPrice = new BN(10); + gasLimit = new BN(10); + + intentHash = await helper.hashRedeemIntent( + amount, + beneficiary, + facilitator, + nonce, + gasPrice, + gasLimit, + valueToken, + ); + testEIP20CoGateway = await TestEIP20CoGateway.new( + valueToken, + testUtilityToken.address, + mockSafeCore, + bountyAmount, + membersManager, + coGateway, + burner, + ); + + await testUtilityToken.setCoGatewayAddress(testEIP20CoGateway.address); + + await helper.setCoGateway(testEIP20CoGateway.address); + + messageHash = await testEIP20CoGateway.setStakeMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setStakeMessage( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + }); + + it('should progress mint for non-zero facilitator reward', async function () { + + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Declared, + ); + + let progressMintValues = await testEIP20CoGateway.progressMint.call( + messageHash, + unlockSecret, + {from: facilitator}, + ); + + let expectedMintedToken = new BN(100), + expectedReward = new BN(100); + + assert.strictEqual( + progressMintValues.beneficiary_, + beneficiary, + `Beneficiary address should be ${beneficiary}`, + ); + + assert.strictEqual( + amount.eq(progressMintValues.stakeAmount_), + true, + `Staked amount should be ${amount}.`, + ); + + assert.strictEqual( + expectedMintedToken.eq(progressMintValues.mintedAmount_), + true, + `Minted amount should be ${expectedMintedToken}.`, + ); + + assert.strictEqual( + expectedReward.eq(progressMintValues.rewardAmount_), + true, + `Reward to facilitator should be ${expectedReward}.`, + ); + + let response = await testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ); + + let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); + let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); + + assert.strictEqual( + facilitatorBalance.eq(expectedReward), + true, + `Facilitator reward should be ${expectedReward}.`, + ); + + assert.strictEqual( + beneficiaryBalance.eq(amount.sub(expectedReward)), + true, + `Beneficiary balance should be ${amount.sub(expectedReward)}.` + ); + + let expectedEvent = { + MintProgressed: { + _messageHash: messageHash, + _staker: staker, + _stakeAmount: amount, + _mintedAmount: expectedMintedToken, + _rewardAmount: expectedReward, + _proofProgress: false, + _unlockSecret: unlockSecret + } + }; + + assert.equal( + response.receipt.status, + 1, + 'Receipt status is unsuccessful.', + ); + + let eventData = response.logs; + Utils.validateEvents(eventData, expectedEvent); + + }); + + it('should progress mint for zero facilitator reward', async function () { + + gasPrice = new BN(0); + + let messageHash = await testEIP20CoGateway.setStakeMessage.call( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + + await testEIP20CoGateway.setStakeMessage( + intentHash, + nonce, + gasPrice, + gasLimit, + hashLock, + staker, + ); + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Declared, + ); + await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); + + let response = await testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ); + + let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); + let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); - let amount = new BN(200), - beneficiary = accounts[4], - gasPrice, - gasLimit, - nonce = new BN(1), - hashLockObj = Utils.generateHashLock(), - facilitator = accounts[5], - intentHash, - hashLock, + assert.strictEqual( + beneficiaryBalance.eq(amount), + true, + `Balance for beneficiary should be ${amount}`, + ); + + assert.strictEqual( + facilitatorBalance.eq(new BN(0)), + true, + 'Facilitator reward should be zero', + ); + + let expectedEvent = { + MintProgressed: { + _messageHash: messageHash, + _staker: staker, + _stakeAmount: amount, + _mintedAmount: amount, + _rewardAmount: new BN(0), + _proofProgress: false, + _unlockSecret: unlockSecret + } + }; + + assert.equal( + response.receipt.status, + 1, + 'Receipt status is unsuccessful.', + ); + + let eventData = response.logs; + Utils.validateEvents(eventData, expectedEvent); + + }); + + it('should fail when messagehash is zero', async function () { + + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Declared, + ); + + messageHash = zeroBytes; + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + 'Message hash must not be zero.', + ); + + }); + + it('should fail when message status is declared revocation', async function () { + + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.DeclaredRevocation, + ); + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + 'Message status must be Declared.' + ); + + }); + + it('should fail when message status is revoked', async function () { + + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Revoked, + ); + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + 'Message status must be Declared.' + ); + + }); + + it('should fail when message status is undeclared', async function () { + + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Undeclared, + ); + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, unlockSecret, - testEIP20CoGateway, - messageHash; - helper = new EIP20CoGatewayHelper(); - - beforeEach(async function () { - - await _setup(accounts); - amount = new BN(200); - hashLock = hashLockObj.l; - unlockSecret = hashLockObj.s; - gasPrice = new BN(10); - gasLimit = new BN(10); - - intentHash = await helper.hashRedeemIntent( - amount, - beneficiary, - facilitator, - nonce, - gasPrice, - gasLimit, - valueToken, - ); - testEIP20CoGateway = await TestEIP20CoGateway.new( - valueToken, - testUtilityToken.address, - mockSafeCore, - bountyAmount, - membersManager, - coGateway, - burner, - ); - - await testUtilityToken.setCoGateway(testEIP20CoGateway.address); - await helper.setCoGateway(testEIP20CoGateway.address); - - messageHash = await testEIP20CoGateway.setStakeMessage.call( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - await testEIP20CoGateway.setStakeMessage( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - - await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); - - }); - - it('should mint for non-zero facilitator reward', async function () { - - await testEIP20CoGateway.setInboxStatus( - messageHash, - MessageStatusEnum.Declared, - ); - - let progressMintValues = await testEIP20CoGateway.progressMint.call( - messageHash, - unlockSecret, - {from: facilitator}, - ); - - let expectedMintedToken = new BN(100), - expectedReward = new BN(100); - - assert.strictEqual( - progressMintValues.beneficiary_, - beneficiary, - `Beneficiary address should be ${beneficiary}`, - ); - - assert.strictEqual( - amount.eq(progressMintValues.stakeAmount_), - true, - `Staked amount should be ${amount}.`, - ); - - assert.strictEqual( - expectedMintedToken.eq(progressMintValues.mintedAmount_), - true, - `Minted amount should be ${expectedMintedToken}.`, - ); - - assert.strictEqual( - expectedReward.eq(progressMintValues.rewardAmount_), - true, - `Reward to facilitator should be ${expectedReward}.`, - ); - - let response = await testEIP20CoGateway.progressMint( - messageHash, - unlockSecret, - {from: facilitator}, - ); - - let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); - let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); - - assert.strictEqual( - facilitatorBalance.eq(expectedReward), - true, - `Facilitator reward should be ${expectedReward}.`, - ); - - assert.strictEqual( - beneficiaryBalance.eq(amount.sub(expectedReward)), - true, - `Beneficiary balance should be ${amount.sub(expectedReward)}.` - ); - - let expectedEvent = { - MintProgressed: { - _messageHash: messageHash, - _staker: staker, - _stakeAmount: amount, - _mintedAmount: expectedMintedToken, - _rewardAmount: expectedReward, - _proofProgress: true, - _unlockSecret: unlockSecret - } - }; - - assert.equal( - response.receipt.status, - 1, - 'Receipt status is unsuccessful.', - ); - - let eventData = response.logs; - Utils.validateEvents(eventData, expectedEvent); - - }); - - it('should mint for zero facilitator reward', async function () { - - gasPrice = new BN(0); - - let messageHash = await testEIP20CoGateway.setStakeMessage.call( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - - await testEIP20CoGateway.setStakeMessage( - intentHash, - nonce, - gasPrice, - gasLimit, - hashLock, - staker, - ); - await testEIP20CoGateway.setInboxStatus( - messageHash, - MessageStatusEnum.Declared, - ); - await testEIP20CoGateway.setMints(messageHash, beneficiary, amount); - - await testEIP20CoGateway.progressMint( - messageHash, - unlockSecret, - {from: facilitator}, - ); - - let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); - let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); - - assert.strictEqual( - beneficiaryBalance.eq(amount), - true, - `Balance for beneficiary should be ${amount}`, - ); - - assert.strictEqual( - facilitatorBalance.eq(new BN(0)), - true, - 'Facilitator reward should be zero', - ); - - }); - - it('should fail when messagehash is zero', async function () { - - await testEIP20CoGateway.setInboxStatus( - messageHash, - MessageStatusEnum.Declared, - ); - - messageHash = zeroBytes; - - await Utils.expectRevert( - testEIP20CoGateway.progressMint( - messageHash, - unlockSecret, - {from: facilitator}, - ), - 'Message hash must not be zero.', - ); - - }); - - it('should fail when status of the messagehash is declared revocation', async function () { - - await testEIP20CoGateway.setInboxStatus( - messageHash, - MessageStatusEnum.DeclaredRevocation, - ); - - await Utils.expectRevert( - testEIP20CoGateway.progressMint( - messageHash, - unlockSecret, - {from: facilitator}, - ), - 'Message status must be Declared.' - ); - - }); - - it('should fail when status of the messagehash is revoked', async function () { - - await testEIP20CoGateway.setInboxStatus( - messageHash, - MessageStatusEnum.Revoked, - ); - - await Utils.expectRevert( - testEIP20CoGateway.progressMint( - messageHash, - unlockSecret, - {from: facilitator}, - ), - 'Message status must be Declared.' - ); - - }); - - it('should fail when status of the messagehash is undeclared', async function () { - - await testEIP20CoGateway.setInboxStatus( - messageHash, - MessageStatusEnum.Undeclared, - ); - - await Utils.expectRevert( - testEIP20CoGateway.progressMint( - messageHash, - unlockSecret, - {from: facilitator}, - ), - 'Message status must be Declared.' - ); - - }); - - it('should fail when unlock secret is invalid', async function () { - - await testEIP20CoGateway.setInboxStatus( - messageHash, - MessageStatusEnum.Undeclared, - ); - - unlockSecret = zeroBytes; - - await Utils.expectRevert( - testEIP20CoGateway.progressMint( - messageHash, - unlockSecret, - {from: facilitator}, - ), - 'Invalid unlock secret.' - ); - - }); - - it('should fail when message status is already progressed', async function () { - - await testEIP20CoGateway.setInboxStatus( - messageHash, - MessageStatusEnum.Declared, - ); - - await testEIP20CoGateway.progressMint( - messageHash, - unlockSecret, - {from: facilitator}, - ); - - await Utils.expectRevert( - testEIP20CoGateway.progressMint( - messageHash, - unlockSecret, - {from: facilitator}, - ), - 'Message status must be Declared.', - ); - - }); + {from: facilitator}, + ), + 'Message status must be Declared.' + ); + + }); + + it('should fail when unlock secret is invalid', async function () { + + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Undeclared, + ); + + unlockSecret = zeroBytes; + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + 'Invalid unlock secret.' + ); + + }); + + it('should fail when message status is already progressed', async function () { + + await testEIP20CoGateway.setInboxStatus( + messageHash, + MessageStatusEnum.Declared, + ); + + await testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ); + + await Utils.expectRevert( + testEIP20CoGateway.progressMint( + messageHash, + unlockSecret, + {from: facilitator}, + ), + 'Message status must be Declared.', + ); + }); + }); From b495fbdb5a0692998fd2327b55c4d6a05d562214 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Tue, 18 Dec 2018 18:01:06 +0530 Subject: [PATCH 19/24] Used MockUtilityToken instead of TestUtilityToken --- contracts/test/gateway/TestUtilityToken.sol | 6 +- package-lock.json | 441 ++++++++---------- .../gateway/eip20_cogateway/helpers/helper.js | 17 +- test/gateway/eip20_cogateway/progress_mint.js | 26 +- 4 files changed, 214 insertions(+), 276 deletions(-) diff --git a/contracts/test/gateway/TestUtilityToken.sol b/contracts/test/gateway/TestUtilityToken.sol index b78d708f..0b53fdc5 100644 --- a/contracts/test/gateway/TestUtilityToken.sol +++ b/contracts/test/gateway/TestUtilityToken.sol @@ -23,7 +23,7 @@ import "../../gateway/UtilityToken.sol"; * contract. */ contract TestUtilityToken is UtilityToken { - + /* Constructor */ /** @@ -41,8 +41,8 @@ contract TestUtilityToken is UtilityToken { uint8 _decimals, IsMemberInterface _membersManager ) - public - UtilityToken(_token, _symbol, _name, _decimals, _membersManager) + public + UtilityToken(_token, _symbol, _name, _decimals, _membersManager) {} /** diff --git a/package-lock.json b/package-lock.json index 78747663..47879c26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@types/node": { - "version": "10.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.10.3.tgz", - "integrity": "sha512-dWk7F3b0m6uDLHero7tsnpAi9r2RGPQHGbb0/VCv7DPJRMFtk3RonY1/29vfJKnheRMBa7+uF+vunlg/mBGlxg==", + "version": "10.12.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.15.tgz", + "integrity": "sha512-9kROxduaN98QghwwHmxXO2Xz3MaWf+I1sLVAA6KJDF5xix+IyXVhds0MAfdNwtcpSrzhaTsNB0/jnL86fgUhqA==", "dev": true }, "abbrev": { @@ -46,7 +46,7 @@ "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "dev": true, "requires": { - "mime-types": "2.1.20", + "mime-types": "2.1.21", "negotiator": "0.6.1" } }, @@ -57,15 +57,15 @@ "dev": true }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.2.tgz", + "integrity": "sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==", "dev": true, "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", + "fast-deep-equal": "2.0.1", "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "json-schema-traverse": "0.4.1", + "uri-js": "4.2.2" } }, "amdefine": { @@ -184,7 +184,6 @@ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, - "optional": true, "requires": { "tweetnacl": "0.14.5" } @@ -194,9 +193,9 @@ "dev": true }, "bindings": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", - "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.1.tgz", + "integrity": "sha512-i47mqjF9UbjxJhxGf+pZ6kSxrnI3wBLlnGI2ArWJ4r0VrvDS7ZYXkprq/pLaBWYq4GM0r4zdHY+NNRqEMU7uew==", "dev": true }, "bl": { @@ -219,9 +218,9 @@ } }, "bluebird": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", - "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", + "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==", "dev": true }, "bn.js": { @@ -453,12 +452,6 @@ "wrap-ansi": "2.1.0" } }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -474,6 +467,12 @@ "delayed-stream": "1.0.0" } }, + "command-exists": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz", + "integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==", + "dev": true + }, "commander": { "version": "2.17.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", @@ -488,7 +487,7 @@ }, "content-disposition": { "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "resolved": "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", "dev": true }, @@ -523,9 +522,9 @@ "dev": true }, "cors": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", - "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "dev": true, "requires": { "object-assign": "4.1.1", @@ -550,7 +549,7 @@ "requires": { "cipher-base": "1.0.4", "inherits": "2.0.1", - "md5.js": "1.3.4", + "md5.js": "1.3.5", "ripemd160": "2.0.2", "sha.js": "2.4.11" } @@ -575,7 +574,7 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "4.1.3", + "lru-cache": "4.1.5", "shebang-command": "1.2.0", "which": "1.3.1" } @@ -593,8 +592,8 @@ "create-hmac": "1.1.7", "diffie-hellman": "5.0.3", "inherits": "2.0.1", - "pbkdf2": "3.0.16", - "public-encrypt": "4.0.2", + "pbkdf2": "3.0.17", + "public-encrypt": "4.0.3", "randombytes": "2.0.6", "randomfill": "1.0.4" } @@ -651,7 +650,7 @@ "decompress-tarbz2": "4.1.1", "decompress-targz": "4.1.1", "decompress-unzip": "4.0.1", - "graceful-fs": "4.1.11", + "graceful-fs": "4.1.15", "make-dir": "1.3.0", "pify": "2.3.0", "strip-dirs": "2.1.0" @@ -687,7 +686,7 @@ "file-type": "6.2.0", "is-stream": "1.1.0", "seek-bzip": "1.0.5", - "unbzip2-stream": "1.3.0" + "unbzip2-stream": "1.3.1" }, "dependencies": { "file-type": { @@ -807,7 +806,6 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, - "optional": true, "requires": { "jsbn": "0.1.1", "safer-buffer": "2.1.2" @@ -827,7 +825,7 @@ "requires": { "bn.js": "4.11.8", "brorand": "1.1.0", - "hash.js": "1.1.5", + "hash.js": "1.1.7", "hmac-drbg": "1.0.1", "inherits": "2.0.1", "minimalistic-assert": "1.0.1", @@ -967,7 +965,7 @@ "integrity": "sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw==", "dev": true, "requires": { - "@types/node": "10.10.3", + "@types/node": "10.12.15", "aes-js": "3.0.0", "bn.js": "4.11.8", "elliptic": "6.3.3", @@ -1059,7 +1057,7 @@ "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { - "md5.js": "1.3.4", + "md5.js": "1.3.5", "safe-buffer": "5.1.2" } }, @@ -1079,14 +1077,14 @@ } }, "express": { - "version": "4.16.3", - "resolved": "http://registry.npmjs.org/express/-/express-4.16.3.tgz", - "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", + "version": "4.16.4", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", + "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", "dev": true, "requires": { "accepts": "1.3.5", "array-flatten": "1.1.1", - "body-parser": "1.18.2", + "body-parser": "1.18.3", "content-disposition": "0.5.2", "content-type": "1.0.4", "cookie": "0.3.1", @@ -1104,9 +1102,9 @@ "parseurl": "1.3.2", "path-to-regexp": "0.1.7", "proxy-addr": "2.0.4", - "qs": "6.5.1", + "qs": "6.5.2", "range-parser": "1.2.0", - "safe-buffer": "5.1.1", + "safe-buffer": "5.1.2", "send": "0.16.2", "serve-static": "1.13.2", "setprototypeof": "1.1.0", @@ -1116,24 +1114,6 @@ "vary": "1.1.2" }, "dependencies": { - "body-parser": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", - "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", - "dev": true, - "requires": { - "bytes": "3.0.0", - "content-type": "1.0.4", - "debug": "2.6.9", - "depd": "1.1.2", - "http-errors": "1.6.3", - "iconv-lite": "0.4.19", - "on-finished": "2.3.0", - "qs": "6.5.1", - "raw-body": "2.3.2", - "type-is": "1.6.16" - } - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -1143,68 +1123,6 @@ "ms": "2.0.0" } }, - "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", - "dev": true - }, - "raw-body": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", - "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", - "dev": true, - "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.2", - "iconv-lite": "0.4.19", - "unpipe": "1.0.0" - }, - "dependencies": { - "depd": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", - "dev": true - }, - "http-errors": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", - "dev": true, - "requires": { - "depd": "1.1.1", - "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": "1.4.0" - } - }, - "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", - "dev": true - } - } - }, - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true - }, "statuses": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", @@ -1226,9 +1144,9 @@ "dev": true }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "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 }, "fast-json-stable-stringify": { @@ -1316,25 +1234,14 @@ "dev": true }, "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.20" - }, - "dependencies": { - "combined-stream": { - "version": "1.0.6", - "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - } + "combined-stream": "1.0.7", + "mime-types": "2.1.21" } }, "forwarded": { @@ -1361,7 +1268,7 @@ "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "dev": true, "requires": { - "graceful-fs": "4.1.11", + "graceful-fs": "4.1.15", "jsonfile": "2.4.0", "klaw": "1.3.1", "path-is-absolute": "1.0.1", @@ -1386,7 +1293,7 @@ "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "dev": true, "requires": { - "graceful-fs": "4.1.11", + "graceful-fs": "4.1.15", "jsonfile": "2.4.0" } } @@ -1404,7 +1311,7 @@ "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "dev": true, "requires": { - "graceful-fs": "4.1.11", + "graceful-fs": "4.1.15", "inherits": "2.0.1", "mkdirp": "0.5.1", "rimraf": "2.6.2" @@ -1486,9 +1393,9 @@ } }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, "graceful-readlink": { @@ -1533,12 +1440,12 @@ "dev": true }, "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "dev": true, "requires": { - "ajv": "5.5.2", + "ajv": "6.6.2", "har-schema": "2.0.0" } }, @@ -1574,9 +1481,9 @@ } }, "hash.js": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", - "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dev": true, "requires": { "inherits": "2.0.3", @@ -1603,7 +1510,7 @@ "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { - "hash.js": "1.1.5", + "hash.js": "1.1.7", "minimalistic-assert": "1.0.1", "minimalistic-crypto-utils": "1.0.1" } @@ -1648,7 +1555,7 @@ "requires": { "assert-plus": "1.0.0", "jsprim": "1.4.1", - "sshpk": "1.14.2" + "sshpk": "1.15.2" } }, "iconv-lite": { @@ -1879,8 +1786,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true + "dev": true }, "json-schema": { "version": "0.2.3", @@ -1889,9 +1795,9 @@ "dev": true }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "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 }, "json-stringify-safe": { @@ -1906,7 +1812,7 @@ "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "4.1.15" } }, "jsprim": { @@ -1927,9 +1833,9 @@ "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "dev": true, "requires": { - "bindings": "1.3.0", + "bindings": "1.3.1", "inherits": "2.0.3", - "nan": "2.11.0", + "nan": "2.12.0", "safe-buffer": "5.1.2" }, "dependencies": { @@ -1957,7 +1863,7 @@ "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "4.1.15" } }, "lcid": { @@ -1985,7 +1891,7 @@ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { - "graceful-fs": "4.1.11", + "graceful-fs": "4.1.15", "parse-json": "2.2.0", "pify": "2.3.0", "pinkie-promise": "2.0.1", @@ -2029,9 +1935,9 @@ "dev": true }, "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { "pseudomap": "1.0.2", @@ -2056,13 +1962,14 @@ } }, "md5.js": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", - "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, "requires": { "hash-base": "3.0.4", - "inherits": "2.0.1" + "inherits": "2.0.1", + "safe-buffer": "5.1.2" } }, "media-typer": { @@ -2115,18 +2022,18 @@ "dev": true }, "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", "dev": true }, "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", "dev": true, "requires": { - "mime-db": "1.36.0" + "mime-db": "1.37.0" } }, "mimic-fn": { @@ -2288,9 +2195,9 @@ } }, "nan": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.0.tgz", - "integrity": "sha512-F4miItu2rGnV2ySkXOQoA8FKz/SR2Q2sWP0sbTxNxz/tuokeC8WxOhPMcwi0qIyGtVn/rrSeLbvVkznqCdwYnw==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.0.tgz", + "integrity": "sha512-zT5nC0JhbljmyEf+Z456nvm7iO7XgRV2hYxoBtPpnyp+0Q4aCoP6uWNn76v/I6k2kCYNLWqWbwBWQcjsNI/bjw==", "dev": true }, "nano-json-stream-parser": { @@ -2322,7 +2229,7 @@ "requires": { "hosted-git-info": "2.7.1", "is-builtin-module": "1.0.0", - "semver": "5.5.1", + "semver": "5.6.0", "validate-npm-package-license": "3.0.4" } }, @@ -2445,6 +2352,12 @@ "lcid": "1.0.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, "p-cancelable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", @@ -2500,7 +2413,7 @@ "browserify-aes": "1.2.0", "create-hash": "1.2.0", "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.16" + "pbkdf2": "3.0.17" } }, "parse-headers": { @@ -2561,15 +2474,15 @@ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { - "graceful-fs": "4.1.11", + "graceful-fs": "4.1.15", "pify": "2.3.0", "pinkie-promise": "2.0.1" } }, "pbkdf2": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.16.tgz", - "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", "dev": true, "requires": { "create-hash": "1.2.0", @@ -2659,28 +2572,29 @@ "dev": true }, "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", "dev": true }, "public-encrypt": { - "version": "4.0.2", - "resolved": "http://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz", - "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", "dev": true, "requires": { "bn.js": "4.11.8", "browserify-rsa": "4.0.1", "create-hash": "1.2.0", "parse-asn1": "5.1.1", - "randombytes": "2.0.6" + "randombytes": "2.0.6", + "safe-buffer": "5.1.2" } }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "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 }, "qs": { @@ -2826,13 +2740,13 @@ "combined-stream": "1.0.7", "extend": "3.0.2", "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.1.0", + "form-data": "2.3.3", + "har-validator": "5.1.3", "http-signature": "1.2.0", "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.20", + "mime-types": "2.1.21", "oauth-sign": "0.9.0", "performance-now": "2.1.0", "qs": "6.5.2", @@ -2862,7 +2776,7 @@ }, "resolve": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, @@ -2934,7 +2848,7 @@ "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", "dev": true, "requires": { - "nan": "2.11.0" + "nan": "2.12.0" } }, "scrypt-js": { @@ -2959,7 +2873,7 @@ "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", "dev": true, "requires": { - "pbkdf2": "3.0.16" + "pbkdf2": "3.0.17" } }, "seek-bzip": { @@ -2983,9 +2897,9 @@ } }, "semver": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", - "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, "send": { @@ -3045,8 +2959,8 @@ "dev": true, "requires": { "body-parser": "1.18.3", - "cors": "2.8.4", - "express": "4.16.3", + "cors": "2.8.5", + "express": "4.16.4", "request": "2.88.0", "xhr": "2.5.0" } @@ -3168,16 +3082,18 @@ "dev": true }, "solc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.5.0.tgz", - "integrity": "sha512-mdLHDl9WeYrN+FIKcMc9PlPfnA9DG9ur5QpCDKcv6VC4RINAsTF4EMuXMZMKoQTvZhtLyJIVH/BZ+KU830Z8Xg==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.5.1.tgz", + "integrity": "sha512-+RJfa5zRpWBm8DhEiEScIzEzPHWppwHSp/2yV9qvM/lNr0Y8cCv2mcNiXy+R6SSV0OoskhPEfe6Fwa4QQEgxlg==", "dev": true, "requires": { + "command-exists": "1.2.8", "fs-extra": "0.30.0", "keccak": "1.4.0", "memorystream": "0.3.1", "require-from-string": "2.0.2", - "semver": "5.5.1", + "semver": "5.6.0", + "tmp": "0.0.33", "yargs": "11.1.0" }, "dependencies": { @@ -3300,7 +3216,7 @@ "shelljs": "0.7.8", "sol-explore": "1.6.2", "solidity-parser-sc": "0.4.11", - "tree-kill": "1.2.0", + "tree-kill": "1.2.1", "web3": "0.18.4" }, "dependencies": { @@ -3463,19 +3379,19 @@ } }, "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==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "dev": true, "requires": { "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.1" + "spdx-license-ids": "3.0.2" } }, "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", "dev": true }, "spdx-expression-parse": { @@ -3484,26 +3400,26 @@ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.1" + "spdx-exceptions": "2.2.0", + "spdx-license-ids": "3.0.2" } }, "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==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz", + "integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==", "dev": true }, "sprintf-js": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "resolved": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", + "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", "dev": true, "requires": { "asn1": "0.2.4", @@ -3531,7 +3447,7 @@ }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { @@ -3606,14 +3522,14 @@ "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", "dev": true, "requires": { - "bluebird": "3.5.2", + "bluebird": "3.5.3", "buffer": "5.2.1", "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.20", + "mime-types": "2.1.21", "mkdirp-promise": "5.0.1", "mock-fs": "4.7.0", "setimmediate": "1.0.5", @@ -3627,7 +3543,7 @@ "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "dev": true, "requires": { - "graceful-fs": "4.1.11", + "graceful-fs": "4.1.15", "jsonfile": "2.4.0" } } @@ -3710,6 +3626,15 @@ "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", "dev": true }, + "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" + } + }, "to-buffer": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", @@ -3722,14 +3647,22 @@ "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { - "psl": "1.1.29", + "psl": "1.1.31", "punycode": "1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } } }, "tree-kill": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.0.tgz", - "integrity": "sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.1.tgz", + "integrity": "sha512-4hjqbObwlh2dLyW4tcz0Ymw0ggoaVDMveUB9w8kFSQScdRLo0gxO9J7WFcUBo+W3C1TLdFIEwNOWebgZZ0RH9Q==", "dev": true }, "trim": { @@ -3746,7 +3679,7 @@ "requires": { "mocha": "4.1.0", "original-require": "1.0.1", - "solc": "0.5.0" + "solc": "0.5.1" } }, "tunnel-agent": { @@ -3762,8 +3695,7 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true + "dev": true }, "type-check": { "version": "0.3.2", @@ -3781,7 +3713,7 @@ "dev": true, "requires": { "media-typer": "0.3.0", - "mime-types": "2.1.20" + "mime-types": "2.1.21" } }, "typedarray-to-buffer": { @@ -3811,9 +3743,9 @@ "dev": true }, "unbzip2-stream": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.0.tgz", - "integrity": "sha512-kE2WkurNnPUMcryNioS68DDbhoPB8Qxsd8btHSj+sd5Pjh2GsjmeHLzMSqV9HHziAo8FzVxVCJl9ZYhk7yY1pA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.1.tgz", + "integrity": "sha512-fIZnvdjblYs7Cru/xC6tCPVhz7JkYcVQQkePwMLyQELzYTds2Xn8QefPVnvdVhhZqubxNA1cASXEH5wcK0Bucw==", "dev": true, "requires": { "buffer": "3.6.0", @@ -3841,7 +3773,7 @@ }, "underscore": { "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "resolved": "http://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", "dev": true }, @@ -3851,6 +3783,15 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, + "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.1" + } + }, "url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", @@ -3911,7 +3852,7 @@ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { - "spdx-correct": "3.0.0", + "spdx-correct": "3.1.0", "spdx-expression-parse": "3.0.0" } }, @@ -4249,7 +4190,7 @@ "dev": true, "requires": { "debug": "2.6.9", - "nan": "2.11.0", + "nan": "2.12.0", "typedarray-to-buffer": "3.1.5", "yaeti": "0.0.6" }, diff --git a/test/gateway/eip20_cogateway/helpers/helper.js b/test/gateway/eip20_cogateway/helpers/helper.js index a994c5df..396acf8c 100644 --- a/test/gateway/eip20_cogateway/helpers/helper.js +++ b/test/gateway/eip20_cogateway/helpers/helper.js @@ -33,8 +33,7 @@ EIP20CoGatewayHelper.prototype = { * It sets the cogateway address. * @param coGateway CoGateway contract address. */ - setCoGateway: async function (coGateway) - { + setCoGateway: async function (coGateway) { this.coGateway = coGateway; @@ -45,11 +44,10 @@ EIP20CoGatewayHelper.prototype = { * * @return {string} Message type hash. */ - redeemTypeHash: async function () - { + redeemTypeHash: async function () { return web3.utils.soliditySha3( 'string', - 'Redeem(uint256 amount,address beneficiary,MessageBus.Message message)' + 'Redeem(uint256 amount,address beneficiary,MessageBus.Message message)', ); }, @@ -73,8 +71,8 @@ EIP20CoGatewayHelper.prototype = { nonce, gasPrice, gasLimit, - token) - { + token + ) { return web3.utils.soliditySha3( {t: 'uint256', v: amount}, @@ -83,7 +81,7 @@ EIP20CoGatewayHelper.prototype = { {t: 'uint256', v: nonce}, {t: 'uint256', v: gasPrice}, {t: 'uint256', v: gasLimit}, - {t: 'address', v: token} + {t: 'address', v: token}, ); }, @@ -94,8 +92,7 @@ EIP20CoGatewayHelper.prototype = { * * @returns {Promise} Nonce of the address. */ - getNonce: async function (address) - { + getNonce: async function (address) { return await this.coGateway.getNonce.call(address); } diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index 40848c57..eec5cabf 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -24,14 +24,14 @@ const BN = require('bn.js'), MessageBus = artifacts.require('MessageBus'), EIP20Token = artifacts.require('EIP20Token'), TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), - TestUtilityToken = artifacts.require('TestUtilityToken'); + MockUtilityToken = artifacts.require('MockUtilityToken'); let valueToken, burner, mockSafeCore, membersManager, coGateway, - testUtilityToken, + mockUtilityToken, bountyAmount, owner, staker, @@ -61,7 +61,7 @@ async function _setup(accounts) { membersManager = accounts[2]; coGateway = accounts[3]; owner = accounts[8]; - testUtilityToken = await TestUtilityToken.new( + mockUtilityToken = await MockUtilityToken.new( valueToken, symbol, name, @@ -111,7 +111,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { ); testEIP20CoGateway = await TestEIP20CoGateway.new( valueToken, - testUtilityToken.address, + mockUtilityToken.address, mockSafeCore, bountyAmount, membersManager, @@ -119,7 +119,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { burner, ); - await testUtilityToken.setCoGatewayAddress(testEIP20CoGateway.address); + await mockUtilityToken.setCoGatewayAddress(testEIP20CoGateway.address); await helper.setCoGateway(testEIP20CoGateway.address); @@ -190,8 +190,8 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { {from: facilitator}, ); - let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); - let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); + let facilitatorBalance = await mockUtilityToken.balanceOf(facilitator); + let beneficiaryBalance = await mockUtilityToken.balanceOf(beneficiary); assert.strictEqual( facilitatorBalance.eq(expectedReward), @@ -261,8 +261,8 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { {from: facilitator}, ); - let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); - let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); + let facilitatorBalance = await mockUtilityToken.balanceOf(facilitator); + let beneficiaryBalance = await mockUtilityToken.balanceOf(beneficiary); assert.strictEqual( beneficiaryBalance.eq(amount), @@ -332,7 +332,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - 'Message status must be Declared.' + 'Message status must be Declared.', ); }); @@ -350,7 +350,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - 'Message status must be Declared.' + 'Message status must be Declared.', ); }); @@ -368,7 +368,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - 'Message status must be Declared.' + 'Message status must be Declared.', ); }); @@ -388,7 +388,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - 'Invalid unlock secret.' + 'Invalid unlock secret.', ); }); From 71e453484b3fb5d412166de36ec33eb45421ce35 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Tue, 18 Dec 2018 20:24:55 +0530 Subject: [PATCH 20/24] Added MockUtilityToken instead of TestUtilityToken --- contracts/gateway/UtilityTokenInterface.sol | 13 ++++ contracts/test/gateway/MockUtilityToken.sol | 63 +++++++++++++++++++ test/gateway/eip20_cogateway/progress_mint.js | 26 ++++---- 3 files changed, 89 insertions(+), 13 deletions(-) create mode 100644 contracts/test/gateway/MockUtilityToken.sol diff --git a/contracts/gateway/UtilityTokenInterface.sol b/contracts/gateway/UtilityTokenInterface.sol index fb0a727c..a7559965 100644 --- a/contracts/gateway/UtilityTokenInterface.sol +++ b/contracts/gateway/UtilityTokenInterface.sol @@ -61,4 +61,17 @@ contract UtilityTokenInterface { */ function decreaseSupply(uint256 _amount) external returns (bool success_); + /** + * @notice Sets the CoGateway contract address. + * + * @dev Function requires: + * - It is called by whitelisted workers. + * - coGateway address is set only once. + * - coGateway.utilityToken must match this contract. + * + * @param _coGateway CoGateway contract address. + * + */ + function setCoGateway(address _coGateway) external returns (bool); + } diff --git a/contracts/test/gateway/MockUtilityToken.sol b/contracts/test/gateway/MockUtilityToken.sol new file mode 100644 index 00000000..bc128027 --- /dev/null +++ b/contracts/test/gateway/MockUtilityToken.sol @@ -0,0 +1,63 @@ +pragma solidity ^0.5.0; + +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ---------------------------------------------------------------------------- +// +// http://www.simpletoken.org/ +// +// ---------------------------------------------------------------------------- + +import "../../gateway/UtilityToken.sol"; + +/** + * @title TestUtilityToken contract + * + * @notice This contract is used to mock certain functions of UtilityToken + * contract. + */ +contract MockUtilityToken is UtilityToken { + + /* Constructor */ + + /** + * @dev This is used for testing by mocking certain variables. + * + * @param _token Address of branded token. + * @param _symbol Symbol of token. + * @param _name Name of token. + * @param _decimals Decimal of token. + */ + constructor( + EIP20Interface _token, + string memory _symbol, + string memory _name, + uint8 _decimals, + IsMemberInterface _membersManager + ) + public + UtilityToken(_token, _symbol, _name, _decimals, _membersManager) + {} + + /** + * @notice Set the CoGateway address for testing. + * + * @param _coGatewayAddress CoGateway address. + */ + function setCoGatewayAddress(address _coGatewayAddress) public { + coGateway = _coGatewayAddress; + } + +} diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index eec5cabf..3249c587 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -24,14 +24,14 @@ const BN = require('bn.js'), MessageBus = artifacts.require('MessageBus'), EIP20Token = artifacts.require('EIP20Token'), TestEIP20CoGateway = artifacts.require('TestEIP20CoGateway'), - MockUtilityToken = artifacts.require('MockUtilityToken'); + TestUtilityToken = artifacts.require('TestUtilityToken'); let valueToken, burner, mockSafeCore, membersManager, coGateway, - mockUtilityToken, + testUtilityToken, bountyAmount, owner, staker, @@ -61,7 +61,7 @@ async function _setup(accounts) { membersManager = accounts[2]; coGateway = accounts[3]; owner = accounts[8]; - mockUtilityToken = await MockUtilityToken.new( + testUtilityToken = await TestUtilityToken.new( valueToken, symbol, name, @@ -111,7 +111,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { ); testEIP20CoGateway = await TestEIP20CoGateway.new( valueToken, - mockUtilityToken.address, + testUtilityToken.address, mockSafeCore, bountyAmount, membersManager, @@ -119,7 +119,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { burner, ); - await mockUtilityToken.setCoGatewayAddress(testEIP20CoGateway.address); + await testUtilityToken.setCoGatewayAddress(testEIP20CoGateway.address); await helper.setCoGateway(testEIP20CoGateway.address); @@ -190,8 +190,8 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { {from: facilitator}, ); - let facilitatorBalance = await mockUtilityToken.balanceOf(facilitator); - let beneficiaryBalance = await mockUtilityToken.balanceOf(beneficiary); + let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); + let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); assert.strictEqual( facilitatorBalance.eq(expectedReward), @@ -261,8 +261,8 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { {from: facilitator}, ); - let facilitatorBalance = await mockUtilityToken.balanceOf(facilitator); - let beneficiaryBalance = await mockUtilityToken.balanceOf(beneficiary); + let facilitatorBalance = await testUtilityToken.balanceOf(facilitator); + let beneficiaryBalance = await testUtilityToken.balanceOf(beneficiary); assert.strictEqual( beneficiaryBalance.eq(amount), @@ -332,7 +332,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - 'Message status must be Declared.', + 'Message on target status must be Declared.', ); }); @@ -350,7 +350,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - 'Message status must be Declared.', + 'Message on target status must be Declared.', ); }); @@ -368,7 +368,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - 'Message status must be Declared.', + 'Message on target status must be Declared.', ); }); @@ -412,7 +412,7 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { unlockSecret, {from: facilitator}, ), - 'Message status must be Declared.', + 'Message on target status must be Declared.', ); }); From 514dd56b5b34191bd95964c278b62b4bbaf14847 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Tue, 18 Dec 2018 22:46:20 +0530 Subject: [PATCH 21/24] Corrected indentation of constructor --- contracts/test/gateway/TestUtilityToken.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/test/gateway/TestUtilityToken.sol b/contracts/test/gateway/TestUtilityToken.sol index b954063b..2b9015f5 100644 --- a/contracts/test/gateway/TestUtilityToken.sol +++ b/contracts/test/gateway/TestUtilityToken.sol @@ -47,9 +47,9 @@ contract TestUtilityToken is UtilityToken { uint8 _decimals, IsMemberInterface _membersManager ) - public - UtilityToken(_token, _symbol, _name, _decimals, _membersManager) - {} + public + UtilityToken(_token, _symbol, _name, _decimals, _membersManager) + {} /** * @notice Set the CoGateway address for testing. From b167ec934a8f896f91ef321bc18d0eaf137f6321 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Tue, 18 Dec 2018 22:51:29 +0530 Subject: [PATCH 22/24] Updated documentation of MockUtilityToken --- contracts/test/gateway/MockUtilityToken.sol | 15 +++++++++------ contracts/test/gateway/TestUtilityToken.sol | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/contracts/test/gateway/MockUtilityToken.sol b/contracts/test/gateway/MockUtilityToken.sol index bc128027..7bd9c4a7 100644 --- a/contracts/test/gateway/MockUtilityToken.sol +++ b/contracts/test/gateway/MockUtilityToken.sol @@ -23,7 +23,7 @@ pragma solidity ^0.5.0; import "../../gateway/UtilityToken.sol"; /** - * @title TestUtilityToken contract + * @title MockUtilityToken contract. * * @notice This contract is used to mock certain functions of UtilityToken * contract. @@ -33,12 +33,15 @@ contract MockUtilityToken is UtilityToken { /* Constructor */ /** - * @dev This is used for testing by mocking certain variables. + * @notice Constructor. + * + * @dev This is used for testing only. * * @param _token Address of branded token. * @param _symbol Symbol of token. * @param _name Name of token. * @param _decimals Decimal of token. + * @param _membersManager Address of a contract that manages organization. */ constructor( EIP20Interface _token, @@ -47,16 +50,16 @@ contract MockUtilityToken is UtilityToken { uint8 _decimals, IsMemberInterface _membersManager ) - public - UtilityToken(_token, _symbol, _name, _decimals, _membersManager) - {} + public + UtilityToken(_token, _symbol, _name, _decimals, _membersManager) + {} /** * @notice Set the CoGateway address for testing. * * @param _coGatewayAddress CoGateway address. */ - function setCoGatewayAddress(address _coGatewayAddress) public { + function setCoGatewayAddress(address _coGatewayAddress) external { coGateway = _coGatewayAddress; } diff --git a/contracts/test/gateway/TestUtilityToken.sol b/contracts/test/gateway/TestUtilityToken.sol index 2b9015f5..95295740 100644 --- a/contracts/test/gateway/TestUtilityToken.sol +++ b/contracts/test/gateway/TestUtilityToken.sol @@ -39,6 +39,7 @@ contract TestUtilityToken is UtilityToken { * @param _symbol Symbol of token. * @param _name Name of token. * @param _decimals Decimal of token. + * @param _membersManager Address of a contract that manages organization. */ constructor( EIP20Interface _token, From e7a0f12b934f2834b0107048f99bf4c5728fa31e Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Wed, 19 Dec 2018 10:14:47 +0530 Subject: [PATCH 23/24] Indentation fixes of constructor --- contracts/test/gateway/MockUtilityToken.sol | 2 +- contracts/test/gateway/TestUtilityToken.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/test/gateway/MockUtilityToken.sol b/contracts/test/gateway/MockUtilityToken.sol index 7bd9c4a7..638fc956 100644 --- a/contracts/test/gateway/MockUtilityToken.sol +++ b/contracts/test/gateway/MockUtilityToken.sol @@ -52,7 +52,7 @@ contract MockUtilityToken is UtilityToken { ) public UtilityToken(_token, _symbol, _name, _decimals, _membersManager) - {} + {} /** * @notice Set the CoGateway address for testing. diff --git a/contracts/test/gateway/TestUtilityToken.sol b/contracts/test/gateway/TestUtilityToken.sol index 95295740..9c765339 100644 --- a/contracts/test/gateway/TestUtilityToken.sol +++ b/contracts/test/gateway/TestUtilityToken.sol @@ -50,7 +50,7 @@ contract TestUtilityToken is UtilityToken { ) public UtilityToken(_token, _symbol, _name, _decimals, _membersManager) - {} + {} /** * @notice Set the CoGateway address for testing. From cfa941c0c44aebf366966d5ae80556173ee96d56 Mon Sep 17 00:00:00 2001 From: Gulshan Vasnani Date: Wed, 19 Dec 2018 13:24:05 +0530 Subject: [PATCH 24/24] Removed setCoGateway and getNonce method from helper --- .../gateway/eip20_cogateway/helpers/helper.js | 22 ------------------- test/gateway/eip20_cogateway/progress_mint.js | 2 -- 2 files changed, 24 deletions(-) diff --git a/test/gateway/eip20_cogateway/helpers/helper.js b/test/gateway/eip20_cogateway/helpers/helper.js index 396acf8c..a9e4626c 100644 --- a/test/gateway/eip20_cogateway/helpers/helper.js +++ b/test/gateway/eip20_cogateway/helpers/helper.js @@ -29,16 +29,6 @@ const EIP20CoGatewayHelper = function () { EIP20CoGatewayHelper.prototype = { - /** - * It sets the cogateway address. - * @param coGateway CoGateway contract address. - */ - setCoGateway: async function (coGateway) { - - this.coGateway = coGateway; - - }, - /** * Generate the redeem type hash. This is as per EIP-712. * @@ -85,18 +75,6 @@ EIP20CoGatewayHelper.prototype = { ); }, - /** - * It returns the nonce value for the account address. - * - * @param address Account for which nonce is required. - * - * @returns {Promise} Nonce of the address. - */ - getNonce: async function (address) { - - return await this.coGateway.getNonce.call(address); - } - }; module.exports = EIP20CoGatewayHelper; diff --git a/test/gateway/eip20_cogateway/progress_mint.js b/test/gateway/eip20_cogateway/progress_mint.js index 3249c587..99cefbfc 100644 --- a/test/gateway/eip20_cogateway/progress_mint.js +++ b/test/gateway/eip20_cogateway/progress_mint.js @@ -121,8 +121,6 @@ contract('EIP20CoGateway.progressMint() ', function (accounts) { await testUtilityToken.setCoGatewayAddress(testEIP20CoGateway.address); - await helper.setCoGateway(testEIP20CoGateway.address); - messageHash = await testEIP20CoGateway.setStakeMessage.call( intentHash, nonce,