From 8283385824968de7ab5bb339e56c3de6e4b224ab Mon Sep 17 00:00:00 2001 From: Ivan Poon Date: Mon, 10 Jun 2019 14:03:05 +0800 Subject: [PATCH 01/12] Burn baby burn --- contracts/BombBurner.sol | 87 ++++++++++++++++++++ contracts/BombCoin.sol | 168 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 255 insertions(+) create mode 100644 contracts/BombBurner.sol create mode 100644 contracts/BombCoin.sol diff --git a/contracts/BombBurner.sol b/contracts/BombBurner.sol new file mode 100644 index 0000000..5444722 --- /dev/null +++ b/contracts/BombBurner.sol @@ -0,0 +1,87 @@ +pragma solidity 0.4.25; + +import "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import "./BombCoin.sol"; +import "./Broker.sol"; + +/// @title The AirDropper contract to send ether to users +/// @author Switcheo Network +contract BombBurner { + using SafeMath for uint256; + + // The Switcheo Broker contract + BOMBv3 public bomb; + Broker public broker; + + uint8 constant ReasonDepositBurnGive = 0x40; + uint8 constant ReasonDepositBurnReceive = 0x41; + + // A record of deposits that will have 1% burnt + mapping(address => uint256) public preparedBurnAmounts; + mapping(address => bytes32) public preparedBurnHashes; + + // Emitted when ether is sent + event SendEther(bytes32 indexed id, address indexed receiver, uint256 amount); + + /// @notice Initializes the AirDropper contract + /// @dev The broker is initialized to the Switcheo Broker + constructor(address brokerAddress, address bombAddress) + public + { + broker = Broker(brokerAddress); + bomb = BOMBv3(bombAddress); + } + + modifier onlyCoordinator() { + require( + msg.sender == address(broker.coordinator()), + "Invalid sender" + ); + _; + } + + function prepareBurn( + address _depositer, + uint256 _depositAmount, + bytes32 _approvalTransactionHash + ) + external + onlyCoordinator + { + require( + bomb.allowance(_depositer, address(broker)) == _depositAmount, + "Invalid deposit amount" + ); + + preparedBurnAmounts[_depositer] = bomb.findOnePercent(_depositAmount); + preparedBurnHashes[_depositer] = _approvalTransactionHash; + } + + function executeBurn( + address _depositer, + uint256 _burnAmount, + bytes32 _approvalTransactionHash + ) + external + onlyCoordinator + { + require( + preparedBurnAmounts[_depositer] == _burnAmount, + "Invalid burn amount" + ); + + require( + preparedBurnHashes[_depositer] == _approvalTransactionHash, + "Invalid approval transaction hash" + ); + + broker.spendFrom( + _depositer, + address(this), + _burnAmount, + address(bomb), + ReasonDepositBurnGive, + ReasonDepositBurnReceive + ); + } +} diff --git a/contracts/BombCoin.sol b/contracts/BombCoin.sol new file mode 100644 index 0000000..ef9b5a6 --- /dev/null +++ b/contracts/BombCoin.sol @@ -0,0 +1,168 @@ +/** + *Submitted for verification at Etherscan.io on 2019-02-11 +*/ + +pragma solidity ^0.5.0; + +import "openzeppelin-solidity/contracts/math/SafeMath.sol"; + +interface IERC20 { + function totalSupply() external view returns (uint256); + function balanceOf(address who) external view returns (uint256); + function allowance(address owner, address spender) external view returns (uint256); + function transfer(address to, uint256 value) external returns (bool); + function approve(address spender, uint256 value) external returns (bool); + function transferFrom(address from, address to, uint256 value) external returns (bool); + + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval(address indexed owner, address indexed spender, uint256 value); +} + +contract ERC20Detailed is IERC20 { + + string private _name; + string private _symbol; + uint8 private _decimals; + + constructor(string memory name, string memory symbol, uint8 decimals) public { + _name = name; + _symbol = symbol; + _decimals = decimals; + } + + function name() public view returns(string memory) { + return _name; + } + + function symbol() public view returns(string memory) { + return _symbol; + } + + function decimals() public view returns(uint8) { + return _decimals; + } +} + +contract BOMBv3 is ERC20Detailed { + + using SafeMath for uint256; + mapping (address => uint256) private _balances; + mapping (address => mapping (address => uint256)) private _allowed; + + string constant tokenName = "BOMB"; + string constant tokenSymbol = "BOMB"; + uint8 constant tokenDecimals = 0; + uint256 _totalSupply = 1000000; + uint256 public basePercent = 100; + + constructor() public payable ERC20Detailed(tokenName, tokenSymbol, tokenDecimals) { + _mint(msg.sender, _totalSupply); + } + + function totalSupply() public view returns (uint256) { + return _totalSupply; + } + + function balanceOf(address owner) public view returns (uint256) { + return _balances[owner]; + } + + function allowance(address owner, address spender) public view returns (uint256) { + return _allowed[owner][spender]; + } + + function findOnePercent(uint256 value) public view returns (uint256) { + uint256 roundValue = value.ceil(basePercent); + uint256 onePercent = roundValue.mul(basePercent).div(10000); + return onePercent; + } + + function transfer(address to, uint256 value) public returns (bool) { + require(value <= _balances[msg.sender]); + require(to != address(0)); + + uint256 tokensToBurn = findOnePercent(value); + uint256 tokensToTransfer = value.sub(tokensToBurn); + + _balances[msg.sender] = _balances[msg.sender].sub(value); + _balances[to] = _balances[to].add(tokensToTransfer); + + _totalSupply = _totalSupply.sub(tokensToBurn); + + emit Transfer(msg.sender, to, tokensToTransfer); + emit Transfer(msg.sender, address(0), tokensToBurn); + return true; + } + + function multiTransfer(address[] memory receivers, uint256[] memory amounts) public { + for (uint256 i = 0; i < receivers.length; i++) { + transfer(receivers[i], amounts[i]); + } + } + + function approve(address spender, uint256 value) public returns (bool) { + require(spender != address(0)); + _allowed[msg.sender][spender] = value; + emit Approval(msg.sender, spender, value); + return true; + } + + function transferFrom(address from, address to, uint256 value) public returns (bool) { + require(value <= _balances[from]); + require(value <= _allowed[from][msg.sender]); + require(to != address(0)); + + _balances[from] = _balances[from].sub(value); + + uint256 tokensToBurn = findOnePercent(value); + uint256 tokensToTransfer = value.sub(tokensToBurn); + + _balances[to] = _balances[to].add(tokensToTransfer); + _totalSupply = _totalSupply.sub(tokensToBurn); + + _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); + + emit Transfer(from, to, tokensToTransfer); + emit Transfer(from, address(0), tokensToBurn); + + return true; + } + + function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { + require(spender != address(0)); + _allowed[msg.sender][spender] = (_allowed[msg.sender][spender].add(addedValue)); + emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); + return true; + } + + function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { + require(spender != address(0)); + _allowed[msg.sender][spender] = (_allowed[msg.sender][spender].sub(subtractedValue)); + emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); + return true; + } + + function _mint(address account, uint256 amount) internal { + require(amount != 0); + _balances[account] = _balances[account].add(amount); + emit Transfer(address(0), account, amount); + } + + function burn(uint256 amount) external { + _burn(msg.sender, amount); + } + + function _burn(address account, uint256 amount) internal { + require(amount != 0); + require(amount <= _balances[account]); + _totalSupply = _totalSupply.sub(amount); + _balances[account] = _balances[account].sub(amount); + emit Transfer(account, address(0), amount); + } + + function burnFrom(address account, uint256 amount) external { + require(amount <= _allowed[account][msg.sender]); + _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(amount); + _burn(account, amount); + } +} From 0201096dd02054067ef88682f3e0022b936e7e66 Mon Sep 17 00:00:00 2001 From: Ivan Poon Date: Mon, 10 Jun 2019 14:33:33 +0800 Subject: [PATCH 02/12] Update packages --- contracts/BombCoin.sol | 37 +- package-lock.json | 1643 +++++++++------------------------------- package.json | 4 +- truffle-config.js | 18 - truffle.js | 5 + 5 files changed, 379 insertions(+), 1328 deletions(-) delete mode 100755 truffle-config.js diff --git a/contracts/BombCoin.sol b/contracts/BombCoin.sol index ef9b5a6..08b58b7 100644 --- a/contracts/BombCoin.sol +++ b/contracts/BombCoin.sol @@ -2,9 +2,40 @@ *Submitted for verification at Etherscan.io on 2019-02-11 */ -pragma solidity ^0.5.0; +pragma solidity 0.4.25; -import "openzeppelin-solidity/contracts/math/SafeMath.sol"; +library SafeMathCustom { + function mul(uint256 a, uint256 b) internal pure returns (uint256) { + if (a == 0) { + return 0; + } + uint256 c = a * b; + assert(c / a == b); + return c; + } + + function div(uint256 a, uint256 b) internal pure returns (uint256) { + uint256 c = a / b; + return c; + } + + function sub(uint256 a, uint256 b) internal pure returns (uint256) { + assert(b <= a); + return a - b; + } + + function add(uint256 a, uint256 b) internal pure returns (uint256) { + uint256 c = a + b; + assert(c >= a); + return c; + } + + function ceil(uint256 a, uint256 m) internal pure returns (uint256) { + uint256 c = add(a,m); + uint256 d = sub(c,1); + return mul(div(d,m),m); + } +} interface IERC20 { function totalSupply() external view returns (uint256); @@ -45,7 +76,7 @@ contract ERC20Detailed is IERC20 { contract BOMBv3 is ERC20Detailed { - using SafeMath for uint256; + using SafeMathCustom for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; diff --git a/package-lock.json b/package-lock.json index 661653e..0d31407 100755 --- a/package-lock.json +++ b/package-lock.json @@ -2,10 +2,33 @@ "requires": true, "lockfileVersion": 1, "dependencies": { + "@babel/runtime": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz", + "integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==", + "requires": { + "regenerator-runtime": "^0.13.2" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" + } + } + }, + "@types/bn.js": { + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", + "integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==", + "requires": { + "@types/node": "*" + } + }, "@types/node": { - "version": "10.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.7.tgz", - "integrity": "sha512-yOxFfkN9xUFLyvWaeYj90mlqTJ41CsQzWKS3gXdOMOyPVacUsymejKxJ4/pMW7exouubuEeZLJawGgcNGYlTeg==" + "version": "10.14.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.8.tgz", + "integrity": "sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw==" }, "abi-decoder": { "version": "1.2.0", @@ -44,15 +67,6 @@ "xtend": "~4.0.0" } }, - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "requires": { - "mime-types": "~2.1.18", - "negotiator": "0.6.1" - } - }, "aes-js": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-0.2.4.tgz", @@ -84,11 +98,6 @@ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -97,16 +106,6 @@ "safer-buffer": "~2.1.0" } }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -742,11 +741,6 @@ "resolved": "https://registry.npmjs.org/base-x/-/base-x-1.1.0.tgz", "integrity": "sha1-QtPXF0dPnqAiB/bRqh9CaRPut6w=" }, - "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" - }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -766,18 +760,6 @@ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" }, - "bip39": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-2.5.0.tgz", - "integrity": "sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA==", - "requires": { - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1", - "safe-buffer": "^5.0.1", - "unorm": "^1.3.3" - } - }, "bip66": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", @@ -786,50 +768,11 @@ "safe-buffer": "^5.0.1" } }, - "bl": { - "version": "1.2.2", - "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", - "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", - "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "requires": { - "inherits": "~2.0.0" - } - }, - "bluebird": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", - "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==" - }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, - "body-parser": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", - "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", - "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.23", - "on-finished": "~2.3.0", - "qs": "6.5.2", - "raw-body": "2.3.3", - "type-is": "~1.6.16" - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -878,15 +821,6 @@ "safe-buffer": "^5.1.2" } }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, "browserify-sha3": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.1.tgz", @@ -895,20 +829,6 @@ "js-sha3": "^0.3.1" } }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "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" - } - }, "browserslist": { "version": "3.2.8", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", @@ -935,39 +855,6 @@ "create-hash": "^1.1.0" } }, - "buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" - }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -988,11 +875,6 @@ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" - }, "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", @@ -1086,14 +968,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", - "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", - "requires": { - "graceful-readlink": ">= 1.0.0" - } - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1110,16 +984,6 @@ "typedarray": "^0.0.6" } }, - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" - }, "convert-source-map": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", @@ -1128,16 +992,6 @@ "safe-buffer": "~5.1.1" } }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, "cookiejar": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", @@ -1153,24 +1007,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "cors": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", - "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, "create-hash": { "version": "1.2.0", "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -1205,28 +1041,11 @@ "whatwg-fetch": "2.0.4" } }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.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" - } - }, "crypto-js": { "version": "3.1.8", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", - "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=" + "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=", + "dev": true }, "dashdash": { "version": "1.14.1", @@ -1254,21 +1073,6 @@ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, - "decompress": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz", - "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", - "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-response": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", @@ -1277,72 +1081,6 @@ "mimic-response": "^1.0.0" } }, - "decompress-tar": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", - "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", - "requires": { - "file-type": "^5.2.0", - "is-stream": "^1.1.0", - "tar-stream": "^1.5.2" - } - }, - "decompress-tarbz2": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", - "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", - "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" - }, - "dependencies": { - "file-type": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", - "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==" - } - } - }, - "decompress-targz": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", - "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", - "requires": { - "decompress-tar": "^4.1.1", - "file-type": "^5.2.0", - "is-stream": "^1.1.0" - } - }, - "decompress-unzip": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", - "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", - "requires": { - "file-type": "^3.8.0", - "get-stream": "^2.2.0", - "pify": "^2.3.0", - "yauzl": "^2.4.2" - }, - "dependencies": { - "file-type": { - "version": "3.9.0", - "resolved": "http://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", - "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=" - }, - "get-stream": { - "version": "2.3.1", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", - "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", - "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - } - } - } - }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", @@ -1374,11 +1112,6 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, "des.js": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", @@ -1388,11 +1121,6 @@ "minimalistic-assert": "^1.0.0" } }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -1401,16 +1129,6 @@ "repeating": "^2.0.0" } }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, "dom-walk": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", @@ -1426,11 +1144,6 @@ "create-hmac": "^1.1.4" } }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -1440,11 +1153,6 @@ "safer-buffer": "^2.1.0" } }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, "electron-to-chromium": { "version": "1.3.79", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.79.tgz", @@ -1464,11 +1172,6 @@ "minimalistic-crypto-utils": "^1.0.0" } }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" - }, "encoding": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", @@ -1523,11 +1226,6 @@ "is-symbol": "^1.0.2" } }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1538,11 +1236,6 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" - }, "eth-block-tracker": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz", @@ -1638,16 +1331,12 @@ } }, "eth-lib": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", - "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", "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" } }, @@ -1665,7 +1354,7 @@ "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz", "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799", + "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "ethereumjs-util": "^5.1.1" }, "dependencies": { @@ -1800,21 +1489,21 @@ "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=" }, "ethereumjs-abi": { - "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799", + "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#8431eab7b3384e65e8126a4602520b78031666fb", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^5.0.0" + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" }, "dependencies": { "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", "requires": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", + "ethjs-util": "0.1.6", "keccak": "^1.0.2", "rlp": "^2.0.0", "safe-buffer": "^5.1.1", @@ -1978,9 +1667,9 @@ } }, "ethers": { - "version": "4.0.0-beta.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.1.tgz", - "integrity": "sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw==", + "version": "4.0.29", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.29.tgz", + "integrity": "sha512-WCaH8an3Y+i85zW6Y6fmt0oQE9GXJy9NjqNVDTJVUJ/WBLIB1z17nG16lbOz3zVYWFgarfnzVakN2G7AyXk1Xg==", "requires": { "@types/node": "^10.3.2", "aes-js": "3.0.0", @@ -1988,7 +1677,7 @@ "elliptic": "6.3.3", "hash.js": "1.1.3", "js-sha3": "0.5.7", - "scrypt-js": "2.0.3", + "scrypt-js": "2.0.4", "setimmediate": "1.0.4", "uuid": "2.0.1", "xmlhttprequest": "1.8.0" @@ -2024,14 +1713,9 @@ "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" - }, "uuid": { "version": "2.0.1", - "resolved": "http://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" } } @@ -2062,9 +1746,9 @@ } }, "eventemitter3": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz", - "integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA=" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" }, "events": { "version": "3.0.0", @@ -2080,50 +1764,6 @@ "safe-buffer": "^5.1.1" } }, - "express": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", - "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", - "requires": { - "accepts": "~1.3.5", - "array-flatten": "1.1.1", - "body-parser": "1.18.3", - "content-disposition": "0.5.2", - "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", - "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", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.4", - "qs": "6.5.2", - "range-parser": "~1.2.0", - "safe-buffer": "5.1.2", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "~1.4.0", - "type-is": "~1.6.16", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" - } - } - }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -2152,14 +1792,6 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "requires": { - "pend": "~1.2.0" - } - }, "fetch-ponyfill": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz", @@ -2179,31 +1811,10 @@ } } }, - "file-type": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", - "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=" - }, - "finalhandler": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.4.0", - "unpipe": "~1.0.0" - }, - "dependencies": { - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" - } - } + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "find-up": { "version": "1.1.2", @@ -2247,21 +1858,6 @@ } } }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" - }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", @@ -2274,44 +1870,11 @@ "rimraf": "^2.2.8" } }, - "fs-promise": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/fs-promise/-/fs-promise-2.0.3.tgz", - "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", - "requires": { - "any-promise": "^1.3.0", - "fs-extra": "^2.0.0", - "mz": "^2.6.0", - "thenify-all": "^1.6.0" - }, - "dependencies": { - "fs-extra": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", - "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0" - } - } - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -2327,11 +1890,6 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, - "get-stream": { - "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" - }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -2367,37 +1925,11 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" }, - "got": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", - "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", - "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" - } - }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" - }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -2428,24 +1960,11 @@ "ansi-regex": "^2.0.0" } }, - "has-symbol-support-x": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", - "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==" - }, "has-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" }, - "has-to-string-tag-x": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", - "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", - "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, "hash-base": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", @@ -2497,22 +2016,6 @@ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" }, - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "http-https": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", - "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=" - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -2546,11 +2049,6 @@ } } }, - "ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==" - }, "immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", @@ -2583,11 +2081,6 @@ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" }, - "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -2642,21 +2135,6 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, - "is-natural-number": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", - "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=" - }, - "is-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", - "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" - }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", @@ -2665,11 +2143,6 @@ "has": "^1.0.1" } }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=" - }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -2703,15 +2176,6 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, - "isurl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", - "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - } - }, "js-sha256": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", @@ -2995,31 +2459,11 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" - }, "ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - } - } - }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -3030,11 +2474,6 @@ "safe-buffer": "^5.1.2" } }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, "memdown": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", @@ -3063,11 +2502,6 @@ "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, "merkle-patricia-tree": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", @@ -3104,25 +2538,6 @@ } } }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" - }, "mime-db": { "version": "1.35.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", @@ -3180,54 +2595,16 @@ "minimist": "0.0.8" } }, - "mkdirp-promise": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", - "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", - "requires": { - "mkdirp": "*" - } - }, - "mock-fs": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.7.0.tgz", - "integrity": "sha512-WlQNtUlzMRpvLHf8dqeUmNqfdPjGY29KrJF50Ldb4AcL+vQeR8QH3wQcFMgrhTwb1gHjZn9xggho+84tBskLgA==" - }, - "mout": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/mout/-/mout-0.11.1.tgz", - "integrity": "sha1-ujYR318OWx/7/QEWa48C0fX6K5k=" - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, "nan": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" }, - "nano-json-stream-parser": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", - "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=" - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, "node-fetch": { "version": "2.1.2", "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", @@ -3285,22 +2662,6 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" }, - "oboe": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.3.tgz", - "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", - "requires": { - "http-https": "^1.0.0" - } - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3332,36 +2693,6 @@ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, - "p-cancelable": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", - "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==" - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "p-timeout": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", - "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", - "requires": { - "p-finally": "^1.0.0" - } - }, - "parse-asn1": { - "version": "5.1.1", - "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", - "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", - "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" - } - }, "parse-headers": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", @@ -3379,11 +2710,6 @@ "error-ex": "^1.2.0" } }, - "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" - }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", @@ -3402,11 +2728,6 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", @@ -3429,11 +2750,6 @@ "sha.js": "^2.4.8" } }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -3462,11 +2778,6 @@ "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=" }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" - }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", @@ -3491,15 +2802,6 @@ "set-immediate-shim": "^1.0.1" } }, - "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.8.0" - } - }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -3510,19 +2812,6 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "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", - "safe-buffer": "^5.1.2" - } - }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -3535,7 +2824,7 @@ }, "query-string": { "version": "5.1.1", - "resolved": "http://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "requires": { "decode-uri-component": "^0.2.0", @@ -3543,43 +2832,10 @@ "strict-uri-encode": "^1.0.0" } }, - "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "randomhex": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", - "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=" - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" - }, - "raw-body": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", - "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", - "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.3", - "iconv-lite": "0.4.23", - "unpipe": "1.0.0" - } + "querystringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" }, "read-pkg": { "version": "1.1.0", @@ -3714,6 +2970,11 @@ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, "resolve": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", @@ -3760,6 +3021,14 @@ "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.1.2.tgz", "integrity": "sha512-bAkNqSHYdJdFsBC7Z11JgzYktL31HIpB2o70jZcGiL1U1TVtPyvaVhDrGWwS8uZtaqwW2k6NOPGZCqW/Dgh5Lg==" }, + "rxjs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "requires": { + "tslib": "^1.9.0" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -3787,9 +3056,9 @@ } }, "scrypt-js": { - "version": "2.0.3", - "resolved": "http://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", - "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", + "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==" }, "scrypt.js": { "version": "0.2.0", @@ -3823,14 +3092,6 @@ "safe-buffer": "^5.1.0" } }, - "seek-bzip": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", - "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", - "requires": { - "commander": "~2.8.1" - } - }, "semaphore": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", @@ -3841,56 +3102,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==" }, - "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" - }, - "dependencies": { - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" - } - } - }, - "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" - } - }, - "servify": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", - "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", - "requires": { - "body-parser": "^1.16.0", - "cors": "^2.8.1", - "express": "^4.14.0", - "request": "^2.79.0", - "xhr": "^2.3.3" - } - }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -3902,14 +3113,9 @@ "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" }, "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" }, "sha.js": { "version": "2.4.11", @@ -4017,11 +3223,6 @@ "tweetnacl": "~0.14.0" } }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" - }, "strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -4071,14 +3272,6 @@ "is-utf8": "^0.2.0" } }, - "strip-dirs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", - "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", - "requires": { - "is-natural-number": "^4.0.1" - } - }, "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", @@ -4092,37 +3285,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" }, - "swarm-js": { - "version": "0.1.37", - "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.37.tgz", - "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", - "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" - }, - "dependencies": { - "fs-extra": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", - "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0" - } - } - } - }, "tape": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.1.tgz", @@ -4150,65 +3312,6 @@ } } }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" - } - }, - "tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "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" - } - }, - "tar.gz": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/tar.gz/-/tar.gz-1.0.7.tgz", - "integrity": "sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg==", - "requires": { - "bluebird": "^2.9.34", - "commander": "^2.8.1", - "fstream": "^1.0.8", - "mout": "^0.11.0", - "tar": "^2.1.1" - }, - "dependencies": { - "bluebird": { - "version": "2.11.0", - "resolved": "http://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", - "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=" - } - } - }, - "thenify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", - "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", - "requires": { - "any-promise": "^1.0.0" - } - }, - "thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "requires": { - "thenify": ">= 3.1.0 < 4" - } - }, "through": { "version": "2.3.8", "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -4228,11 +3331,6 @@ "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" }, - "to-buffer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" - }, "to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", @@ -4263,30 +3361,21 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" }, "truffle-hdwallet-provider": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/truffle-hdwallet-provider/-/truffle-hdwallet-provider-0.0.6.tgz", - "integrity": "sha512-vh1nCk9+COz9Z1BnDYjrZEc8Z4KCWeoThAX6U13SpHMuSL7gX40ZDWszlVmovPLEwHSJBh/OaFmaduKfeXT9rA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/truffle-hdwallet-provider/-/truffle-hdwallet-provider-1.0.6.tgz", + "integrity": "sha512-cYTG0t9XouLLEBLMjkfHe3s2JO9wrFFVeXEgpW5Ay+8S56isf3LkrAUh0ws9bcYCJ0l7jho9xkaNnakeDqq//Q==", "requires": { - "bip39": "^2.2.0", - "ethereumjs-wallet": "0.6.0", - "web3": "^0.18.2", - "web3-provider-engine": "^14.0.5" + "any-promise": "^1.3.0", + "bindings": "^1.3.1", + "websocket": "^1.0.28" }, "dependencies": { - "bignumber.js": { - "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "from": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" - }, - "web3": { - "version": "0.18.4", - "resolved": "https://registry.npmjs.org/web3/-/web3-0.18.4.tgz", - "integrity": "sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0=", + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "requires": { - "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "crypto-js": "^3.1.4", - "utf8": "^2.1.1", - "xhr2": "*", - "xmlhttprequest": "*" + "file-uri-to-path": "1.0.0" } } } @@ -4301,6 +3390,11 @@ "web3-provider-engine": "^14.0.5" } }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -4314,15 +3408,6 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, - "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.18" - } - }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -4336,58 +3421,13 @@ "is-typedarray": "^1.0.0" } }, - "ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" - }, - "unbzip2-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.1.tgz", - "integrity": "sha512-fIZnvdjblYs7Cru/xC6tCPVhz7JkYcVQQkePwMLyQELzYTds2Xn8QefPVnvdVhhZqubxNA1cASXEH5wcK0Bucw==", + "url-parse": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.4.tgz", + "integrity": "sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg==", "requires": { - "buffer": "^3.0.1", - "through": "^2.3.6" - }, - "dependencies": { - "base64-js": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", - "integrity": "sha1-EQHpVE9KdrG8OybUUsqW16NeeXg=" - }, - "buffer": { - "version": "3.6.0", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-3.6.0.tgz", - "integrity": "sha1-pyyTb3e5a/UvX357RnGAYoVR3vs=", - "requires": { - "base64-js": "0.0.8", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - } - } - }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" - }, - "unorm": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.4.1.tgz", - "integrity": "sha1-NkIA1fE2RsqLzURJAnEzVhR5IwA=" - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "requires": { - "prepend-http": "^1.0.1" + "querystringify": "^2.0.0", + "requires-port": "^1.0.0" } }, "url-set-query": { @@ -4395,11 +3435,6 @@ "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=" }, - "url-to-options": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", - "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=" - }, "utf8": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", @@ -4410,11 +3445,6 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, "uuid": { "version": "2.0.3", "resolved": "http://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", @@ -4429,11 +3459,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -4445,223 +3470,224 @@ } }, "web3": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.36.tgz", - "integrity": "sha512-fZDunw1V0AQS27r5pUN3eOVP7u8YAvyo6vOapdgVRolAu5LgaweP7jncYyLINqIX9ZgWdS5A090bt+ymgaYHsw==", - "requires": { - "web3-bzz": "1.0.0-beta.36", - "web3-core": "1.0.0-beta.36", - "web3-eth": "1.0.0-beta.36", - "web3-eth-personal": "1.0.0-beta.36", - "web3-net": "1.0.0-beta.36", - "web3-shh": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" - } - }, - "web3-bzz": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.36.tgz", - "integrity": "sha512-clDRS/ziboJ5ytnrfxq80YSu9HQsT0vggnT3BkoXadrauyEE/9JNLxRu016jjUxqdkfdv4MgIPDdOS3Bv2ghiw==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.55.tgz", + "integrity": "sha512-yJpwy4IUA3T/F9hWzYQVn0GbJCrAaZ0KTIO3iuqkhaYH0Y09KV7k4GzFi4hN7hT4cFTj4yIKaeVCwQ5kzvi2Vg==", "requires": { - "got": "7.1.0", - "swarm-js": "0.1.37", - "underscore": "1.8.3" + "@babel/runtime": "^7.3.1", + "@types/node": "^10.12.18", + "web3-core": "1.0.0-beta.55", + "web3-eth": "1.0.0-beta.55", + "web3-eth-personal": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-shh": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-core": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.36.tgz", - "integrity": "sha512-C2QW9CMMRZdYAiKiLkMrKRSp+gekSqTDgZTNvlxAdN1hXn4d9UmcmWSJXOmIHqr5N2ISbRod+bW+qChODxVE3Q==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.55.tgz", + "integrity": "sha512-AMMp7TLEtE7u8IJAu/THrRhBTZyZzeo7Y6GiWYNwb5+KStC9hIGLr9cI1KX9R6ZioTOLRHrqT7awDhnJ1ku2mg==", "requires": { - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-core-requestmanager": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "@types/bn.js": "^4.11.4", + "@types/node": "^10.12.18", + "lodash": "^4.17.11", + "web3-core-method": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-core-helpers": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.36.tgz", - "integrity": "sha512-gu74l0htiGWuxLQuMnZqKToFvkSM+UFPE7qUuy1ZosH/h2Jd+VBWg6k4CyNYVYfP0hL5x3CN8SBmB+HMowo55A==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.55.tgz", + "integrity": "sha512-suj9Xy/lIqajaYLJTEjr2rlFgu6hGYwChHmf8+qNrC2luZA6kirTamtB9VThWMxbywx7p0bqQFjW6zXogAgWhg==", "requires": { - "underscore": "1.8.3", - "web3-eth-iban": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "lodash": "^4.17.11", + "web3-core": "1.0.0-beta.55", + "web3-eth-iban": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-core-method": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.36.tgz", - "integrity": "sha512-dJsP3KkGaqBBSdxfzvLsYPOmVaSs1lR/3oKob/gtUYG7UyTnwquwliAc7OXj+gqRA2E/FHZcM83cWdl31ltdSA==", - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-promievent": "1.0.0-beta.36", - "web3-core-subscriptions": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" - } - }, - "web3-core-promievent": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.36.tgz", - "integrity": "sha512-RGIL6TjcOeJTullFLMurChPTsg94cPF6LI763y/sPYtXTDol1vVa+J5aGLp/4WW8v+s+1bSQO6zYq2ZtkbmtEQ==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.55.tgz", + "integrity": "sha512-w1cW/s2ji9qGELHk2uMJCn1ooay0JJLVoPD1nvmsW6OTRWcVjxa62nJrFQhe6P5lEb83Xk9oHgmCxZoVUHibOw==", "requires": { - "any-promise": "1.3.0", - "eventemitter3": "1.1.1" - } - }, - "web3-core-requestmanager": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.36.tgz", - "integrity": "sha512-/CHuaMbiMDu1v8ANGYI7yFCnh1GaCWx5pKnUPJf+QTk2xAAw+Bvd97yZJIWPOK5AOPUIzxgwx9Ob/5ln6mTmYA==", - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36", - "web3-providers-http": "1.0.0-beta.36", - "web3-providers-ipc": "1.0.0-beta.36", - "web3-providers-ws": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "eventemitter3": "3.1.0", + "lodash": "^4.17.11", + "rxjs": "^6.4.0", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-subscriptions": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-core-subscriptions": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.36.tgz", - "integrity": "sha512-/evyLQ8CMEYXC5aUCodDpmEnmGVYQxaIjiEIfA/85f9ifHkfzP1aOwCAjcsLsJWnwrWDagxSpjCYrDtnNabdEw==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.55.tgz", + "integrity": "sha512-pb3oQbUzK7IoyXwag8TYInQddg0rr7BHxKc+Pbs/92hVNQ5ps4iGMVJKezdrjlQ1IJEEUiDIglXl4LZ1hIuMkw==", "requires": { - "eventemitter3": "1.1.1", - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "eventemitter3": "^3.1.0", + "lodash": "^4.17.11" } }, "web3-eth": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.36.tgz", - "integrity": "sha512-uEa0UnbnNHUB4N2O1U+LsvxzSPJ/w3azy5115IseaUdDaiz6IFFgFfFP3ssauayQNCf7v2F44GXLfPhrNeb/Sw==", - "requires": { - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-core-subscriptions": "1.0.0-beta.36", - "web3-eth-abi": "1.0.0-beta.36", - "web3-eth-accounts": "1.0.0-beta.36", - "web3-eth-contract": "1.0.0-beta.36", - "web3-eth-ens": "1.0.0-beta.36", - "web3-eth-iban": "1.0.0-beta.36", - "web3-eth-personal": "1.0.0-beta.36", - "web3-net": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.55.tgz", + "integrity": "sha512-F3zJ9I1gOgQdNGfi2Dy2lmj6OqCMJoRN01XHhQZagq0HY1JYMfObtfMi5E3L+qsegsSddHbqp4YY57tKx6uxpA==", + "requires": { + "@babel/runtime": "^7.3.1", + "ethereumjs-tx": "^1.3.7", + "rxjs": "^6.4.0", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-core-subscriptions": "1.0.0-beta.55", + "web3-eth-abi": "1.0.0-beta.55", + "web3-eth-accounts": "1.0.0-beta.55", + "web3-eth-contract": "1.0.0-beta.55", + "web3-eth-ens": "1.0.0-beta.55", + "web3-eth-iban": "1.0.0-beta.55", + "web3-eth-personal": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-abi": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.36.tgz", - "integrity": "sha512-fBfW+7hvA0rxEMV45fO7JU+0R32ayT7aRwG9Cl6NW2/QvhFeME2qVbMIWw0q5MryPZGIN8A6366hKNuWvVidDg==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.55.tgz", + "integrity": "sha512-3h1xnm/vYmKUXTOYAOP0OsB5uijQV76pNNRGKOB6Dq6GR1pbcbD3WrB/4I643YA8l91t5FRzFzUiA3S77R2iqw==", "requires": { - "ethers": "4.0.0-beta.1", - "underscore": "1.8.3", - "web3-utils": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "ethers": "^4.0.27", + "lodash": "^4.17.11", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-accounts": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.36.tgz", - "integrity": "sha512-MmgIlBEZ0ILLWV4+wfMrbeVVMU/VmQnCpgSDcw7wHKOKu47bKncJ6rVqVsUbC6d9F613Rios+Yj2Ua6SCHtmrg==", - "requires": { - "any-promise": "1.3.0", - "crypto-browserify": "3.12.0", - "eth-lib": "0.2.7", - "scrypt.js": "0.2.0", - "underscore": "1.8.3", - "uuid": "2.0.1", - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.55.tgz", + "integrity": "sha512-VfzvwpSDHXqRVelIxsBVhgbV9BkFvhJ/q+bKhnVUUXV0JAhMK/7uC92TsqKk4EBYuqpHyZ1jjqrL4n03fMU7zw==", + "requires": { + "@babel/runtime": "^7.3.1", + "browserify-cipher": "^1.0.1", + "eth-lib": "0.2.8", + "lodash": "^4.17.11", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "scrypt.js": "0.3.0", + "uuid": "3.3.2", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" }, "dependencies": { - "eth-lib": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", - "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "scrypt.js": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz", + "integrity": "sha512-42LTc1nyFsyv/o0gcHtDztrn+aqpkaCNt5Qh7ATBZfhEZU7IC/0oT/qbBH+uRNoAPvs2fwiOId68FDEoSRA8/A==", "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" + "scrypt": "^6.0.2", + "scryptsy": "^1.2.1" } }, "uuid": { - "version": "2.0.1", - "resolved": "http://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" } } }, "web3-eth-contract": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.36.tgz", - "integrity": "sha512-cywqcIrUsCW4fyqsHdOb24OCC8AnBol8kNiptI+IHRylyCjTNgr53bUbjrXWjmEnear90rO0QhAVjLB1a4iEbQ==", - "requires": { - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-core-promievent": "1.0.0-beta.36", - "web3-core-subscriptions": "1.0.0-beta.36", - "web3-eth-abi": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.55.tgz", + "integrity": "sha512-v6oB1wfH039/A5sTb4ZTKX++fcBTHEkuQGpq50ATIDoxP/UTz2+6S+iL+3sCJTsByPw2/Bni/HM7NmLkXqzg/Q==", + "requires": { + "@babel/runtime": "^7.3.1", + "@types/bn.js": "^4.11.4", + "lodash": "^4.17.11", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-core-subscriptions": "1.0.0-beta.55", + "web3-eth-abi": "1.0.0-beta.55", + "web3-eth-accounts": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-ens": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.36.tgz", - "integrity": "sha512-8ZdD7XoJfSX3jNlZHSLe4G837xQ0v5a8cHCcDcd1IoqoY855X9SrIQ0Xdqia9p4mR1YcH1vgmkXY9/3hsvxS7g==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.0.0-beta.55.tgz", + "integrity": "sha512-jEL17coO0FJXb7KYq4+7DhVXj0Rh+wHfZ86jOvFUvJsRaUHfqK2TlMatuhD2mbrmxpBYb6oMPnXVnNK9bnD5Rg==", "requires": { + "@babel/runtime": "^7.3.1", "eth-ens-namehash": "2.0.8", - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-promievent": "1.0.0-beta.36", - "web3-eth-abi": "1.0.0-beta.36", - "web3-eth-contract": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "lodash": "^4.17.11", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-eth-abi": "1.0.0-beta.55", + "web3-eth-accounts": "1.0.0-beta.55", + "web3-eth-contract": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-iban": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.36.tgz", - "integrity": "sha512-b5AEDjjhOLR4q47Hbzf65zYE+7U7JgCgrUb13RU4HMIGoMb1q4DXaJw1UH8VVHCZulevl2QBjpCyrntecMqqCQ==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.55.tgz", + "integrity": "sha512-a2Fxsb5Mssa+jiXgjUdIzJipE0175IcQXJbZLpKft2+zeSJWNTbaa3PQD2vPPpIM4W789q06N+f9Zc0Fyls+1g==", "requires": { - "bn.js": "4.11.6", - "web3-utils": "1.0.0-beta.36" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" - } + "@babel/runtime": "^7.3.1", + "bn.js": "4.11.8", + "web3-utils": "1.0.0-beta.55" } }, "web3-eth-personal": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.36.tgz", - "integrity": "sha512-+oxvhojeWh4C/XtnlYURWRR3F5Cg7bQQNjtN1ZGnouKAZyBLoYDVVJ6OaPiveNtfC9RKnzLikn9/Uqc0xz410A==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.55.tgz", + "integrity": "sha512-H0mahLQx6Oj7lpgTamKAswr3rHChRUZijeWAar2Hj7BABQlLRKwx8n09nYhxggvvLYQNQS90JjvQue7rAo2LQQ==", "requires": { - "web3-core": "1.0.0-beta.36", - "web3-core-helpers": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-net": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-eth-accounts": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-net": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.36.tgz", - "integrity": "sha512-BriXK0Pjr6Hc/VDq1Vn8vyOum4JB//wpCjgeGziFD6jC7Of8YaWC7AJYXje89OckzfcqX1aJyJlBwDpasNkAzQ==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.55.tgz", + "integrity": "sha512-do2WY8+/GArJSWX7k/zZ7nBnV9Y3n6LhPYkwT3LeFqDzD515bKwlomaNC8hOaTc6UQyXIoPprYTK2FevL7jrZw==", "requires": { - "web3-core": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-utils": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "lodash": "^4.17.11", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-provider-engine": { @@ -4715,64 +3741,81 @@ } } }, - "web3-providers-http": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.0.0-beta.36.tgz", - "integrity": "sha512-KLSqMS59nRdpet9B0B64MKgtM3n9wAHTcAHJ03hv79avQNTjHxtjZm0ttcjcFUPpWDgTCtcYCa7tqaYo9Pbeog==", - "requires": { - "web3-core-helpers": "1.0.0-beta.36", + "web3-providers": { + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-providers/-/web3-providers-1.0.0-beta.55.tgz", + "integrity": "sha512-MNifc7W+iF6rykpbDR1MuX152jshWdZXHAU9Dk0Ja2/23elhIs4nCWs7wOX9FHrKgdrQbscPoq0uy+0aGzyWVQ==", + "requires": { + "@babel/runtime": "^7.3.1", + "@types/node": "^10.12.18", + "eventemitter3": "3.1.0", + "lodash": "^4.17.11", + "url-parse": "1.4.4", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55", + "websocket": "^1.0.28", "xhr2-cookies": "1.1.0" - } - }, - "web3-providers-ipc": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.36.tgz", - "integrity": "sha512-iEUrmdd2CzoWgp+75/ydom/1IaoLw95qkAzsgwjjZp1waDncHP/cvVGX74+fbUx4hRaPdchyzxCQfNpgLDmNjQ==", - "requires": { - "oboe": "2.1.3", - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36" - } - }, - "web3-providers-ws": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.36.tgz", - "integrity": "sha512-wAnENuZx75T5ZSrT2De2LOaUuPf2yRjq1VfcbD7+Zd79F3DZZLBJcPyCNVQ1U0fAXt0wfgCKl7sVw5pffqR9Bw==", - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.36", - "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2" + }, + "dependencies": { + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + }, + "websocket": { + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.28.tgz", + "integrity": "sha512-00y/20/80P7H4bCYkzuuvvfDvh+dgtXi5kzDf3UcZwN6boTYaKvsrtZ5lIYm1Gsg48siMErd9M4zjSYfYFHTrA==", + "requires": { + "debug": "^2.2.0", + "nan": "^2.11.0", + "typedarray-to-buffer": "^3.1.5", + "yaeti": "^0.0.6" + } + } } }, "web3-shh": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.36.tgz", - "integrity": "sha512-bREGHS/WprYFSvGUhyIk8RSpT2Z5SvJOKGBrsUW2nDIMWO6z0Op8E7fzC6GXY2HZfZliAqq6LirbXLgcLRWuPw==", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.55.tgz", + "integrity": "sha512-lGP2HQ/1ThNnfoU8677aL48KsTx4Ht+2KQIn39dGpxVZqysQmovQIltbymVnAr4h8wofwcEz46iNHGa+PAyNzA==", "requires": { - "web3-core": "1.0.0-beta.36", - "web3-core-method": "1.0.0-beta.36", - "web3-core-subscriptions": "1.0.0-beta.36", - "web3-net": "1.0.0-beta.36" + "@babel/runtime": "^7.3.1", + "web3-core": "1.0.0-beta.55", + "web3-core-helpers": "1.0.0-beta.55", + "web3-core-method": "1.0.0-beta.55", + "web3-core-subscriptions": "1.0.0-beta.55", + "web3-net": "1.0.0-beta.55", + "web3-providers": "1.0.0-beta.55", + "web3-utils": "1.0.0-beta.55" } }, "web3-utils": { - "version": "1.0.0-beta.36", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.36.tgz", - "integrity": "sha512-7ri74lG5fS2Th0fhYvTtiEHMB1Pmf2p7dQx1COQ3OHNI/CHNEMjzoNMEbBU6FAENrywfoFur40K4m0AOmEUq5A==", - "requires": { - "bn.js": "4.11.6", - "eth-lib": "0.1.27", - "ethjs-unit": "0.1.6", + "version": "1.0.0-beta.55", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.55.tgz", + "integrity": "sha512-ASWqUi8gtWK02Tp8ZtcoAbHenMpQXNvHrakgzvqTNNZn26wgpv+Q4mdPi0KOR6ZgHFL8R/9b5BBoUTglS1WPpg==", + "requires": { + "@babel/runtime": "^7.3.1", + "@types/bn.js": "^4.11.4", + "@types/node": "^10.12.18", + "bn.js": "4.11.8", + "eth-lib": "0.2.8", + "ethjs-unit": "^0.1.6", + "lodash": "^4.17.11", "number-to-bn": "1.7.0", - "randomhex": "0.1.5", - "underscore": "1.8.3", + "randombytes": "^2.1.0", "utf8": "2.1.1" }, "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } }, "utf8": { "version": "2.1.1", @@ -4782,13 +3825,21 @@ } }, "websocket": { - "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", - "from": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible", + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.28.tgz", + "integrity": "sha512-00y/20/80P7H4bCYkzuuvvfDvh+dgtXi5kzDf3UcZwN6boTYaKvsrtZ5lIYm1Gsg48siMErd9M4zjSYfYFHTrA==", "requires": { "debug": "^2.2.0", - "nan": "^2.3.3", - "typedarray-to-buffer": "^3.1.2", + "nan": "^2.11.0", + "typedarray-to-buffer": "^3.1.5", "yaeti": "^0.0.6" + }, + "dependencies": { + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + } } }, "whatwg-fetch": { @@ -4820,16 +3871,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - } - }, "xhr": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", @@ -4866,7 +3907,8 @@ "xhr2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.4.tgz", - "integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=" + "integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=", + "dev": true }, "xhr2-cookies": { "version": "1.1.0", @@ -4925,15 +3967,6 @@ "camelcase": "^3.0.0", "lodash.assign": "^4.0.6" } - }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } } } } diff --git a/package.json b/package.json index 94f1417..e6eaffb 100755 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "dependencies": { "openzeppelin-solidity": "^1.12.0", - "truffle-hdwallet-provider": "0.0.6", + "truffle-hdwallet-provider": "^1.0.6", "truffle-privatekey-provider": "^0.1.0" }, "devDependencies": { "abi-decoder": "^1.2.0", "bignumber.js": "^7.2.1", "js-sha256": "^0.9.0", - "web3": "^1.0.0-beta.35" + "web3": "^1.0.0-beta.55" } } diff --git a/truffle-config.js b/truffle-config.js deleted file mode 100755 index 0855df1..0000000 --- a/truffle-config.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * NB: since truffle-hdwallet-provider 0.0.5 you must wrap HDWallet providers in a - * function when declaring them. Failure to do so will cause commands to hang. ex: - * ``` - * mainnet: { - * provider: function() { - * return new HDWalletProvider(mnemonic, 'https://mainnet.infura.io/') - * }, - * network_id: '1', - * gas: 4500000, - * gasPrice: 10000000000, - * }, - */ - -module.exports = { - // See - // to customize your Truffle configuration! -}; diff --git a/truffle.js b/truffle.js index bf3e153..318d69b 100755 --- a/truffle.js +++ b/truffle.js @@ -45,6 +45,11 @@ module.exports = { enabled: true, runs: 200 } + }, + compilers: { + solc: { + version: "0.4.25", + }, } // See // to customize your Truffle configuration! From 89af3a0f72a2fc0aa1bec49e289a1ea0b763234b Mon Sep 17 00:00:00 2001 From: Ivan Poon Date: Mon, 10 Jun 2019 16:45:16 +0800 Subject: [PATCH 03/12] Fix tests --- test/TestAirDropper/sendEther.js | 2 +- test/TestAtomicBroker/cancelSwap.js | 8 +- test/TestAtomicBroker/createSwap.js | 14 ++-- test/TestAtomicBroker/executeSwap.js | 4 +- test/TestBroker/announceCancel.js | 8 +- test/TestBroker/cancel.js | 36 ++++----- test/TestBroker/depositERC20.js | 8 +- test/TestBroker/depositEther.js | 4 +- test/TestBroker/emergencyCancel.js | 6 +- test/TestBroker/emergencyWithdraw.js | 4 +- test/TestBroker/fastCancel.js | 6 +- test/TestBroker/fillOffer.js | 54 ++++++------- test/TestBroker/makeOffer.js | 45 +++++------ test/TestBroker/slowCancel.js | 6 +- test/TestBroker/slowWithdraw.js | 4 +- test/TestBroker/spendFrom.js | 6 +- test/TestBroker/withdraw.js | 24 +++--- utils/testUtils.js | 114 +++++++++++++++------------ 18 files changed, 183 insertions(+), 170 deletions(-) diff --git a/test/TestAirDropper/sendEther.js b/test/TestAirDropper/sendEther.js index 35f52d6..d60f9f3 100644 --- a/test/TestAirDropper/sendEther.js +++ b/test/TestAirDropper/sendEther.js @@ -21,7 +21,7 @@ contract('Test createSwap', async (accounts) => { contract('test event emission', async () => { it('emits a SendEther event', async () => { const result = await airDropper.sendEther(id, receiver, 1000) - assertEventEmission(result.receipt.logs, [ + assertEventEmission(result.receipt.rawLogs, [ { eventType: 'SendEther', args: { diff --git a/test/TestAtomicBroker/cancelSwap.js b/test/TestAtomicBroker/cancelSwap.js index aa8389a..be5bbfd 100644 --- a/test/TestAtomicBroker/cancelSwap.js +++ b/test/TestAtomicBroker/cancelSwap.js @@ -3,7 +3,7 @@ const JRCoin = artifacts.require('JRCoin') const SWCoin = artifacts.require('SWCoin') const AtomicBroker = artifacts.require('AtomicBroker') -const { fundUser, createSwap, cancelSwap, executeSwap, assertSwapExists, getSampleSwapParams, +const { fundUser, createSwap, cancelSwap, cancelSwapFrom, executeSwap, assertSwapExists, getSampleSwapParams, assertError, assertEventEmission, assertBalances, REASON, increaseEvmTime, assertSwapDoesNotExist } = require('../../utils/testUtils') @@ -39,7 +39,7 @@ contract('Test cancelSwap', async (accounts) => { await increaseEvmTime(700) const result = await cancelSwap(atomicBroker, { ...swapParams, cancelFeeAmount: 2 }) - assertEventEmission(result.receipt.logs, [ + assertEventEmission(result.receipt.rawLogs, [ { eventType: 'BalanceDecrease', args: { @@ -115,7 +115,7 @@ contract('Test cancelSwap', async (accounts) => { [operator]: { jrc: 0, swc: 0 }, [atomicBroker.address]: { jrc: 999, swc: 0 } }) - await cancelSwap(atomicBroker, { ...swapParams, cancelFeeAmount: 2 }, { from: bob }) + await cancelSwapFrom(atomicBroker, { ...swapParams, cancelFeeAmount: 2 }, bob) await assertBalances(broker, { [maker]: { jrc: 990, swc: 0 }, [taker]: { jrc: 0, swc: 0 }, @@ -204,7 +204,7 @@ contract('Test cancelSwap', async (accounts) => { await increaseEvmTime(700) const result = await cancelSwap(atomicBroker, { ...swapParams, cancelFeeAmount: 5 }) - assertEventEmission(result.receipt.logs, [ + assertEventEmission(result.receipt.rawLogs, [ { eventType: 'BalanceDecrease', args: { diff --git a/test/TestAtomicBroker/createSwap.js b/test/TestAtomicBroker/createSwap.js index 9faa893..296ddce 100644 --- a/test/TestAtomicBroker/createSwap.js +++ b/test/TestAtomicBroker/createSwap.js @@ -3,9 +3,9 @@ const JRCoin = artifacts.require('JRCoin') const SWCoin = artifacts.require('SWCoin') const AtomicBroker = artifacts.require('AtomicBroker') -const { fundUser, createSwap, assertSwapExists, getSampleSwapParams, - assertError, assertSwapDoesNotExist, assertTokenBalance, - assertEventEmission, REASON } = require('../../utils/testUtils') +const { fundUser, createSwap, assertSwapExists, getSampleSwapParams, hashSecret, + assertError, assertSwapDoesNotExist, assertTokenBalance, assertEventEmission, + REASON } = require('../../utils/testUtils') contract('Test createSwap', async (accounts) => { let broker, atomicBroker, token, secondToken @@ -27,7 +27,7 @@ contract('Test createSwap', async (accounts) => { it('emits BalanceDecrease, BalanceIncrease, CreateSwap events', async () => { const swapParams = await getSampleSwapParams({ maker, taker, token }) const result = await createSwap(atomicBroker, swapParams) - assertEventEmission(result.receipt.logs, [ + assertEventEmission(result.receipt.rawLogs, [ { eventType: 'BalanceDecrease', args: { @@ -69,7 +69,7 @@ contract('Test createSwap', async (accounts) => { swapParams.feeAsset = secondToken.address swapParams.feeAmount = 9 const result = await createSwap(atomicBroker, swapParams) - assertEventEmission(result.receipt.logs, [ + assertEventEmission(result.receipt.rawLogs, [ { eventType: 'BalanceDecrease', args: { @@ -191,7 +191,7 @@ contract('Test createSwap', async (accounts) => { await assertError(createSwap, atomicBroker, swapParams) // should succeed because a new hashedSecret is used - swapParams.hashedSecret = '0x456' + swapParams.hashedSecret = hashSecret('newsecret') await createSwap(atomicBroker, swapParams) await assertSwapExists(atomicBroker, swapParams) }) @@ -201,7 +201,7 @@ contract('Test createSwap', async (accounts) => { it('throws an error', async () => { const swapParams = await getSampleSwapParams({ maker, taker, token }) // use the coordinator as the signee - await assertError(createSwap, atomicBroker, swapParams, undefined, coordinator) + await assertError(createSwap, atomicBroker, swapParams, coordinator) await assertSwapDoesNotExist(atomicBroker, swapParams) }) }) diff --git a/test/TestAtomicBroker/executeSwap.js b/test/TestAtomicBroker/executeSwap.js index 7b43192..89e054f 100644 --- a/test/TestAtomicBroker/executeSwap.js +++ b/test/TestAtomicBroker/executeSwap.js @@ -35,7 +35,7 @@ contract('Test executeSwap', async (accounts) => { contract('test event emission', async () => { it('emits BalanceDecrease, BalanceIncrease, BalanceDecrease, BalanceIncrease, ExecuteSwap events', async () => { const result = await executeSwap(atomicBroker, swapParams) - assertEventEmission(result.receipt.logs, [ + assertEventEmission(result.receipt.rawLogs, [ { eventType: 'BalanceDecrease', args: { @@ -144,7 +144,7 @@ contract('Test executeSwap', async (accounts) => { contract('test event emission', async () => { it('emits BalanceDecrease, BalanceIncrease, BalanceDecrease, BalanceIncrease, ExecuteSwap events', async () => { const result = await executeSwap(atomicBroker, swapParams) - assertEventEmission(result.receipt.logs, [ + assertEventEmission(result.receipt.rawLogs, [ { eventType: 'BalanceDecrease', args: { diff --git a/test/TestBroker/announceCancel.js b/test/TestBroker/announceCancel.js index ebb8679..aa0627e 100755 --- a/test/TestBroker/announceCancel.js +++ b/test/TestBroker/announceCancel.js @@ -21,7 +21,7 @@ contract('Test announceCancel', async () => { await broker.depositEther.sendTransaction({ from: user, value: web3.utils.toWei('1', 'ether') }) initialEtherBalance = await broker.balances.call(user, ETHER_ADDR) - assert.equal(initialEtherBalance, '1000000000000000000') + assert.equal(initialEtherBalance.toString(), '1000000000000000000') sampleOffer = await getSampleOfferParams(nextNonce, user, initialEtherBalance) sampleOffer.offerAmount = 10 @@ -36,11 +36,11 @@ contract('Test announceCancel', async () => { contract('test event emission', async () => { it('emits CancelAnnounce event', async () => { - const { logs } = await broker.announceCancel(sampleOfferHash, { from: user }) + const { receipt: { rawLogs: logs } } = await broker.announceCancel(sampleOfferHash, { from: user }) assertEventEmission(logs, [{ eventType: 'CancelAnnounce', args: { - user: user.toLowerCase(), + user: user, offerHash: sampleOfferHash } }]) @@ -67,7 +67,7 @@ contract('Test announceCancel', async () => { contract('when the offer no longer exists', async () => { it('throws an error', async () => { const { v, r, s } = await signCancel({ offerParams: sampleOffer, feeAsset: ETHER_ADDR, feeAmount: 0 }) - await broker.cancel.sendTransaction(sampleOfferHash, sampleOffer.offerAmount, '0x0', 0, v, r, s, { from: coordinator }) + await broker.cancel.sendTransaction(sampleOfferHash, sampleOffer.offerAmount, ETHER_ADDR, 0, v, r, s, { from: coordinator }) await assertError(broker.announceCancel.sendTransaction, sampleOfferHash, { from: coordinator }) const canCancelAt = await broker.announcedCancellations.call(sampleOfferHash) assert.equal(canCancelAt.toString(), '0') diff --git a/test/TestBroker/cancel.js b/test/TestBroker/cancel.js index 6e0de7e..65fe758 100755 --- a/test/TestBroker/cancel.js +++ b/test/TestBroker/cancel.js @@ -37,11 +37,11 @@ contract('Test cancel', async () => { await makeOffer(broker, params) const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 0 }) - const { logs } = await broker.cancel(offerHash, params.offerAmount, ETHER_ADDR, 0, v, r, s, { from: coordinator }) + const { receipt: { rawLogs: logs } } = await broker.cancel(offerHash, params.offerAmount, ETHER_ADDR, 0, v, r, s, { from: coordinator }) assertEventEmission(logs, [{ eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '999999999999999999', reason: REASON.ReasonCancel @@ -49,7 +49,7 @@ contract('Test cancel', async () => { }, { eventType: 'Cancel', args: { - maker: user.toLowerCase(), + maker: user, offerHash } }]) @@ -62,12 +62,12 @@ contract('Test cancel', async () => { await makeOffer(broker, params) const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 2 }) - const { logs } = await broker.cancel(offerHash, params.offerAmount, ETHER_ADDR, 2, v, r, s, { from: coordinator }) + const { receipt: { rawLogs: logs } } = await broker.cancel(offerHash, params.offerAmount, ETHER_ADDR, 2, v, r, s, { from: coordinator }) const expectedEvents = [ { eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '999999999999999997', reason: REASON.ReasonCancel @@ -76,7 +76,7 @@ contract('Test cancel', async () => { { eventType: 'BalanceIncrease', args: { - user: operator.toLowerCase(), + user: operator, token: ETHER_ADDR, amount: '2', reason: REASON.ReasonCancelFeeReceive @@ -85,7 +85,7 @@ contract('Test cancel', async () => { { eventType: 'Cancel', args: { - maker: user.toLowerCase(), + maker: user, offerHash } } @@ -100,12 +100,12 @@ contract('Test cancel', async () => { await makeOffer(broker, params) const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: token.address, feeAmount: 7 }) - const { logs } = await broker.cancel(offerHash, params.offerAmount, token.address, 7, v, r, s, { from: coordinator }) + const { receipt: { rawLogs: logs } } = await broker.cancel(offerHash, params.offerAmount, token.address, 7, v, r, s, { from: coordinator }) const expectedEvents = [ { eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '999999999999999999', reason: REASON.ReasonCancel @@ -114,7 +114,7 @@ contract('Test cancel', async () => { { eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: token.address, amount: '7', reason: REASON.ReasonCancelFeeGive @@ -123,7 +123,7 @@ contract('Test cancel', async () => { { eventType: 'BalanceIncrease', args: { - user: operator.toLowerCase(), + user: operator, token: token.address, amount: '7', reason: REASON.ReasonCancelFeeReceive @@ -132,7 +132,7 @@ contract('Test cancel', async () => { { eventType: 'Cancel', args: { - maker: user.toLowerCase(), + maker: user, offerHash } } @@ -234,7 +234,7 @@ contract('Test cancel', async () => { const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 0 }) - await broker.cancel.sendTransaction(offerHash, params.offerAmount, '0x0', 0, v, r, s, { from: coordinator }) + await broker.cancel.sendTransaction(offerHash, params.offerAmount, ETHER_ADDR, 0, v, r, s, { from: coordinator }) await assertOfferParams(broker, emptyOfferParams, offerHash) await assertEtherBalance(broker, user, '1000000000000000000') @@ -283,7 +283,7 @@ contract('Test cancel', async () => { assert.equal(o1.availableAmount.toString(), '7') const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 0 }) - await broker.cancel.sendTransaction(offerHash, '7', '0x0', 0, v, r, s, { from: coordinator }) + await broker.cancel.sendTransaction(offerHash, '7', ETHER_ADDR, 0, v, r, s, { from: coordinator }) await assertEtherBalance(broker, user, '999999999999999997') await assertTokenBalance(broker, user, token.address, '56') @@ -308,7 +308,7 @@ contract('Test cancel', async () => { const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 0 }) - await assertError(broker.cancel.sendTransaction, offerHash, '3', '0x0', 0, v, r, s, { from: coordinator }) + await assertError(broker.cancel.sendTransaction, offerHash, '3', ETHER_ADDR, 0, v, r, s, { from: coordinator }) await assertOfferParams(broker, params) await assertEtherBalance(broker, user, '1') }) @@ -323,7 +323,7 @@ contract('Test cancel', async () => { const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 0 }, coordinator) - await assertError(broker.cancel.sendTransaction, offerHash, params.offerAmount, '0x0', 0, v, r, s, { from: coordinator }) + await assertError(broker.cancel.sendTransaction, offerHash, params.offerAmount, ETHER_ADDR, 0, v, r, s, { from: coordinator }) await assertOfferParams(broker, params) await assertEtherBalance(broker, user, '1') }) @@ -338,7 +338,7 @@ contract('Test cancel', async () => { const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 0 }) - await assertError(broker.cancel.sendTransaction, offerHash, params.offerAmount, '0x0', 0, v, r, s, { from: user }) + await assertError(broker.cancel.sendTransaction, offerHash, params.offerAmount, ETHER_ADDR, 0, v, r, s, { from: user }) await assertOfferParams(broker, params) await assertEtherBalance(broker, user, '1') }) @@ -349,7 +349,7 @@ contract('Test cancel', async () => { const params = await getSampleOfferParams(nextNonce, user, initialEtherBalance) const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 0 }, coordinator) - await assertError(broker.cancel.sendTransaction, offerHash, '0', '0x0', 0, v, r, s) + await assertError(broker.cancel.sendTransaction, offerHash, '0', ETHER_ADDR, 0, v, r, s) }) }) }) diff --git a/test/TestBroker/depositERC20.js b/test/TestBroker/depositERC20.js index db3dec5..e5508c8 100755 --- a/test/TestBroker/depositERC20.js +++ b/test/TestBroker/depositERC20.js @@ -26,12 +26,12 @@ contract('Test depositERC20', async () => { contract('test event emission', async () => { it('emits BalanceIncrease event', async () => { - await token.approve.sendTransaction(broker.address, 42, { from: user }) - const { logs } = await broker.depositERC20(user, token.address, 20, { from: coordinator }) - assertEventEmission(logs, [{ + await token.approve.sendTransaction(broker.address, 42, { from: user }) + const receipt = await broker.depositERC20(user, token.address, 20, { from: coordinator }) + assertEventEmission(receipt.logs, [{ eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: token.address, amount: '20', reason: REASON.ReasonDeposit diff --git a/test/TestBroker/depositEther.js b/test/TestBroker/depositEther.js index e4ae224..5a8db6a 100755 --- a/test/TestBroker/depositEther.js +++ b/test/TestBroker/depositEther.js @@ -15,11 +15,11 @@ contract('Test depositEther', async () => { contract('test event emission', async () => { it('emits BalanceIncrease event', async () => { const amount = web3.utils.toWei('1', 'ether') - const { logs } = await broker.depositEther({ from: user, value: amount }) + const { receipt: { rawLogs: logs } } = await broker.depositEther({ from: user, value: amount }) assertEventEmission(logs, [{ eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '1000000000000000000', reason: REASON.ReasonDeposit diff --git a/test/TestBroker/emergencyCancel.js b/test/TestBroker/emergencyCancel.js index dce22ce..9aa2b01 100755 --- a/test/TestBroker/emergencyCancel.js +++ b/test/TestBroker/emergencyCancel.js @@ -32,11 +32,11 @@ contract('Test emergencyCancel', async () => { await broker.setState.sendTransaction(1) const offerHash = getOfferHash(params) - const { logs } = await broker.emergencyCancel(offerHash, params.offerAmount, { from: coordinator }) + const { receipt: { rawLogs: logs } } = await broker.emergencyCancel(offerHash, params.offerAmount, { from: coordinator }) assertEventEmission(logs, [{ eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '999999999999999999', reason: REASON.ReasonCancel @@ -44,7 +44,7 @@ contract('Test emergencyCancel', async () => { }, { eventType: 'Cancel', args: { - maker: user.toLowerCase(), + maker: user, offerHash } }]) diff --git a/test/TestBroker/emergencyWithdraw.js b/test/TestBroker/emergencyWithdraw.js index daa3227..944b734 100755 --- a/test/TestBroker/emergencyWithdraw.js +++ b/test/TestBroker/emergencyWithdraw.js @@ -25,11 +25,11 @@ contract('Test emergencyWithdraw', async () => { contract('test event emission', async () => { it('emits BalanceDecrease event', async () => { await broker.setState.sendTransaction(1) - const { logs } = await broker.emergencyWithdraw(user, ETHER_ADDR, initialEtherBalance) + const { receipt: { rawLogs: logs } } = await broker.emergencyWithdraw(user, ETHER_ADDR, initialEtherBalance) assertEventEmission(logs, [{ eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '1000000000000000000', reason: REASON.ReasonWithdraw diff --git a/test/TestBroker/fastCancel.js b/test/TestBroker/fastCancel.js index a5b8afc..f2e390b 100755 --- a/test/TestBroker/fastCancel.js +++ b/test/TestBroker/fastCancel.js @@ -38,11 +38,11 @@ contract('Test fastCancel', async () => { contract('test event emission', async () => { it('emits BalanceIncrease and Cancel events', async () => { await broker.announceCancel.sendTransaction(sampleOfferHash, { from: user }) - const { logs } = await broker.fastCancel(sampleOfferHash, sampleOffer.offerAmount) + const { receipt: { rawLogs: logs } } = await broker.fastCancel(sampleOfferHash, sampleOffer.offerAmount) assertEventEmission(logs, [{ eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '10', reason: REASON.ReasonCancel @@ -50,7 +50,7 @@ contract('Test fastCancel', async () => { }, { eventType: 'Cancel', args: { - maker: user.toLowerCase(), + maker: user, offerHash: sampleOfferHash } }]) diff --git a/test/TestBroker/fillOffer.js b/test/TestBroker/fillOffer.js index 821508b..a75d5bc 100755 --- a/test/TestBroker/fillOffer.js +++ b/test/TestBroker/fillOffer.js @@ -5,9 +5,9 @@ const Web3 = require('web3') const web3 = new Web3(Web3.givenProvider) const { BigNumber } = require('bignumber.js') -const { ETHER_ADDR, REASON, nonceGenerator, getSampleOfferParams, emptyOfferParams, getValidFillParams, +const { ETHER_ADDR, REASON, nonceGenerator, getSampleOfferParams, emptyOfferParams, assertError, assertOfferParams, assertEtherBalance, assertTokenBalance, assertEventEmission, - fetchOffer, makeOffer, getOfferHash, fillOffer, signFillOffer, withdraw } = require('../../utils/testUtils') + fetchOffer, makeOffer, getOfferHash, fillOffer, fillOfferFrom, signFillOffer, withdraw } = require('../../utils/testUtils') contract('Test fillOffer', async () => { let broker, token, filler, user, accounts, coordinator, operator, sampleOffer, sampleOfferHash @@ -212,7 +212,7 @@ contract('Test fillOffer', async () => { // amountToTakeAfterFees: 3 ETH - 1 ETH = 2 ETH const signature = await signFillOffer(fillParams) const { v, r, s } = signature - const { logs } = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, + const { receipt: { rawLogs: logs } } = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, fillParams.feeAsset, fillParams.feeAmount, fillParams.nonce, v, r, s) const offer = await fetchOffer(broker, fillParams.offerHash) @@ -225,7 +225,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceDecrease', args: { - user: filler.toLowerCase(), + user: filler, token: token.address, amount: '6', reason: REASON.ReasonFillerGive @@ -234,7 +234,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: token.address, amount: '6', reason: REASON.ReasonMakerReceive @@ -243,7 +243,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: filler.toLowerCase(), + user: filler, token: ETHER_ADDR, amount: '2', reason: REASON.ReasonFillerReceive @@ -252,7 +252,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: operator.toLowerCase(), + user: operator, token: ETHER_ADDR, amount: '1', reason: REASON.ReasonFillerFeeReceive @@ -261,11 +261,11 @@ contract('Test fillOffer', async () => { { eventType: 'Fill', args: { - filler: filler.toLowerCase(), + filler: filler, offerHash: sampleOfferHash, amountFilled: '6', amountTaken: '3', - maker: user.toLowerCase() + maker: user } } ] @@ -292,7 +292,7 @@ contract('Test fillOffer', async () => { // amountToTakeAfterFees: 3 ETH const signature = await signFillOffer(fillParams) const { v, r, s } = signature - const { logs } = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, + const { receipt: { rawLogs: logs } } = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, fillParams.feeAsset, fillParams.feeAmount, fillParams.nonce, v, r, s) const offer = await fetchOffer(broker, fillParams.offerHash) @@ -305,7 +305,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceDecrease', args: { - user: filler.toLowerCase(), + user: filler, token: token.address, amount: '6', reason: REASON.ReasonFillerGive @@ -314,7 +314,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: token.address, amount: '6', reason: REASON.ReasonMakerReceive @@ -323,7 +323,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: filler.toLowerCase(), + user: filler, token: ETHER_ADDR, amount: '3', reason: REASON.ReasonFillerReceive @@ -332,7 +332,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceDecrease', args: { - user: filler.toLowerCase(), + user: filler, token: token.address, amount: '18', reason: REASON.ReasonFillerFeeGive @@ -341,7 +341,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: operator.toLowerCase(), + user: operator, token: token.address, amount: '18', reason: REASON.ReasonFillerFeeReceive @@ -350,11 +350,11 @@ contract('Test fillOffer', async () => { { eventType: 'Fill', args: { - filler: filler.toLowerCase(), + filler: filler, offerHash: sampleOfferHash, amountFilled: '6', amountTaken: '3', - maker: user.toLowerCase() + maker: user } } ] @@ -380,7 +380,7 @@ contract('Test fillOffer', async () => { // amountToTakeAfterFees: 3 ETH const signature = await signFillOffer(fillParams) const { v, r, s } = signature - const { logs } = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, + const { receipt: { rawLogs: logs } } = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, fillParams.feeAsset, fillParams.feeAmount, fillParams.nonce, v, r, s) const offer = await fetchOffer(broker, fillParams.offerHash) @@ -393,7 +393,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceDecrease', args: { - user: filler.toLowerCase(), + user: filler, token: token.address, amount: '6', reason: REASON.ReasonFillerGive @@ -402,7 +402,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: token.address, amount: '6', reason: REASON.ReasonMakerReceive @@ -411,7 +411,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: filler.toLowerCase(), + user: filler, token: ETHER_ADDR, amount: '3', reason: REASON.ReasonFillerReceive @@ -420,7 +420,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceDecrease', args: { - user: filler.toLowerCase(), + user: filler, token: swToken.address, amount: '27', reason: REASON.ReasonFillerFeeGive @@ -429,7 +429,7 @@ contract('Test fillOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: operator.toLowerCase(), + user: operator, token: swToken.address, amount: '27', reason: REASON.ReasonFillerFeeReceive @@ -438,11 +438,11 @@ contract('Test fillOffer', async () => { { eventType: 'Fill', args: { - filler: filler.toLowerCase(), + filler: filler, offerHash: sampleOfferHash, amountFilled: '6', amountTaken: '3', - maker: user.toLowerCase() + maker: user } } ] @@ -778,7 +778,7 @@ contract('Test fillOffer', async () => { contract('when the sender is not the coordinator', async () => { it('throws an error', async () => { const fillParams = getValidFillParams() - await assertError(fillOffer, broker, fillParams, { from: user }) + await assertError(fillOfferFrom, broker, fillParams, user) await assertInitialBalanceDistribution() await assertNoAssetsWereLost() }) @@ -788,7 +788,7 @@ contract('Test fillOffer', async () => { it('throws an error', async () => { const fillParams = getValidFillParams() const signature = await signFillOffer(fillParams, coordinator) - await assertError(fillOffer, broker, fillParams, { from: coordinator }, signature) + await assertError(fillOffer, broker, fillParams, signature) await assertInitialBalanceDistribution() await assertNoAssetsWereLost() }) diff --git a/test/TestBroker/makeOffer.js b/test/TestBroker/makeOffer.js index 3c2fd50..5c7dc6d 100755 --- a/test/TestBroker/makeOffer.js +++ b/test/TestBroker/makeOffer.js @@ -2,10 +2,11 @@ const Broker = artifacts.require('Broker') const JRCoin = artifacts.require('JRCoin') const Web3 = require('web3') const web3 = new Web3(Web3.givenProvider) +const { BigNumber } = require('bignumber.js') const { ETHER_ADDR, REASON, nonceGenerator, getSampleOfferParams, assertError, assertOfferParams, assertTokenBalance, assertEtherBalance, assertEventEmission, - assertOfferDoesNotExist, makeOffer, signMakeOffer, signCancel, getOfferHash } = require('../../utils/testUtils') + assertOfferDoesNotExist, makeOffer, signMakeOffer, makeOfferFrom, signCancel, getOfferHash } = require('../../utils/testUtils') contract('Test makeOffer', async () => { let broker, token, user, initialEtherBalance, accounts, coordinator @@ -35,12 +36,12 @@ contract('Test makeOffer', async () => { const offerHash = getOfferHash(params) const signature = await signMakeOffer(params) const { v, r, s } = signature - const { logs } = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, + const { receipt: { rawLogs: logs } } = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, params.offerAmount, params.wantAmount, params.feeAsset, params.feeAmount, params.nonce, v, r, s) assertEventEmission(logs, [{ eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '999999999999999999', reason: REASON.ReasonMakerGive @@ -48,7 +49,7 @@ contract('Test makeOffer', async () => { }, { eventType: 'Make', args: { - maker: user.toLowerCase(), + maker: user, offerHash: offerHash } }]) @@ -65,13 +66,13 @@ contract('Test makeOffer', async () => { const offerHash = getOfferHash(params) const signature = await signMakeOffer(params) const { v, r, s } = signature - const { logs } = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, + const { receipt: { rawLogs: logs } } = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, params.offerAmount, params.wantAmount, params.feeAsset, params.feeAmount, params.nonce, v, r, s) const expectedEvents = [ { eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '120', reason: REASON.ReasonMakerGive @@ -80,7 +81,7 @@ contract('Test makeOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: operator.toLowerCase(), + user: operator, token: ETHER_ADDR, amount: '20', reason: REASON.ReasonMakerFeeReceive @@ -89,7 +90,7 @@ contract('Test makeOffer', async () => { { eventType: 'Make', args: { - maker: user.toLowerCase(), + maker: user, offerHash: offerHash } } @@ -108,13 +109,13 @@ contract('Test makeOffer', async () => { const offerHash = getOfferHash(params) const signature = await signMakeOffer(params) const { v, r, s } = signature - const { logs } = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, + const { receipt: { rawLogs: logs } } = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, params.offerAmount, params.wantAmount, params.feeAsset, params.feeAmount, params.nonce, v, r, s) const expectedEvents = [ { eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '100', reason: REASON.ReasonMakerGive @@ -123,7 +124,7 @@ contract('Test makeOffer', async () => { { eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: token.address, amount: '7', reason: REASON.ReasonMakerFeeGive @@ -132,7 +133,7 @@ contract('Test makeOffer', async () => { { eventType: 'BalanceIncrease', args: { - user: operator.toLowerCase(), + user: operator, token: token.address, amount: '7', reason: REASON.ReasonMakerFeeReceive @@ -141,7 +142,7 @@ contract('Test makeOffer', async () => { { eventType: 'Make', args: { - maker: user.toLowerCase(), + maker: user, offerHash: offerHash } } @@ -162,7 +163,7 @@ contract('Test makeOffer', async () => { params.feeAsset = ETHER_ADDR params.feeAmount = 3 - await makeOffer(broker, params, { from: coordinator }) + await makeOffer(broker, params) await assertOfferParams(broker, params) await assertEtherBalance(broker, user, '999999999999999990') @@ -176,7 +177,7 @@ contract('Test makeOffer', async () => { params.feeAsset = ETHER_ADDR params.feeAmount = 3 - await assertError(makeOffer, broker, params, { from: user }) + await assertError(makeOffer, broker, params) await assertOfferDoesNotExist(broker, params) await assertEtherBalance(broker, user, initialEtherBalance) @@ -193,7 +194,7 @@ contract('Test makeOffer', async () => { params.feeAsset = token.address params.feeAmount = 21 - await makeOffer(broker, params, { from: coordinator }) + await makeOffer(broker, params) await assertOfferParams(broker, params) await assertEtherBalance(broker, user, '1') @@ -209,7 +210,7 @@ contract('Test makeOffer', async () => { params.feeAsset = token.address params.feeAmount = 101 - await assertError(makeOffer, broker, params, { from: user }) + await assertError(makeOffer, broker, params) await assertOfferDoesNotExist(broker, params) await assertEtherBalance(broker, user, initialEtherBalance) @@ -221,7 +222,7 @@ contract('Test makeOffer', async () => { contract('when valid values are used', async () => { it('does not throw an error', async () => { const params = await getSampleOfferParams(nextNonce, user, initialEtherBalance) - await makeOffer(broker, params, { from: coordinator }) + await makeOffer(broker, params) await assertOfferParams(broker, params) await assertEtherBalance(broker, user, '1') }) @@ -230,7 +231,7 @@ contract('Test makeOffer', async () => { contract('when the sender is not the coordinator', async () => { it('throws an error', async () => { const params = await getSampleOfferParams(nextNonce, user, initialEtherBalance) - await assertError(makeOffer, broker, params, { from: user }) + await assertError(makeOfferFrom, broker, params, user) await assertOfferDoesNotExist(broker, params) await assertEtherBalance(broker, user, initialEtherBalance) }) @@ -240,7 +241,7 @@ contract('Test makeOffer', async () => { it('throws an error', async () => { const params = await getSampleOfferParams(nextNonce, user, initialEtherBalance) const signature = await signMakeOffer(params, coordinator) - await assertError(makeOffer, broker, params, { from: coordinator }, signature) + await assertError(makeOffer, broker, params, signature) await assertOfferDoesNotExist(broker, params) await assertEtherBalance(broker, user, initialEtherBalance) }) @@ -269,7 +270,7 @@ contract('Test makeOffer', async () => { contract('when the offerAmount is more than the maker\'s balance', async () => { it('throws an error', async () => { const params = await getSampleOfferParams(nextNonce, user, initialEtherBalance) - params.offerAmount = initialEtherBalance.plus(1) + params.offerAmount = new BigNumber(initialEtherBalance).plus(1).toString() await assertError(makeOffer, broker, params) await assertOfferDoesNotExist(broker, params) await assertEtherBalance(broker, user, initialEtherBalance) @@ -325,7 +326,7 @@ contract('Test makeOffer', async () => { const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 0 }) - await broker.cancel.sendTransaction(offerHash, params.offerAmount, '0x0', 0, v, r, s, { from: coordinator }) + await broker.cancel.sendTransaction(offerHash, params.offerAmount, ETHER_ADDR, 0, v, r, s, { from: coordinator }) await assertEtherBalance(broker, user, '1000000000000000000') await assertError(makeOffer, broker, params) diff --git a/test/TestBroker/slowCancel.js b/test/TestBroker/slowCancel.js index cf41467..fefcf45 100755 --- a/test/TestBroker/slowCancel.js +++ b/test/TestBroker/slowCancel.js @@ -40,11 +40,11 @@ contract('Test slowCancel', async () => { it('emits BalanceIncrease and Cancel events', async () => { await broker.announceCancel.sendTransaction(sampleOfferHash, { from: user }) await increaseEvmTime(announceDelay) - const { logs } = await broker.slowCancel(sampleOfferHash) + const { receipt: { rawLogs: logs } } = await broker.slowCancel(sampleOfferHash) assertEventEmission(logs, [{ eventType: 'BalanceIncrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '10', reason: REASON.ReasonCancel @@ -52,7 +52,7 @@ contract('Test slowCancel', async () => { }, { eventType: 'Cancel', args: { - maker: user.toLowerCase(), + maker: user, offerHash: sampleOfferHash } }]) diff --git a/test/TestBroker/slowWithdraw.js b/test/TestBroker/slowWithdraw.js index 83a3740..f241c66 100755 --- a/test/TestBroker/slowWithdraw.js +++ b/test/TestBroker/slowWithdraw.js @@ -28,7 +28,7 @@ contract('Test announceWithdraw + slowWithdraw', async () => { assertEventEmission(r1.logs, [{ eventType: 'WithdrawAnnounce', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '1000000000000000000' } @@ -40,7 +40,7 @@ contract('Test announceWithdraw + slowWithdraw', async () => { assertEventEmission(r2.logs, [{ eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '1000000000000000000', reason: REASON.ReasonWithdraw diff --git a/test/TestBroker/spendFrom.js b/test/TestBroker/spendFrom.js index 4f1d771..3648ef2 100755 --- a/test/TestBroker/spendFrom.js +++ b/test/TestBroker/spendFrom.js @@ -80,7 +80,7 @@ contract('Broker', function ([coordinator, notOwner, spender, from, to]) { }) it('emits an approval event', async function () { - const { logs } = await this.broker.approveSpender(spender, { from }) + const { receipt: { rawLogs: logs } } = await this.broker.approveSpender(spender, { from }) assertEventEmission(logs, [{ eventType: 'SpenderApprove', args: { @@ -119,7 +119,7 @@ contract('Broker', function ([coordinator, notOwner, spender, from, to]) { }) it('emits a rescind event', async function () { - const { logs } = await this.broker.rescindApproval(spender, { from }) + const { receipt: { rawLogs: logs } } = await this.broker.rescindApproval(spender, { from }) assertEventEmission(logs, [{ eventType: 'SpenderRescind', args: { @@ -185,7 +185,7 @@ contract('Broker', function ([coordinator, notOwner, spender, from, to]) { }); it('emits increase and decrease balance event', async function () { - const { logs } = await this.broker.spendFrom(from, to, amount, ETHER_ADDR, decreaseReason, increaseReason, { from: spender }); + const { receipt: { rawLogs: logs } } = await this.broker.spendFrom(from, to, amount, ETHER_ADDR, decreaseReason, increaseReason, { from: spender }); const expectedEvents = [ { eventType: 'BalanceDecrease', diff --git a/test/TestBroker/withdraw.js b/test/TestBroker/withdraw.js index 4a0f4fd..179ef6d 100755 --- a/test/TestBroker/withdraw.js +++ b/test/TestBroker/withdraw.js @@ -5,7 +5,7 @@ const web3 = new Web3(Web3.givenProvider) const { BigNumber } = require('bignumber.js') const { ETHER_ADDR, REASON, nonceGenerator, assertError, assertEventEmission, - assertWalletEtherAmount, assertEtherBalance, withdraw, signWithdraw } = require('../../utils/testUtils') + assertWalletEtherAmount, assertEtherBalance, withdraw, withdrawFrom, signWithdraw } = require('../../utils/testUtils') contract('Test withdraw', async () => { let broker, token, coordinator, user, accounts @@ -42,11 +42,11 @@ contract('Test withdraw', async () => { feeAmount: '0', nonce: nextNonce() } - const { logs } = await withdraw(broker, params) + const { receipt: { rawLogs: logs } } = await withdraw(broker, params) assertEventEmission(logs, [{ eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '1000000000000000000', reason: REASON.ReasonWithdraw @@ -66,12 +66,12 @@ contract('Test withdraw', async () => { feeAmount: '7', nonce: nextNonce() } - const { logs } = await withdraw(broker, params) + const { receipt: { rawLogs: logs } } = await withdraw(broker, params) const expectedEvents = [ { eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '1000000000000000000', reason: REASON.ReasonWithdraw @@ -80,7 +80,7 @@ contract('Test withdraw', async () => { { eventType: 'BalanceIncrease', args: { - user: operator.toLowerCase(), + user: operator, token: ETHER_ADDR, amount: '7', reason: REASON.ReasonWithdrawFeeReceive @@ -101,12 +101,12 @@ contract('Test withdraw', async () => { feeAmount: '20', nonce: nextNonce() } - const { logs } = await withdraw(broker, params) + const { receipt: { rawLogs: logs } } = await withdraw(broker, params) const expectedEvents = [ { eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: ETHER_ADDR, amount: '1000000000000000000', reason: REASON.ReasonWithdraw @@ -115,7 +115,7 @@ contract('Test withdraw', async () => { { eventType: 'BalanceDecrease', args: { - user: user.toLowerCase(), + user: user, token: token.address, amount: '20', reason: REASON.ReasonWithdrawFeeGive @@ -124,7 +124,7 @@ contract('Test withdraw', async () => { { eventType: 'BalanceIncrease', args: { - user: operator.toLowerCase(), + user: operator, token: token.address, amount: '20', reason: REASON.ReasonWithdrawFeeReceive @@ -393,7 +393,7 @@ contract('Test withdraw', async () => { nonce: nextNonce() } const signature = await signWithdraw(params, coordinator) - await assertError(withdraw, broker, params, undefined, signature) + await assertError(withdraw, broker, params, signature) await assertEtherBalance(broker, user, '900000000000000000', 'User\'s balance did not change') await assertWalletEtherAmount(user, remainingWalletEther.toString(), 'User\'s personal wallet amount did not change') await assertWalletEtherAmount(broker.address, '900000000000000000', 'Broker\'s balance did not change') @@ -474,7 +474,7 @@ contract('Test withdraw', async () => { feeAmount: '0', nonce: nextNonce() } - await assertError(withdraw, broker, params, { from: user }) + await assertError(withdrawFrom, broker, params, user) await assertEtherBalance(broker, user, '1000000000000000000', 'User\'s balance did not change') const updatedWalletEther = new BigNumber(await web3.eth.getBalance(user)) assert(updatedWalletEther.isLessThan(initialWalletEther), 'User\'s personal wallet amount did not increase') diff --git a/utils/testUtils.js b/utils/testUtils.js index 7a58f26..8679b2c 100644 --- a/utils/testUtils.js +++ b/utils/testUtils.js @@ -4,6 +4,7 @@ const Web3 = require('web3') const web3 = new Web3(Web3.givenProvider) const abiDecoder = require('abi-decoder') +const { BigNumber } = require('bignumber.js') const ZERO_ADDR = '0x0000000000000000000000000000000000000000' const ETHER_ADDR = '0x0000000000000000000000000000000000000000' @@ -114,17 +115,12 @@ const assertEventEmission = (emittedEvents, expectedEvents) => { const actualArg = emittedEvent.args[key] const expectedArg = expectedArgs[key] if (actualArg === undefined) { throw new Error('value for ' + key + ' is undefined') } - assert.equal(actualArg.toString(), expectedArg, 'value for ' + key + ' is ' + expectedArg) + assert.equal(actualArg.toString().toLowerCase(), expectedArg.toString().toLowerCase(), + 'value for ' + key + ' is ' + expectedArg) } } } -// assertEventEmission works for events from a single contract -// for -const assertReceiptLogs = (logs, expectedLogs) => { - -} - const assertError = async (method, ...args) => { let error = null try { @@ -133,10 +129,10 @@ const assertError = async (method, ...args) => { error = e } assert.notEqual(error, null, "expected an error but none was caught") - if (error.message.indexOf('VM Exception while processing transaction') !== 0) { - console.log('error.message', error.message) + if (error.message.indexOf('Returned error: VM Exception while processing transaction') < 0) { + console.log('Found error with wrong message:', error.message) } - assert.equal(error.message.indexOf('VM Exception while processing transaction'), 0, 'Throws contract "require" error') + assert.equal(error.message.indexOf('Returned error: VM Exception while processing transaction'), 0, 'Expected revert but none was thrown') } const assertRevert = async (promise) => { @@ -249,7 +245,7 @@ const getSampleOfferParams = (nextNonce, maker, initialEtherBalance) => { maker, offerAsset: ETHER_ADDR, wantAsset: OMG_ADDR, - offerAmount: initialEtherBalance.minus(1), + offerAmount: new BigNumber(initialEtherBalance).minus(1).toString(), wantAmount: 20, feeAsset: ETHER_ADDR, feeAmount: 0, @@ -270,29 +266,40 @@ const fetchOffer = async (broker, offerHash) => { } } -const makeOffer = async (broker, { maker, offerAsset, wantAsset, offerAmount, wantAmount, feeAsset, feeAmount, nonce }, txn, signature) => { +const makeOffer = async (broker, { maker, offerAsset, wantAsset, offerAmount, wantAmount, feeAsset, feeAmount, nonce }, signature) => { if (signature === undefined) { signature = await signMakeOffer({ maker, offerAsset, wantAsset, offerAmount, wantAmount, feeAsset, feeAmount, nonce }) } const { v, r, s } = signature - await broker.makeOffer.sendTransaction(maker, offerAsset, wantAsset, - offerAmount, wantAmount, feeAsset, feeAmount, nonce, v, r, s, txn) + await broker.makeOffer(maker, offerAsset, wantAsset, + offerAmount, wantAmount, feeAsset, feeAmount, nonce, v, r, s) } -const fillOffer = async (broker, { filler, offerHash, amountToTake, feeAsset, feeAmount, nonce }, txn, signature) => { +const makeOfferFrom = async (broker, { maker, offerAsset, wantAsset, offerAmount, wantAmount, feeAsset, feeAmount, nonce }, from) => { + const { v, r, s } = await signMakeOffer({ maker, offerAsset, wantAsset, offerAmount, wantAmount, feeAsset, feeAmount, nonce }) + await broker.makeOffer(maker, offerAsset, wantAsset, + offerAmount, wantAmount, feeAsset, feeAmount, nonce, v, r, s, { from }) +} + +const fillOffer = async (broker, { filler, offerHash, amountToTake, feeAsset, feeAmount, nonce }, signature) => { if (signature === undefined) { signature = await signFillOffer({ filler, offerHash, amountToTake, feeAsset, feeAmount, nonce }) } const { v, r, s } = signature - await broker.fillOffer.sendTransaction(filler, offerHash, amountToTake, feeAsset, feeAmount, nonce, v, r, s, txn) + await broker.fillOffer(filler, offerHash, amountToTake, feeAsset, feeAmount, nonce, v, r, s) +} + +const fillOfferFrom = async (broker, { filler, offerHash, amountToTake, feeAsset, feeAmount, nonce }, from) => { + const { v, r, s } = await signFillOffer({ filler, offerHash, amountToTake, feeAsset, feeAmount, nonce }) + await broker.fillOffer(filler, offerHash, amountToTake, feeAsset, feeAmount, nonce, v, r, s, { from }) } -const fillOffers = async (broker, { filler, offerHashes, amountsToTake, feeAsset, feeAmount, nonce }, txn, signature) => { +const fillOffers = async (broker, { filler, offerHashes, amountsToTake, feeAsset, feeAmount, nonce }, signature) => { if (signature === undefined) { signature = await signFillOffers({ filler, offerHashes, amountsToTake, feeAsset, feeAmount, nonce }) } const { v, r, s } = signature - return await broker.fillOffers(filler, offerHashes, amountsToTake, feeAsset, feeAmount, nonce, v, r, s, txn) + return await broker.fillOffers(filler, offerHashes, amountsToTake, feeAsset, feeAmount, nonce, v, r, s) } const signWithdraw = async ({ withdrawer, token, amount, feeAsset, feeAmount, nonce }, signee) => { @@ -310,12 +317,17 @@ const signWithdraw = async ({ withdrawer, token, amount, feeAsset, feeAmount, no return getSignatureComponents(signature) } -const withdraw = async (broker, { withdrawer, token, amount, feeAsset, feeAmount, nonce }, txn, signature) => { +const withdraw = async (broker, { withdrawer, token, amount, feeAsset, feeAmount, nonce }, signature) => { if (signature === undefined) { signature = await signWithdraw({ withdrawer, token, amount, feeAsset, feeAmount, nonce }) } const { v, r, s } = signature - return broker.withdraw(withdrawer, token, amount, feeAsset, feeAmount, nonce, v, r, s, txn) + return broker.withdraw(withdrawer, token, amount, feeAsset, feeAmount, nonce, v, r, s) +} + +const withdrawFrom= async (broker, { withdrawer, token, amount, feeAsset, feeAmount, nonce }, from) => { + const { v, r, s } = await signWithdraw({ withdrawer, token, amount, feeAsset, feeAmount, nonce }) + return broker.withdraw(withdrawer, token, amount, feeAsset, feeAmount, nonce, v, r, s, { from }) } @@ -362,18 +374,18 @@ const assertWalletTokenAmount = async (token, user, expectedAmount, message) => const fundUser = async ({ broker, user, coordinator }, { eth, jrc, swc }) => { if (swc !== undefined) { swCoin = await SWCoin.deployed() - await swCoin.mint.sendTransaction(user, swc) - await swCoin.approve.sendTransaction(broker.address, swc, { from: user }) - await broker.depositERC20.sendTransaction(user, swCoin.address, swc, { from: coordinator }) + await swCoin.mint(user, swc) + await swCoin.approve(broker.address, swc, { from: user }) + await broker.depositERC20(user, swCoin.address, swc, { from: coordinator }) } if (jrc !== undefined) { jrCoin = await JRCoin.deployed() - await jrCoin.mint.sendTransaction(user, jrc) - await jrCoin.approve.sendTransaction(broker.address, jrc, { from: user }) - await broker.depositERC20.sendTransaction(user, jrCoin.address, jrc, { from: coordinator }) + await jrCoin.mint(user, jrc) + await jrCoin.approve(broker.address, jrc, { from: user }) + await broker.depositERC20(user, jrCoin.address, jrc, { from: coordinator }) } if (eth !== undefined) { - await broker.depositEther.sendTransaction({ from: user, value: eth }) + await broker.depositEther({ from: user, value: eth }) } } @@ -399,22 +411,27 @@ const signCreateSwap = async ({ maker, taker, token, amount, hashedSecret, expir return getSignatureComponents(signature) } -const createSwap = async (atomicBroker, { maker, taker, token, amount, hashedSecret, expiryTime, feeAsset, feeAmount }, txn, signee) => { +const createSwap = async (atomicBroker, { maker, taker, token, amount, hashedSecret, expiryTime, feeAsset, feeAmount }, signee) => { if (signee === undefined) { signee = maker } const signature = await signCreateSwap({ maker, taker, token, amount, hashedSecret, expiryTime, feeAsset, feeAmount }, signee) const { v, r, s } = signature return await atomicBroker.createSwap(maker, taker, token, amount, hashedSecret, - expiryTime, feeAsset, feeAmount, v, r, s, txn) + expiryTime, feeAsset, feeAmount, v, r, s) } -const executeSwap = async (atomicBroker, { maker, taker, token, amount, hashedSecret, expiryTime, feeAsset, feeAmount, secret }, txn) => { +const executeSwap = async (atomicBroker, { maker, taker, token, amount, hashedSecret, expiryTime, feeAsset, feeAmount, secret }) => { return await atomicBroker.executeSwap(maker, taker, token, amount, hashedSecret, - expiryTime, feeAsset, feeAmount, secret, txn) + expiryTime, feeAsset, feeAmount, secret) } -const cancelSwap = async (atomicBroker, { maker, taker, token, amount, hashedSecret, expiryTime, feeAsset, feeAmount, cancelFeeAmount }, txn) => { +const cancelSwap = async (atomicBroker, { maker, taker, token, amount, hashedSecret, expiryTime, feeAsset, feeAmount, cancelFeeAmount }) => { return await atomicBroker.cancelSwap(maker, taker, token, amount, hashedSecret, - expiryTime, feeAsset, feeAmount, cancelFeeAmount, txn) + expiryTime, feeAsset, feeAmount, cancelFeeAmount) +} + +const cancelSwapFrom = async (atomicBroker, { maker, taker, token, amount, hashedSecret, expiryTime, feeAsset, feeAmount, cancelFeeAmount }, from) => { + return await atomicBroker.cancelSwap(maker, taker, token, amount, hashedSecret, + expiryTime, feeAsset, feeAmount, cancelFeeAmount, { from }) } const fetchSwapExistance = async (atomicBroker, swapParams) => { @@ -450,11 +467,13 @@ const assertBalances = async (broker, userBalances) => { } } +const hashSecret = (secret) => '0x' + sha256(web3.utils.hexToBytes('0x' + sha256(secret))) + const getSampleSwapParams = async ({ maker, taker, token, secret }) => { if (secret === undefined) { secret = 'password123' } - const hashedSecret = '0x' + sha256(web3.utils.hexToBytes('0x' + sha256(secret))) + const hashedSecret = hashSecret(secret) const evmTime = await getEvmTime() const expiryDelay = 600 @@ -463,7 +482,7 @@ const getSampleSwapParams = async ({ maker, taker, token, secret }) => { taker, token: token.address, amount: 999, - secret, + secret: web3.utils.utf8ToHex(secret), hashedSecret, expiryTime: evmTime + expiryDelay, expiryDelay, @@ -491,22 +510,10 @@ const assertSwapDoesNotExist = async (atomicBroker, swapParams) => { assert.equal(swapExists, false) } -const increaseEvmTime = async (time) => ( - new Promise((resolve, reject) => { - web3.currentProvider.sendAsync({ jsonrpc: "2.0", method: "evm_increaseTime", params: [time], id: new Date().getTime() }, - (err, _result) => { - if (err) return reject(err) - - web3.currentProvider.sendAsync({ jsonrpc: "2.0", method: "evm_mine", params: [], id: new Date().getTime() }, - (err, result) => { - if (err) reject(err) - else resolve(result) - } - ) - } - ) - }) -) +const increaseEvmTime = async (time) => { + await web3.currentProvider.send('evm_increaseTime', [time]) + await web3.currentProvider.send('evm_mine', []) +} const getEvmTime = async () => { const blockNumber = await web3.eth.getBlockNumber() @@ -531,11 +538,14 @@ module.exports = { emptyOfferParams, getSampleOfferParams, makeOffer, + makeOfferFrom, fillOffer, + fillOfferFrom, signFillOffers, fillOffers, signWithdraw, withdraw, + withdrawFrom, assertOfferDoesNotExist, assertOfferParams, assertTokenBalance, @@ -548,7 +558,9 @@ module.exports = { createSwap, executeSwap, cancelSwap, + cancelSwapFrom, fetchSwapExistance, + hashSecret, getSampleSwapParams, assertAddress, assertAmount, From 9349b7ca01314fdeae817b1bb369a93610befb10 Mon Sep 17 00:00:00 2001 From: Ivan Poon Date: Mon, 10 Jun 2019 16:50:04 +0800 Subject: [PATCH 04/12] Remove data after burn --- contracts/BombBurner.sol | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contracts/BombBurner.sol b/contracts/BombBurner.sol index 5444722..bb8b742 100644 --- a/contracts/BombBurner.sol +++ b/contracts/BombBurner.sol @@ -75,6 +75,9 @@ contract BombBurner { "Invalid approval transaction hash" ); + delete preparedBurnAmounts[_depositer]; + delete preparedBurnHashes[_depositer]; + broker.spendFrom( _depositer, address(this), From 524bbe2eafef3d50edb5594b6e5d551f2dcfd748 Mon Sep 17 00:00:00 2001 From: Ivan Poon Date: Thu, 13 Jun 2019 10:30:01 +0800 Subject: [PATCH 05/12] Improve burn checks --- contracts/BombBurner.sol | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/contracts/BombBurner.sol b/contracts/BombBurner.sol index bb8b742..0e2e1aa 100644 --- a/contracts/BombBurner.sol +++ b/contracts/BombBurner.sol @@ -49,10 +49,15 @@ contract BombBurner { onlyCoordinator { require( - bomb.allowance(_depositer, address(broker)) == _depositAmount, + _depositAmount > 0, "Invalid deposit amount" ); + require( + bomb.allowance(_depositer, address(broker)) == _depositAmount, + "Invalid approval amount" + ); + preparedBurnAmounts[_depositer] = bomb.findOnePercent(_depositAmount); preparedBurnHashes[_depositer] = _approvalTransactionHash; } @@ -66,15 +71,20 @@ contract BombBurner { onlyCoordinator { require( - preparedBurnAmounts[_depositer] == _burnAmount, + _burnAmount == preparedBurnAmounts[_depositer], "Invalid burn amount" ); require( - preparedBurnHashes[_depositer] == _approvalTransactionHash, + _approvalTransactionHash == preparedBurnHashes[_depositer], "Invalid approval transaction hash" ); + require( + bomb.allowance(_depositer, address(broker)) == 0, + "Invalid approved amount" + ); + delete preparedBurnAmounts[_depositer]; delete preparedBurnHashes[_depositer]; From a9c916e3f88dfe7c71a6ce4692f07d2b7e39c927 Mon Sep 17 00:00:00 2001 From: Ivan Poon Date: Wed, 19 Jun 2019 13:45:40 +0800 Subject: [PATCH 06/12] Add nuke burner contract --- contracts/BombBurner.sol | 2 +- contracts/NukeBurner.sol | 100 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 contracts/NukeBurner.sol diff --git a/contracts/BombBurner.sol b/contracts/BombBurner.sol index 0e2e1aa..e507179 100644 --- a/contracts/BombBurner.sol +++ b/contracts/BombBurner.sol @@ -4,7 +4,7 @@ import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./BombCoin.sol"; import "./Broker.sol"; -/// @title The AirDropper contract to send ether to users +/// @title The BombBurner contract to burn 1% of tokens on approve+transfer /// @author Switcheo Network contract BombBurner { using SafeMath for uint256; diff --git a/contracts/NukeBurner.sol b/contracts/NukeBurner.sol new file mode 100644 index 0000000..3433e17 --- /dev/null +++ b/contracts/NukeBurner.sol @@ -0,0 +1,100 @@ +pragma solidity 0.4.25; + +import "openzeppelin-solidity/contracts/math/SafeMath.sol"; +import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol"; +import "./Broker.sol"; + +/// @title The NukeBurner contract to burn 2% of tokens on approve+transfer +/// @author Switcheo Network +contract NukeBurner { + using SafeMath for uint256; + + // The Switcheo Broker contract + StandardToken public nuke; + Broker public broker; + + uint8 constant ReasonDepositBurnGive = 0x40; + uint8 constant ReasonDepositBurnReceive = 0x41; + + // A record of deposits that will have 1% burnt + mapping(address => uint256) public preparedBurnAmounts; + mapping(address => bytes32) public preparedBurnHashes; + + // Emitted when ether is sent + event SendEther(bytes32 indexed id, address indexed receiver, uint256 amount); + + /// @notice Initializes the AirDropper contract + /// @dev The broker is initialized to the Switcheo Broker + constructor(address brokerAddress, address tokenAddress) + public + { + broker = Broker(brokerAddress); + nuke = StandardToken(tokenAddress); + } + + modifier onlyCoordinator() { + require( + msg.sender == address(broker.coordinator()), + "Invalid sender" + ); + _; + } + + function prepareBurn( + address _depositer, + uint256 _depositAmount, + bytes32 _approvalTransactionHash + ) + external + onlyCoordinator + { + require( + _depositAmount > 0, + "Invalid deposit amount" + ); + + require( + nuke.allowance(_depositer, address(broker)) == _depositAmount, + "Invalid approval amount" + ); + + preparedBurnAmounts[_depositer] = _depositAmount.div(50); + preparedBurnHashes[_depositer] = _approvalTransactionHash; + } + + function executeBurn( + address _depositer, + uint256 _burnAmount, + bytes32 _approvalTransactionHash + ) + external + onlyCoordinator + { + require( + _burnAmount == preparedBurnAmounts[_depositer], + "Invalid burn amount" + ); + + require( + _approvalTransactionHash == preparedBurnHashes[_depositer], + "Invalid approval transaction hash" + ); + + require( + nuke.allowance(_depositer, address(broker)) == 0, + "Invalid approved amount" + ); + + delete preparedBurnAmounts[_depositer]; + delete preparedBurnHashes[_depositer]; + + broker.spendFrom( + _depositer, + address(this), + _burnAmount, + address(nuke), + ReasonDepositBurnGive, + ReasonDepositBurnReceive + ); + } +} From b75ebf24f5d26cbf39e7e54e48ba31d8982f9f13 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 19 Jun 2019 15:27:24 +0800 Subject: [PATCH 07/12] Add NukeCoin contract --- contracts/NukeCoin.sol | 200 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 contracts/NukeCoin.sol diff --git a/contracts/NukeCoin.sol b/contracts/NukeCoin.sol new file mode 100644 index 0000000..1814bc1 --- /dev/null +++ b/contracts/NukeCoin.sol @@ -0,0 +1,200 @@ +/** + *Submitted for verification at Etherscan.io on 2019-06-05 +*/ + +pragma solidity ^0.5.0; + +interface IERC20 { + function totalSupply() external view returns (uint256); + function balanceOf(address who) external view returns (uint256); + function allowance(address owner, address spender) external view returns (uint256); + function transfer(address to, uint256 value) external returns (bool); + function approve(address spender, uint256 value) external returns (bool); + function transferFrom(address from, address to, uint256 value) external returns (bool); + + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval(address indexed owner, address indexed spender, uint256 value); +} + +library SafeMath { + function mul(uint256 a, uint256 b) internal pure returns (uint256) { + if (a == 0) { + return 0; + } + uint256 c = a * b; + assert(c / a == b); + return c; + } + + function div(uint256 a, uint256 b) internal pure returns (uint256) { + uint256 c = a / b; + return c; + } + + function sub(uint256 a, uint256 b) internal pure returns (uint256) { + assert(b <= a); + return a - b; + } + + function add(uint256 a, uint256 b) internal pure returns (uint256) { + uint256 c = a + b; + assert(c >= a); + return c; + } + + function ceil(uint256 a, uint256 m) internal pure returns (uint256) { + uint256 c = add(a,m); + uint256 d = sub(c,1); + return mul(div(d,m),m); + } +} + +contract ERC20Detailed is IERC20 { + + uint8 private _Tokendecimals; + string private _Tokenname; + string private _Tokensymbol; + + constructor(string memory name, string memory symbol, uint8 decimals) public { + + _Tokendecimals = decimals; + _Tokenname = name; + _Tokensymbol = symbol; + + } + + function name() public view returns(string memory) { + return _Tokenname; + } + + function symbol() public view returns(string memory) { + return _Tokensymbol; + } + + function decimals() public view returns(uint8) { + return _Tokendecimals; + } +} + +/**end here**/ + +contract HalfLife is ERC20Detailed { + + using SafeMath for uint256; + mapping (address => uint256) private _HalflifeTokenBalances; + mapping (address => mapping (address => uint256)) private _allowed; + string constant tokenName = "HalfLife"; + string constant tokenSymbol = "NUKE"; + uint8 constant tokenDecimals = 18; + uint256 _totalSupply = 1000000000000000000000000; + + + + + constructor() public payable ERC20Detailed(tokenName, tokenSymbol, tokenDecimals) { + _mint(msg.sender, _totalSupply); + } + + function totalSupply() public view returns (uint256) { + return _totalSupply; + } + + function balanceOf(address owner) public view returns (uint256) { + return _HalflifeTokenBalances[owner]; + } + + function allowance(address owner, address spender) public view returns (uint256) { + return _allowed[owner][spender]; + } + + + + function transfer(address to, uint256 value) public returns (bool) { + require(value <= _HalflifeTokenBalances[msg.sender]); + require(to != address(0)); + + uint256 HalflifeTokenDecay = value.div(50); + uint256 tokensToTransfer = value.sub(HalflifeTokenDecay); + + _HalflifeTokenBalances[msg.sender] = _HalflifeTokenBalances[msg.sender].sub(value); + _HalflifeTokenBalances[to] = _HalflifeTokenBalances[to].add(tokensToTransfer); + + _totalSupply = _totalSupply.sub(HalflifeTokenDecay); + + emit Transfer(msg.sender, to, tokensToTransfer); + emit Transfer(msg.sender, address(0), HalflifeTokenDecay); + return true; + } + + function multiTransfer(address[] memory receivers, uint256[] memory amounts) public { + for (uint256 i = 0; i < receivers.length; i++) { + transfer(receivers[i], amounts[i]); + } + } + + function approve(address spender, uint256 value) public returns (bool) { + require(spender != address(0)); + _allowed[msg.sender][spender] = value; + emit Approval(msg.sender, spender, value); + return true; + } + + function transferFrom(address from, address to, uint256 value) public returns (bool) { + require(value <= _HalflifeTokenBalances[from]); + require(value <= _allowed[from][msg.sender]); + require(to != address(0)); + + _HalflifeTokenBalances[from] = _HalflifeTokenBalances[from].sub(value); + + uint256 HalflifeTokenDecay = value.div(50); + uint256 tokensToTransfer = value.sub(HalflifeTokenDecay); + + _HalflifeTokenBalances[to] = _HalflifeTokenBalances[to].add(tokensToTransfer); + _totalSupply = _totalSupply.sub(HalflifeTokenDecay); + + _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); + + emit Transfer(from, to, tokensToTransfer); + emit Transfer(from, address(0), HalflifeTokenDecay); + + return true; + } + + function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { + require(spender != address(0)); + _allowed[msg.sender][spender] = (_allowed[msg.sender][spender].add(addedValue)); + emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); + return true; + } + + function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { + require(spender != address(0)); + _allowed[msg.sender][spender] = (_allowed[msg.sender][spender].sub(subtractedValue)); + emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); + return true; + } + + function _mint(address account, uint256 amount) internal { + require(amount != 0); + _HalflifeTokenBalances[account] = _HalflifeTokenBalances[account].add(amount); + emit Transfer(address(0), account, amount); + } + + function burn(uint256 amount) external { + _burn(msg.sender, amount); + } + + function _burn(address account, uint256 amount) internal { + require(amount != 0); + require(amount <= _HalflifeTokenBalances[account]); + _totalSupply = _totalSupply.sub(amount); + _HalflifeTokenBalances[account] = _HalflifeTokenBalances[account].sub(amount); + emit Transfer(account, address(0), amount); + } + + function burnFrom(address account, uint256 amount) external { + require(amount <= _allowed[account][msg.sender]); + _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(amount); + _burn(account, amount); + } +} From f7e81e6328b3ca218d1e0f6e29b2aacfe2d0584c Mon Sep 17 00:00:00 2001 From: John Date: Wed, 19 Jun 2019 17:50:33 +0800 Subject: [PATCH 08/12] Remove unused event --- contracts/NukeBurner.sol | 3 --- 1 file changed, 3 deletions(-) diff --git a/contracts/NukeBurner.sol b/contracts/NukeBurner.sol index 3433e17..9f946ce 100644 --- a/contracts/NukeBurner.sol +++ b/contracts/NukeBurner.sol @@ -20,9 +20,6 @@ contract NukeBurner { mapping(address => uint256) public preparedBurnAmounts; mapping(address => bytes32) public preparedBurnHashes; - // Emitted when ether is sent - event SendEther(bytes32 indexed id, address indexed receiver, uint256 amount); - /// @notice Initializes the AirDropper contract /// @dev The broker is initialized to the Switcheo Broker constructor(address brokerAddress, address tokenAddress) From 5dedbfd9ce097c6e24755416e3e04629dcb2f3b2 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 20 Jun 2019 12:17:04 +0800 Subject: [PATCH 09/12] Add NukeBurner events --- contracts/NukeBurner.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contracts/NukeBurner.sol b/contracts/NukeBurner.sol index 9f946ce..d07467f 100644 --- a/contracts/NukeBurner.sol +++ b/contracts/NukeBurner.sol @@ -20,6 +20,9 @@ contract NukeBurner { mapping(address => uint256) public preparedBurnAmounts; mapping(address => bytes32) public preparedBurnHashes; + event PrepareBurn(address indexed depositer, uint256 depositAmount, bytes32 indexed approvalTransactionHash); + event ExecuteBurn(address indexed depositer, uint256 burnAmount, bytes32 indexed approvalTransactionHash); + /// @notice Initializes the AirDropper contract /// @dev The broker is initialized to the Switcheo Broker constructor(address brokerAddress, address tokenAddress) @@ -57,6 +60,8 @@ contract NukeBurner { preparedBurnAmounts[_depositer] = _depositAmount.div(50); preparedBurnHashes[_depositer] = _approvalTransactionHash; + + emit PrepareBurn(_depositer, _depositAmount, _approvalTransactionHash); } function executeBurn( @@ -93,5 +98,7 @@ contract NukeBurner { ReasonDepositBurnGive, ReasonDepositBurnReceive ); + + emit ExecuteBurn(_depositer, _burnAmount, _approvalTransactionHash); } } From 8d61533134a3fcc59ab9be60ac992434f815a044 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 20 Jun 2019 18:27:21 +0800 Subject: [PATCH 10/12] Update PrepareBurn event --- contracts/NukeBurner.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/NukeBurner.sol b/contracts/NukeBurner.sol index d07467f..bf8c7a8 100644 --- a/contracts/NukeBurner.sol +++ b/contracts/NukeBurner.sol @@ -20,7 +20,7 @@ contract NukeBurner { mapping(address => uint256) public preparedBurnAmounts; mapping(address => bytes32) public preparedBurnHashes; - event PrepareBurn(address indexed depositer, uint256 depositAmount, bytes32 indexed approvalTransactionHash); + event PrepareBurn(address indexed depositer, uint256 depositAmount, bytes32 indexed approvalTransactionHash, uint256 burnAmount); event ExecuteBurn(address indexed depositer, uint256 burnAmount, bytes32 indexed approvalTransactionHash); /// @notice Initializes the AirDropper contract @@ -61,7 +61,7 @@ contract NukeBurner { preparedBurnAmounts[_depositer] = _depositAmount.div(50); preparedBurnHashes[_depositer] = _approvalTransactionHash; - emit PrepareBurn(_depositer, _depositAmount, _approvalTransactionHash); + emit PrepareBurn(_depositer, _depositAmount, _approvalTransactionHash, preparedBurnAmounts[_depositer]); } function executeBurn( From f7820f878f9d8cf21999e8afc1586180934cbfc0 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 21 Jun 2019 11:52:12 +0800 Subject: [PATCH 11/12] Add BombBurner events --- contracts/BombBurner.sol | 11 +++++++---- contracts/NukeBurner.sol | 3 +-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/contracts/BombBurner.sol b/contracts/BombBurner.sol index e507179..c4ad704 100644 --- a/contracts/BombBurner.sol +++ b/contracts/BombBurner.sol @@ -20,11 +20,10 @@ contract BombBurner { mapping(address => uint256) public preparedBurnAmounts; mapping(address => bytes32) public preparedBurnHashes; - // Emitted when ether is sent - event SendEther(bytes32 indexed id, address indexed receiver, uint256 amount); + event PrepareBurn(address indexed depositer, uint256 depositAmount, bytes32 indexed approvalTransactionHash, uint256 burnAmount); + event ExecuteBurn(address indexed depositer, uint256 burnAmount, bytes32 indexed approvalTransactionHash); - /// @notice Initializes the AirDropper contract - /// @dev The broker is initialized to the Switcheo Broker + /// @notice Initializes the BombBurner contract constructor(address brokerAddress, address bombAddress) public { @@ -60,6 +59,8 @@ contract BombBurner { preparedBurnAmounts[_depositer] = bomb.findOnePercent(_depositAmount); preparedBurnHashes[_depositer] = _approvalTransactionHash; + + emit PrepareBurn(_depositer, _depositAmount, _approvalTransactionHash, preparedBurnAmounts[_depositer]); } function executeBurn( @@ -96,5 +97,7 @@ contract BombBurner { ReasonDepositBurnGive, ReasonDepositBurnReceive ); + + emit ExecuteBurn(_depositer, _burnAmount, _approvalTransactionHash); } } diff --git a/contracts/NukeBurner.sol b/contracts/NukeBurner.sol index bf8c7a8..47b8337 100644 --- a/contracts/NukeBurner.sol +++ b/contracts/NukeBurner.sol @@ -23,8 +23,7 @@ contract NukeBurner { event PrepareBurn(address indexed depositer, uint256 depositAmount, bytes32 indexed approvalTransactionHash, uint256 burnAmount); event ExecuteBurn(address indexed depositer, uint256 burnAmount, bytes32 indexed approvalTransactionHash); - /// @notice Initializes the AirDropper contract - /// @dev The broker is initialized to the Switcheo Broker + /// @notice Initializes the NukeBurner contract constructor(address brokerAddress, address tokenAddress) public { From 94f7de0f7082b446b107a3620c5416464aa5ee2a Mon Sep 17 00:00:00 2001 From: John Date: Tue, 25 Jun 2019 15:01:41 +0800 Subject: [PATCH 12/12] Update assertEventEmission method --- contracts/NukeCoin.sol | 2 +- package-lock.json | 2 +- test/TestAirDropper/sendEther.js | 2 +- test/TestAtomicBroker/cancelSwap.js | 4 ++-- test/TestAtomicBroker/createSwap.js | 4 ++-- test/TestAtomicBroker/executeSwap.js | 4 ++-- test/TestBroker/announceCancel.js | 4 ++-- test/TestBroker/cancel.js | 12 ++++++------ test/TestBroker/depositERC20.js | 5 +++-- test/TestBroker/depositEther.js | 4 ++-- test/TestBroker/emergencyCancel.js | 4 ++-- test/TestBroker/emergencyWithdraw.js | 4 ++-- test/TestBroker/fastCancel.js | 4 ++-- test/TestBroker/fillOffer.js | 12 ++++++------ test/TestBroker/makeOffer.js | 12 ++++++------ test/TestBroker/slowCancel.js | 4 ++-- test/TestBroker/slowWithdraw.js | 8 ++++---- test/TestBroker/spendFrom.js | 12 ++++++------ test/TestBroker/withdraw.js | 12 ++++++------ utils/testUtils.js | 8 ++++++-- 20 files changed, 64 insertions(+), 59 deletions(-) diff --git a/contracts/NukeCoin.sol b/contracts/NukeCoin.sol index 1814bc1..cdccf7b 100644 --- a/contracts/NukeCoin.sol +++ b/contracts/NukeCoin.sol @@ -2,7 +2,7 @@ *Submitted for verification at Etherscan.io on 2019-06-05 */ -pragma solidity ^0.5.0; +pragma solidity ^0.4.25; interface IERC20 { function totalSupply() external view returns (uint256); diff --git a/package-lock.json b/package-lock.json index 0d31407..f97e3ad 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1354,7 +1354,7 @@ "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz", "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git", + "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#8431eab7b3384e65e8126a4602520b78031666fb", "ethereumjs-util": "^5.1.1" }, "dependencies": { diff --git a/test/TestAirDropper/sendEther.js b/test/TestAirDropper/sendEther.js index d60f9f3..1a44759 100644 --- a/test/TestAirDropper/sendEther.js +++ b/test/TestAirDropper/sendEther.js @@ -21,7 +21,7 @@ contract('Test createSwap', async (accounts) => { contract('test event emission', async () => { it('emits a SendEther event', async () => { const result = await airDropper.sendEther(id, receiver, 1000) - assertEventEmission(result.receipt.rawLogs, [ + assertEventEmission(result, [ { eventType: 'SendEther', args: { diff --git a/test/TestAtomicBroker/cancelSwap.js b/test/TestAtomicBroker/cancelSwap.js index be5bbfd..9471933 100644 --- a/test/TestAtomicBroker/cancelSwap.js +++ b/test/TestAtomicBroker/cancelSwap.js @@ -39,7 +39,7 @@ contract('Test cancelSwap', async (accounts) => { await increaseEvmTime(700) const result = await cancelSwap(atomicBroker, { ...swapParams, cancelFeeAmount: 2 }) - assertEventEmission(result.receipt.rawLogs, [ + assertEventEmission(result, [ { eventType: 'BalanceDecrease', args: { @@ -204,7 +204,7 @@ contract('Test cancelSwap', async (accounts) => { await increaseEvmTime(700) const result = await cancelSwap(atomicBroker, { ...swapParams, cancelFeeAmount: 5 }) - assertEventEmission(result.receipt.rawLogs, [ + assertEventEmission(result, [ { eventType: 'BalanceDecrease', args: { diff --git a/test/TestAtomicBroker/createSwap.js b/test/TestAtomicBroker/createSwap.js index 296ddce..703525c 100644 --- a/test/TestAtomicBroker/createSwap.js +++ b/test/TestAtomicBroker/createSwap.js @@ -27,7 +27,7 @@ contract('Test createSwap', async (accounts) => { it('emits BalanceDecrease, BalanceIncrease, CreateSwap events', async () => { const swapParams = await getSampleSwapParams({ maker, taker, token }) const result = await createSwap(atomicBroker, swapParams) - assertEventEmission(result.receipt.rawLogs, [ + assertEventEmission(result, [ { eventType: 'BalanceDecrease', args: { @@ -69,7 +69,7 @@ contract('Test createSwap', async (accounts) => { swapParams.feeAsset = secondToken.address swapParams.feeAmount = 9 const result = await createSwap(atomicBroker, swapParams) - assertEventEmission(result.receipt.rawLogs, [ + assertEventEmission(result, [ { eventType: 'BalanceDecrease', args: { diff --git a/test/TestAtomicBroker/executeSwap.js b/test/TestAtomicBroker/executeSwap.js index 89e054f..64c06a5 100644 --- a/test/TestAtomicBroker/executeSwap.js +++ b/test/TestAtomicBroker/executeSwap.js @@ -35,7 +35,7 @@ contract('Test executeSwap', async (accounts) => { contract('test event emission', async () => { it('emits BalanceDecrease, BalanceIncrease, BalanceDecrease, BalanceIncrease, ExecuteSwap events', async () => { const result = await executeSwap(atomicBroker, swapParams) - assertEventEmission(result.receipt.rawLogs, [ + assertEventEmission(result, [ { eventType: 'BalanceDecrease', args: { @@ -144,7 +144,7 @@ contract('Test executeSwap', async (accounts) => { contract('test event emission', async () => { it('emits BalanceDecrease, BalanceIncrease, BalanceDecrease, BalanceIncrease, ExecuteSwap events', async () => { const result = await executeSwap(atomicBroker, swapParams) - assertEventEmission(result.receipt.rawLogs, [ + assertEventEmission(result, [ { eventType: 'BalanceDecrease', args: { diff --git a/test/TestBroker/announceCancel.js b/test/TestBroker/announceCancel.js index aa0627e..7771e30 100755 --- a/test/TestBroker/announceCancel.js +++ b/test/TestBroker/announceCancel.js @@ -36,8 +36,8 @@ contract('Test announceCancel', async () => { contract('test event emission', async () => { it('emits CancelAnnounce event', async () => { - const { receipt: { rawLogs: logs } } = await broker.announceCancel(sampleOfferHash, { from: user }) - assertEventEmission(logs, [{ + const result = await broker.announceCancel(sampleOfferHash, { from: user }) + assertEventEmission(result, [{ eventType: 'CancelAnnounce', args: { user: user, diff --git a/test/TestBroker/cancel.js b/test/TestBroker/cancel.js index 65fe758..ddae78e 100755 --- a/test/TestBroker/cancel.js +++ b/test/TestBroker/cancel.js @@ -37,8 +37,8 @@ contract('Test cancel', async () => { await makeOffer(broker, params) const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 0 }) - const { receipt: { rawLogs: logs } } = await broker.cancel(offerHash, params.offerAmount, ETHER_ADDR, 0, v, r, s, { from: coordinator }) - assertEventEmission(logs, [{ + const result = await broker.cancel(offerHash, params.offerAmount, ETHER_ADDR, 0, v, r, s, { from: coordinator }) + assertEventEmission(result, [{ eventType: 'BalanceIncrease', args: { user: user, @@ -62,7 +62,7 @@ contract('Test cancel', async () => { await makeOffer(broker, params) const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: ETHER_ADDR, feeAmount: 2 }) - const { receipt: { rawLogs: logs } } = await broker.cancel(offerHash, params.offerAmount, ETHER_ADDR, 2, v, r, s, { from: coordinator }) + const result = await broker.cancel(offerHash, params.offerAmount, ETHER_ADDR, 2, v, r, s, { from: coordinator }) const expectedEvents = [ { eventType: 'BalanceIncrease', @@ -90,7 +90,7 @@ contract('Test cancel', async () => { } } ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }) }) @@ -100,7 +100,7 @@ contract('Test cancel', async () => { await makeOffer(broker, params) const offerHash = getOfferHash(params) const { v, r, s } = await signCancel({ offerParams: params, feeAsset: token.address, feeAmount: 7 }) - const { receipt: { rawLogs: logs } } = await broker.cancel(offerHash, params.offerAmount, token.address, 7, v, r, s, { from: coordinator }) + const result = await broker.cancel(offerHash, params.offerAmount, token.address, 7, v, r, s, { from: coordinator }) const expectedEvents = [ { eventType: 'BalanceIncrease', @@ -137,7 +137,7 @@ contract('Test cancel', async () => { } } ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }) }) }) diff --git a/test/TestBroker/depositERC20.js b/test/TestBroker/depositERC20.js index e5508c8..f240743 100755 --- a/test/TestBroker/depositERC20.js +++ b/test/TestBroker/depositERC20.js @@ -27,8 +27,9 @@ contract('Test depositERC20', async () => { contract('test event emission', async () => { it('emits BalanceIncrease event', async () => { await token.approve.sendTransaction(broker.address, 42, { from: user }) - const receipt = await broker.depositERC20(user, token.address, 20, { from: coordinator }) - assertEventEmission(receipt.logs, [{ + const result = await broker.depositERC20(user, token.address, 20, { from: coordinator }) + result.receipt.logs = result.logs + assertEventEmission(result, [{ eventType: 'BalanceIncrease', args: { user: user, diff --git a/test/TestBroker/depositEther.js b/test/TestBroker/depositEther.js index 5a8db6a..969b502 100755 --- a/test/TestBroker/depositEther.js +++ b/test/TestBroker/depositEther.js @@ -15,8 +15,8 @@ contract('Test depositEther', async () => { contract('test event emission', async () => { it('emits BalanceIncrease event', async () => { const amount = web3.utils.toWei('1', 'ether') - const { receipt: { rawLogs: logs } } = await broker.depositEther({ from: user, value: amount }) - assertEventEmission(logs, [{ + const result = await broker.depositEther({ from: user, value: amount }) + assertEventEmission(result, [{ eventType: 'BalanceIncrease', args: { user: user, diff --git a/test/TestBroker/emergencyCancel.js b/test/TestBroker/emergencyCancel.js index 9aa2b01..a42e10a 100755 --- a/test/TestBroker/emergencyCancel.js +++ b/test/TestBroker/emergencyCancel.js @@ -32,8 +32,8 @@ contract('Test emergencyCancel', async () => { await broker.setState.sendTransaction(1) const offerHash = getOfferHash(params) - const { receipt: { rawLogs: logs } } = await broker.emergencyCancel(offerHash, params.offerAmount, { from: coordinator }) - assertEventEmission(logs, [{ + const result = await broker.emergencyCancel(offerHash, params.offerAmount, { from: coordinator }) + assertEventEmission(result, [{ eventType: 'BalanceIncrease', args: { user: user, diff --git a/test/TestBroker/emergencyWithdraw.js b/test/TestBroker/emergencyWithdraw.js index 944b734..3e808f0 100755 --- a/test/TestBroker/emergencyWithdraw.js +++ b/test/TestBroker/emergencyWithdraw.js @@ -25,8 +25,8 @@ contract('Test emergencyWithdraw', async () => { contract('test event emission', async () => { it('emits BalanceDecrease event', async () => { await broker.setState.sendTransaction(1) - const { receipt: { rawLogs: logs } } = await broker.emergencyWithdraw(user, ETHER_ADDR, initialEtherBalance) - assertEventEmission(logs, [{ + const result = await broker.emergencyWithdraw(user, ETHER_ADDR, initialEtherBalance) + assertEventEmission(result, [{ eventType: 'BalanceDecrease', args: { user: user, diff --git a/test/TestBroker/fastCancel.js b/test/TestBroker/fastCancel.js index f2e390b..3b5f7d6 100755 --- a/test/TestBroker/fastCancel.js +++ b/test/TestBroker/fastCancel.js @@ -38,8 +38,8 @@ contract('Test fastCancel', async () => { contract('test event emission', async () => { it('emits BalanceIncrease and Cancel events', async () => { await broker.announceCancel.sendTransaction(sampleOfferHash, { from: user }) - const { receipt: { rawLogs: logs } } = await broker.fastCancel(sampleOfferHash, sampleOffer.offerAmount) - assertEventEmission(logs, [{ + const result = await broker.fastCancel(sampleOfferHash, sampleOffer.offerAmount) + assertEventEmission(result, [{ eventType: 'BalanceIncrease', args: { user: user, diff --git a/test/TestBroker/fillOffer.js b/test/TestBroker/fillOffer.js index a75d5bc..0453fe6 100755 --- a/test/TestBroker/fillOffer.js +++ b/test/TestBroker/fillOffer.js @@ -212,7 +212,7 @@ contract('Test fillOffer', async () => { // amountToTakeAfterFees: 3 ETH - 1 ETH = 2 ETH const signature = await signFillOffer(fillParams) const { v, r, s } = signature - const { receipt: { rawLogs: logs } } = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, + const result = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, fillParams.feeAsset, fillParams.feeAmount, fillParams.nonce, v, r, s) const offer = await fetchOffer(broker, fillParams.offerHash) @@ -269,7 +269,7 @@ contract('Test fillOffer', async () => { } } ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }) }) @@ -292,7 +292,7 @@ contract('Test fillOffer', async () => { // amountToTakeAfterFees: 3 ETH const signature = await signFillOffer(fillParams) const { v, r, s } = signature - const { receipt: { rawLogs: logs } } = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, + const result = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, fillParams.feeAsset, fillParams.feeAmount, fillParams.nonce, v, r, s) const offer = await fetchOffer(broker, fillParams.offerHash) @@ -358,7 +358,7 @@ contract('Test fillOffer', async () => { } } ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }) }) @@ -380,7 +380,7 @@ contract('Test fillOffer', async () => { // amountToTakeAfterFees: 3 ETH const signature = await signFillOffer(fillParams) const { v, r, s } = signature - const { receipt: { rawLogs: logs } } = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, + const result = await broker.fillOffer(fillParams.filler, fillParams.offerHash, fillParams.amountToTake, fillParams.feeAsset, fillParams.feeAmount, fillParams.nonce, v, r, s) const offer = await fetchOffer(broker, fillParams.offerHash) @@ -446,7 +446,7 @@ contract('Test fillOffer', async () => { } } ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }) }) }) diff --git a/test/TestBroker/makeOffer.js b/test/TestBroker/makeOffer.js index 5c7dc6d..c8a7a02 100755 --- a/test/TestBroker/makeOffer.js +++ b/test/TestBroker/makeOffer.js @@ -36,9 +36,9 @@ contract('Test makeOffer', async () => { const offerHash = getOfferHash(params) const signature = await signMakeOffer(params) const { v, r, s } = signature - const { receipt: { rawLogs: logs } } = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, + const result = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, params.offerAmount, params.wantAmount, params.feeAsset, params.feeAmount, params.nonce, v, r, s) - assertEventEmission(logs, [{ + assertEventEmission(result, [{ eventType: 'BalanceDecrease', args: { user: user, @@ -66,7 +66,7 @@ contract('Test makeOffer', async () => { const offerHash = getOfferHash(params) const signature = await signMakeOffer(params) const { v, r, s } = signature - const { receipt: { rawLogs: logs } } = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, + const result = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, params.offerAmount, params.wantAmount, params.feeAsset, params.feeAmount, params.nonce, v, r, s) const expectedEvents = [ { @@ -95,7 +95,7 @@ contract('Test makeOffer', async () => { } } ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }) }) @@ -109,7 +109,7 @@ contract('Test makeOffer', async () => { const offerHash = getOfferHash(params) const signature = await signMakeOffer(params) const { v, r, s } = signature - const { receipt: { rawLogs: logs } } = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, + const result = await broker.makeOffer(params.maker, params.offerAsset, params.wantAsset, params.offerAmount, params.wantAmount, params.feeAsset, params.feeAmount, params.nonce, v, r, s) const expectedEvents = [ { @@ -147,7 +147,7 @@ contract('Test makeOffer', async () => { } } ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }) }) diff --git a/test/TestBroker/slowCancel.js b/test/TestBroker/slowCancel.js index fefcf45..3ac153d 100755 --- a/test/TestBroker/slowCancel.js +++ b/test/TestBroker/slowCancel.js @@ -40,8 +40,8 @@ contract('Test slowCancel', async () => { it('emits BalanceIncrease and Cancel events', async () => { await broker.announceCancel.sendTransaction(sampleOfferHash, { from: user }) await increaseEvmTime(announceDelay) - const { receipt: { rawLogs: logs } } = await broker.slowCancel(sampleOfferHash) - assertEventEmission(logs, [{ + const result = await broker.slowCancel(sampleOfferHash) + assertEventEmission(result, [{ eventType: 'BalanceIncrease', args: { user: user, diff --git a/test/TestBroker/slowWithdraw.js b/test/TestBroker/slowWithdraw.js index f241c66..80fa95d 100755 --- a/test/TestBroker/slowWithdraw.js +++ b/test/TestBroker/slowWithdraw.js @@ -24,8 +24,8 @@ contract('Test announceWithdraw + slowWithdraw', async () => { }) it('emits WithdrawAnnounce and BalanceDecrease event', async () => { - const r1 = await broker.announceWithdraw(ETHER_ADDR, ethersDeposited, { from: user }) - assertEventEmission(r1.logs, [{ + const result1 = await broker.announceWithdraw(ETHER_ADDR, ethersDeposited, { from: user }) + assertEventEmission(result1, [{ eventType: 'WithdrawAnnounce', args: { user: user, @@ -36,8 +36,8 @@ contract('Test announceWithdraw + slowWithdraw', async () => { await increaseEvmTime(announceDelay) - const r2 = await broker.slowWithdraw(user, ETHER_ADDR, ethersDeposited, { from: user }) - assertEventEmission(r2.logs, [{ + const result2 = await broker.slowWithdraw(user, ETHER_ADDR, ethersDeposited, { from: user }) + assertEventEmission(result2, [{ eventType: 'BalanceDecrease', args: { user: user, diff --git a/test/TestBroker/spendFrom.js b/test/TestBroker/spendFrom.js index 3648ef2..d12cfc2 100755 --- a/test/TestBroker/spendFrom.js +++ b/test/TestBroker/spendFrom.js @@ -80,8 +80,8 @@ contract('Broker', function ([coordinator, notOwner, spender, from, to]) { }) it('emits an approval event', async function () { - const { receipt: { rawLogs: logs } } = await this.broker.approveSpender(spender, { from }) - assertEventEmission(logs, [{ + const result = await this.broker.approveSpender(spender, { from }) + assertEventEmission(result, [{ eventType: 'SpenderApprove', args: { user: from, @@ -119,8 +119,8 @@ contract('Broker', function ([coordinator, notOwner, spender, from, to]) { }) it('emits a rescind event', async function () { - const { receipt: { rawLogs: logs } } = await this.broker.rescindApproval(spender, { from }) - assertEventEmission(logs, [{ + const result = await this.broker.rescindApproval(spender, { from }) + assertEventEmission(result, [{ eventType: 'SpenderRescind', args: { user: from, @@ -185,7 +185,7 @@ contract('Broker', function ([coordinator, notOwner, spender, from, to]) { }); it('emits increase and decrease balance event', async function () { - const { receipt: { rawLogs: logs } } = await this.broker.spendFrom(from, to, amount, ETHER_ADDR, decreaseReason, increaseReason, { from: spender }); + const result = await this.broker.spendFrom(from, to, amount, ETHER_ADDR, decreaseReason, increaseReason, { from: spender }); const expectedEvents = [ { eventType: 'BalanceDecrease', @@ -206,7 +206,7 @@ contract('Broker', function ([coordinator, notOwner, spender, from, to]) { } }, ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }); }); diff --git a/test/TestBroker/withdraw.js b/test/TestBroker/withdraw.js index 179ef6d..8d7c719 100755 --- a/test/TestBroker/withdraw.js +++ b/test/TestBroker/withdraw.js @@ -42,8 +42,8 @@ contract('Test withdraw', async () => { feeAmount: '0', nonce: nextNonce() } - const { receipt: { rawLogs: logs } } = await withdraw(broker, params) - assertEventEmission(logs, [{ + const result = await withdraw(broker, params) + assertEventEmission(result, [{ eventType: 'BalanceDecrease', args: { user: user, @@ -66,7 +66,7 @@ contract('Test withdraw', async () => { feeAmount: '7', nonce: nextNonce() } - const { receipt: { rawLogs: logs } } = await withdraw(broker, params) + const result = await withdraw(broker, params) const expectedEvents = [ { eventType: 'BalanceDecrease', @@ -87,7 +87,7 @@ contract('Test withdraw', async () => { } } ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }) }) @@ -101,7 +101,7 @@ contract('Test withdraw', async () => { feeAmount: '20', nonce: nextNonce() } - const { receipt: { rawLogs: logs } } = await withdraw(broker, params) + const result = await withdraw(broker, params) const expectedEvents = [ { eventType: 'BalanceDecrease', @@ -131,7 +131,7 @@ contract('Test withdraw', async () => { } } ] - assertEventEmission(logs, expectedEvents) + assertEventEmission(result, expectedEvents) }) }) }) diff --git a/utils/testUtils.js b/utils/testUtils.js index 8679b2c..e1a7c6d 100644 --- a/utils/testUtils.js +++ b/utils/testUtils.js @@ -94,7 +94,11 @@ const decodeReceiptLogs = (receiptLogs) => { return decodedLogs } -const assertEventEmission = (emittedEvents, expectedEvents) => { +const assertEventEmission = (result, expectedEvents) => { + let emittedEvents + if (result.receipt.logs) { emittedEvents = result.receipt.logs } + if (result.receipt.rawLogs) { emittedEvents = result.receipt.rawLogs } + if (expectedEvents.length === 0) { throw new Error('expectedEvents is empty') } @@ -132,7 +136,7 @@ const assertError = async (method, ...args) => { if (error.message.indexOf('Returned error: VM Exception while processing transaction') < 0) { console.log('Found error with wrong message:', error.message) } - assert.equal(error.message.indexOf('Returned error: VM Exception while processing transaction'), 0, 'Expected revert but none was thrown') + assert.equal(error.message.indexOf('VM Exception while processing transaction'), 0, 'Expected revert but none was thrown') } const assertRevert = async (promise) => {