diff --git a/contracts/lib/IsWorkerInterface.sol b/contracts/lib/IsWorkerInterface.sol new file mode 100644 index 00000000..677586a5 --- /dev/null +++ b/contracts/lib/IsWorkerInterface.sol @@ -0,0 +1,34 @@ +pragma solidity ^0.5.0; + +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @title IsWorkerInterface provides a method to check if an address is + * currently registered as an active worker. + */ +interface IsWorkerInterface { + + /** + * @notice Checks if an address is currently registered as an active worker. + * + * @param _worker Address to check. + * + * @return isWorker_ True if the worker is already added and expiration + * height is more than or equal to current block number. + * Returns false otherwise. + */ + function isWorker(address _worker) external view returns (bool isWorker_); + +} diff --git a/contracts/lib/Organization.sol b/contracts/lib/Organization.sol new file mode 100644 index 00000000..4a48211a --- /dev/null +++ b/contracts/lib/Organization.sol @@ -0,0 +1,251 @@ +pragma solidity ^0.5.0; + +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import "./SafeMath.sol"; +import "./OrganizationInterface.sol"; +import "./IsWorkerInterface.sol"; + + +/** + * @title Organization contract. + * + * @notice The organization represents an entity that manages the + * mosaic ecosystem and therefore the Organization.sol contract holds + * all the keys required to administer the mosaic contracts. + */ +contract Organization is OrganizationInterface, IsWorkerInterface { + using SafeMath for uint256; + + /* Storage */ + + /** Address for which private key will be owned by organization. */ + address public owner; + + /** + * Proposed Owner is the newly proposed address that was proposed by the + * current owner for ownership transfer. + */ + address public proposedOwner; + + /** Admin address set by owner to facilitate operations of an economy. */ + address public admin; + + /** + * Map of whitelisted worker addresses to their expiration block height. + */ + mapping(address => uint256) public workers; + + + /* Modifiers */ + + /** + * onlyOwner functions can only be called from the address that is + * registered as the owner. + */ + modifier onlyOwner() + { + require( + msg.sender == owner, + "Only owner is allowed to call this method." + ); + + _; + } + + /** + * onlyOwnerOrAdmin functions can only be called from an address that is + * either registered as owner or as admin. + */ + modifier onlyOwnerOrAdmin() + { + require( + msg.sender == owner || msg.sender == admin, + "Only owner and admin are allowed to call this method." + ); + + _; + } + + + /* Constructor */ + + /** + * @notice The address that creates the contract is set as the initial + * owner. + */ + constructor() public + { + owner = msg.sender; + } + + + /* External Functions */ + + /** + * @notice Proposes a new owner of this contract. Ownership will not be + * transferred until the new, proposed owner accepts the proposal. + * Allows resetting of proposed owner to address(0). + * + * @param _proposedOwner Proposed owner address. + * + * @return success_ True on successful execution. + */ + function initiateOwnershipTransfer( + address _proposedOwner + ) + external + onlyOwner + returns (bool success_) + { + require( + _proposedOwner != owner, + "Proposed owner address can't be current owner address." + ); + + proposedOwner = _proposedOwner; + + emit OwnershipTransferInitiated(_proposedOwner); + + success_ = true; + } + + /** + * @notice Complete ownership transfer to proposed owner. Must be called by + * the proposed owner. + * + * @return success_ True on successful execution. + */ + function completeOwnershipTransfer() external returns (bool success_) + { + require( + msg.sender == proposedOwner, + "Caller is not proposed owner address." + ); + + owner = proposedOwner; + proposedOwner = address(0); + + emit OwnershipTransferCompleted(owner); + + success_ = true; + } + + /** + * @notice Sets the admin address. Can only be called by owner or current + * admin. If called by the current admin, adminship is transferred + * to the given address. + * Admin can be set to address(0). + * + * @param _admin Admin address to be set. + * + * @return success_ True on successful execution. + */ + function setAdmin( + address _admin + ) + external + onlyOwnerOrAdmin + returns (bool success_) + { + require( + _admin != owner, + "Admin address can't be the same as the owner address." + ); + + /* + * If the address does not change, the call is considered a success, + * but we don't need to emit an event as it did not actually change. + */ + if (admin != _admin) { + admin = _admin; + emit AdminAddressChanged(admin); + } + + success_ = true; + } + + /** + * @notice Sets worker and its expiration block height. + * Admin/Owner has the flexibility to extend/reduce worker + * expiration height. This way, a worker activation/deactivation + * can be controlled without adding/removing worker keys. + * + * @param _worker Worker address to be added. + * @param _expirationHeight Expiration block height of worker. + * + * @return remainingBlocks_ Remaining number of blocks for which worker is + * active. + */ + function setWorker( + address _worker, + uint256 _expirationHeight + ) + external + onlyOwnerOrAdmin + returns (uint256 remainingBlocks_) + { + require( + _worker != address(0), + "Worker address cannot be null." + ); + + require( + _expirationHeight > block.number, + "Expiration height must be in the future." + ); + + workers[_worker] = _expirationHeight; + remainingBlocks_ = _expirationHeight.sub(block.number); + + emit WorkerSet(_worker, _expirationHeight, remainingBlocks_); + } + + /** + * @notice Removes a worker. + * + * @param _worker Worker address to be removed. + * + * @return isUnset_ True if the worker existed else returns false. + */ + function unsetWorker( + address _worker + ) + external + onlyOwnerOrAdmin + returns (bool isUnset_) + { + isUnset_ = (workers[_worker] > 0); + + delete workers[_worker]; + + emit WorkerUnset(_worker, isUnset_); + } + + /** + * @notice Checks if an address is currently registered as an active worker. + * + * @param _worker Address to check. + * + * @return isWorker_ True if the worker is already added and expiration + * height is more than or equal to current block number. + * Returns false otherwise. + */ + function isWorker(address _worker) external view returns (bool isWorker_) + { + isWorker_ = workers[_worker] > block.number; + } + +} diff --git a/contracts/lib/OrganizationInterface.sol b/contracts/lib/OrganizationInterface.sol new file mode 100644 index 00000000..c5ed324e --- /dev/null +++ b/contracts/lib/OrganizationInterface.sol @@ -0,0 +1,97 @@ +pragma solidity ^0.5.0; + +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +/** + * @title OrganizationInterface provides methods to manage an organization. + */ +interface OrganizationInterface { + + /* Events */ + + /** Emitted when a current owner initiates a change of ownership. */ + event OwnershipTransferInitiated(address indexed proposedOwner); + + /** Emitted when a new owner accepts the ownership transfer. */ + event OwnershipTransferCompleted(address newOwner); + + /** Emitted whenever an owner or admin changes the address of the admin. */ + event AdminAddressChanged(address indexed newAdmin); + + /** Emitted when a worker address was set. */ + event WorkerSet( + address indexed worker, + uint256 expirationHeight, + uint256 remainingHeight + ); + + /** Emitted when a worker address is deleted from the contract. */ + event WorkerUnset(address worker, bool wasSet); + + + /* External Functions */ + + /** + * @notice Proposes a new owner of this contract. Ownership will not be + * transferred until the new, proposed owner accepts the proposal. + * Allows resetting of proposed owner to address(0). + * + * @param _proposedOwner Proposed owner address. + * + * @return success_ True on successful execution. + */ + function initiateOwnershipTransfer(address _proposedOwner) + external + returns (bool success_); + + /** + * @notice Complete ownership transfer to proposed owner. + * + * @return success_ True on successful execution. + */ + function completeOwnershipTransfer() external returns (bool success_); + + /** + * @notice Sets admin address. + * + * @param _admin Admin address to be set. + * + * @return success_ True on successful execution. + */ + function setAdmin(address _admin) external returns (bool success_); + + /** + * @notice Sets worker and its expiration block height. + * + * @param _worker Worker address to be added. + * @param _expirationHeight Expiration block height of the given worker. + * + * @return remainingBlocks_ Remaining number of blocks for which worker is + * active. + */ + function setWorker(address _worker, uint256 _expirationHeight) + external + returns (uint256 remainingBlocks_); + + /** + * @notice Removes a worker. + * + * @param _worker Worker address to be removed. + * + * @return isUnset_ True if the worker existed else returns false. + */ + function unsetWorker(address _worker) external returns (bool isUnset_); +} diff --git a/package-lock.json b/package-lock.json index 97bc9a57..e94e176a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "integrity": "sha512-y2OKSEW4gf2838Eavc56vQY9V46zaXkf3Jl1WpTfUBbzAVrXSr4JRZAAWv55Tv9s5WNz1rVgBgz5d2aJIL1QCg==", "dev": true, "requires": { - "web3": "0.18.4" + "web3": "^0.18.4" }, "dependencies": { "web3": { @@ -32,10 +32,10 @@ "dev": true, "requires": { "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "crypto-js": "3.1.8", - "utf8": "2.1.2", - "xhr2": "0.1.4", - "xmlhttprequest": "1.8.0" + "crypto-js": "^3.1.4", + "utf8": "^2.1.1", + "xhr2": "*", + "xmlhttprequest": "*" } } } @@ -46,7 +46,7 @@ "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "dev": true, "requires": { - "mime-types": "2.1.20", + "mime-types": "~2.1.18", "negotiator": "0.6.1" } }, @@ -62,10 +62,10 @@ "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "amdefine": { @@ -93,7 +93,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "array-flatten": { @@ -108,7 +108,7 @@ "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "dev": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": "~2.1.0" } }, "asn1.js": { @@ -117,9 +117,9 @@ "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "requires": { - "bn.js": "4.11.8", - "inherits": "2.0.1", - "minimalistic-assert": "1.0.1" + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "assert": { @@ -139,7 +139,7 @@ }, "async": { "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, @@ -186,11 +186,12 @@ "dev": true, "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "bignumber.js": { "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "from": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", "dev": true }, "bindings": { @@ -205,8 +206,8 @@ "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "dev": true, "requires": { - "readable-stream": "2.3.6", - "safe-buffer": "5.1.2" + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" } }, "block-stream": { @@ -215,7 +216,7 @@ "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "dev": true, "requires": { - "inherits": "2.0.1" + "inherits": "~2.0.0" } }, "bluebird": { @@ -237,15 +238,15 @@ "dev": true, "requires": { "bytes": "3.0.0", - "content-type": "1.0.4", + "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "1.1.2", - "http-errors": "1.6.3", + "depd": "~1.1.2", + "http-errors": "~1.6.3", "iconv-lite": "0.4.23", - "on-finished": "2.3.0", + "on-finished": "~2.3.0", "qs": "6.5.2", "raw-body": "2.3.3", - "type-is": "1.6.16" + "type-is": "~1.6.16" }, "dependencies": { "debug": { @@ -265,7 +266,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -287,12 +288,12 @@ "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { - "buffer-xor": "1.0.3", - "cipher-base": "1.0.4", - "create-hash": "1.2.0", - "evp_bytestokey": "1.0.3", - "inherits": "2.0.1", - "safe-buffer": "5.1.2" + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "browserify-cipher": { @@ -301,9 +302,9 @@ "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "dev": true, "requires": { - "browserify-aes": "1.2.0", - "browserify-des": "1.0.2", - "evp_bytestokey": "1.0.3" + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" } }, "browserify-des": { @@ -312,10 +313,10 @@ "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", "dev": true, "requires": { - "cipher-base": "1.0.4", - "des.js": "1.0.0", - "inherits": "2.0.1", - "safe-buffer": "5.1.2" + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" } }, "browserify-rsa": { @@ -324,8 +325,8 @@ "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { - "bn.js": "4.11.8", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" } }, "browserify-sha3": { @@ -334,7 +335,7 @@ "integrity": "sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE=", "dev": true, "requires": { - "js-sha3": "0.3.1" + "js-sha3": "^0.3.1" } }, "browserify-sign": { @@ -343,13 +344,13 @@ "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", "dev": true, "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "elliptic": "6.4.1", - "inherits": "2.0.1", - "parse-asn1": "5.1.1" + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" } }, "buffer": { @@ -358,8 +359,8 @@ "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", "dev": true, "requires": { - "base64-js": "1.3.0", - "ieee754": "1.1.12" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" } }, "buffer-alloc": { @@ -368,8 +369,8 @@ "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", "dev": true, "requires": { - "buffer-alloc-unsafe": "1.1.0", - "buffer-fill": "1.0.0" + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" } }, "buffer-alloc-unsafe": { @@ -438,8 +439,8 @@ "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { - "inherits": "2.0.1", - "safe-buffer": "5.1.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "cliui": { @@ -448,9 +449,9 @@ "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" } }, "co": { @@ -471,7 +472,7 @@ "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "dev": true, "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "commander": { @@ -528,8 +529,8 @@ "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", "dev": true, "requires": { - "object-assign": "4.1.1", - "vary": "1.1.2" + "object-assign": "^4", + "vary": "^1" } }, "create-ecdh": { @@ -538,8 +539,8 @@ "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", "dev": true, "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.1" + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" } }, "create-hash": { @@ -548,11 +549,11 @@ "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { - "cipher-base": "1.0.4", - "inherits": "2.0.1", - "md5.js": "1.3.4", - "ripemd160": "2.0.2", - "sha.js": "2.4.11" + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" } }, "create-hmac": { @@ -561,12 +562,12 @@ "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { - "cipher-base": "1.0.4", - "create-hash": "1.2.0", - "inherits": "2.0.1", - "ripemd160": "2.0.2", - "safe-buffer": "5.1.2", - "sha.js": "2.4.11" + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, "cross-spawn": { @@ -575,9 +576,9 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "4.1.3", - "shebang-command": "1.2.0", - "which": "1.3.1" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "crypto-browserify": { @@ -586,17 +587,17 @@ "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, "requires": { - "browserify-cipher": "1.0.1", - "browserify-sign": "4.0.4", - "create-ecdh": "4.0.3", - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "diffie-hellman": "5.0.3", - "inherits": "2.0.1", - "pbkdf2": "3.0.16", - "public-encrypt": "4.0.2", - "randombytes": "2.0.6", - "randomfill": "1.0.4" + "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": { @@ -611,7 +612,7 @@ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "death": { @@ -647,14 +648,14 @@ "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", "dev": true, "requires": { - "decompress-tar": "4.1.1", - "decompress-tarbz2": "4.1.1", - "decompress-targz": "4.1.1", - "decompress-unzip": "4.0.1", - "graceful-fs": "4.1.11", - "make-dir": "1.3.0", - "pify": "2.3.0", - "strip-dirs": "2.1.0" + "decompress-tar": "^4.0.0", + "decompress-tarbz2": "^4.0.0", + "decompress-targz": "^4.0.0", + "decompress-unzip": "^4.0.1", + "graceful-fs": "^4.1.10", + "make-dir": "^1.0.0", + "pify": "^2.3.0", + "strip-dirs": "^2.0.0" } }, "decompress-response": { @@ -663,7 +664,7 @@ "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "dev": true, "requires": { - "mimic-response": "1.0.1" + "mimic-response": "^1.0.0" } }, "decompress-tar": { @@ -672,9 +673,9 @@ "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "dev": true, "requires": { - "file-type": "5.2.0", - "is-stream": "1.1.0", - "tar-stream": "1.6.2" + "file-type": "^5.2.0", + "is-stream": "^1.1.0", + "tar-stream": "^1.5.2" } }, "decompress-tarbz2": { @@ -683,11 +684,11 @@ "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", "dev": true, "requires": { - "decompress-tar": "4.1.1", - "file-type": "6.2.0", - "is-stream": "1.1.0", - "seek-bzip": "1.0.5", - "unbzip2-stream": "1.3.0" + "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": { @@ -704,9 +705,9 @@ "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", "dev": true, "requires": { - "decompress-tar": "4.1.1", - "file-type": "5.2.0", - "is-stream": "1.1.0" + "decompress-tar": "^4.1.1", + "file-type": "^5.2.0", + "is-stream": "^1.1.0" } }, "decompress-unzip": { @@ -715,10 +716,10 @@ "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", "dev": true, "requires": { - "file-type": "3.9.0", - "get-stream": "2.3.1", - "pify": "2.3.0", - "yauzl": "2.10.0" + "file-type": "^3.8.0", + "get-stream": "^2.2.0", + "pify": "^2.3.0", + "yauzl": "^2.4.2" }, "dependencies": { "file-type": { @@ -733,8 +734,8 @@ "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", "dev": true, "requires": { - "object-assign": "4.1.1", - "pinkie-promise": "2.0.1" + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" } } } @@ -763,8 +764,8 @@ "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", "dev": true, "requires": { - "inherits": "2.0.1", - "minimalistic-assert": "1.0.1" + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "destroy": { @@ -785,9 +786,9 @@ "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { - "bn.js": "4.11.8", - "miller-rabin": "4.0.1", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" } }, "dom-walk": { @@ -809,8 +810,8 @@ "dev": true, "optional": true, "requires": { - "jsbn": "0.1.1", - "safer-buffer": "2.1.2" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "ee-first": { @@ -825,13 +826,13 @@ "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", "dev": true, "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0", - "hash.js": "1.1.5", - "hmac-drbg": "1.0.1", - "inherits": "2.0.1", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" } }, "encodeurl": { @@ -846,7 +847,7 @@ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "error-ex": { @@ -855,7 +856,7 @@ "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "escape-html": { @@ -876,11 +877,11 @@ "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "dev": true, "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.2.0" + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" }, "dependencies": { "source-map": { @@ -890,7 +891,7 @@ "dev": true, "optional": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -925,8 +926,8 @@ "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", "dev": true, "requires": { - "idna-uts46-hx": "2.3.1", - "js-sha3": "0.5.7" + "idna-uts46-hx": "^2.3.1", + "js-sha3": "^0.5.7" }, "dependencies": { "js-sha3": { @@ -943,13 +944,13 @@ "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", "dev": true, "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.1", - "keccakjs": "0.2.1", - "nano-json-stream-parser": "0.1.2", - "servify": "0.1.12", - "ws": "3.3.3", - "xhr-request-promise": "0.1.2" + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "keccakjs": "^0.2.1", + "nano-json-stream-parser": "^0.1.2", + "servify": "^0.1.12", + "ws": "^3.0.0", + "xhr-request-promise": "^0.1.2" } }, "ethereumjs-testrpc-sc": { @@ -958,7 +959,7 @@ "integrity": "sha512-iv2qiGBFgk9mn5Nq2enX8dG5WQ7Lk+FCqpnxfPfH4Ns8KLPwttmNOy264nh3SXDJJvcQwz/XnlLteDQVILotbg==", "dev": true, "requires": { - "source-map-support": "0.5.9" + "source-map-support": "^0.5.3" } }, "ethers": { @@ -967,9 +968,9 @@ "integrity": "sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw==", "dev": true, "requires": { - "@types/node": "10.10.3", + "@types/node": "^10.3.2", "aes-js": "3.0.0", - "bn.js": "4.11.8", + "bn.js": "^4.4.0", "elliptic": "6.3.3", "hash.js": "1.1.3", "js-sha3": "0.5.7", @@ -985,10 +986,10 @@ "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", "dev": true, "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0", - "hash.js": "1.1.3", - "inherits": "2.0.1" + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" } }, "hash.js": { @@ -997,8 +998,8 @@ "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "dev": true, "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" }, "dependencies": { "inherits": { @@ -1023,7 +1024,7 @@ }, "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=", "dev": true } @@ -1059,8 +1060,8 @@ "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { - "md5.js": "1.3.4", - "safe-buffer": "5.1.2" + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" } }, "execa": { @@ -1069,13 +1070,13 @@ "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "express": { @@ -1084,36 +1085,36 @@ "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", "dev": true, "requires": { - "accepts": "1.3.5", + "accepts": "~1.3.5", "array-flatten": "1.1.1", "body-parser": "1.18.2", "content-disposition": "0.5.2", - "content-type": "1.0.4", + "content-type": "~1.0.4", "cookie": "0.3.1", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "1.1.2", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "finalhandler": "1.1.1", "fresh": "0.5.2", "merge-descriptors": "1.0.1", - "methods": "1.1.2", - "on-finished": "2.3.0", - "parseurl": "1.3.2", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.4", + "proxy-addr": "~2.0.3", "qs": "6.5.1", - "range-parser": "1.2.0", + "range-parser": "~1.2.0", "safe-buffer": "5.1.1", "send": "0.16.2", "serve-static": "1.13.2", "setprototypeof": "1.1.0", - "statuses": "1.4.0", - "type-is": "1.6.16", + "statuses": "~1.4.0", + "type-is": "~1.6.16", "utils-merge": "1.0.1", - "vary": "1.1.2" + "vary": "~1.1.2" }, "dependencies": { "body-parser": { @@ -1123,15 +1124,15 @@ "dev": true, "requires": { "bytes": "3.0.0", - "content-type": "1.0.4", + "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "1.1.2", - "http-errors": "1.6.3", + "depd": "~1.1.1", + "http-errors": "~1.6.2", "iconv-lite": "0.4.19", - "on-finished": "2.3.0", + "on-finished": "~2.3.0", "qs": "6.5.1", "raw-body": "2.3.2", - "type-is": "1.6.16" + "type-is": "~1.6.15" } }, "debug": { @@ -1188,7 +1189,7 @@ "depd": "1.1.1", "inherits": "2.0.3", "setprototypeof": "1.0.3", - "statuses": "1.4.0" + "statuses": ">= 1.3.1 < 2" } }, "setprototypeof": { @@ -1249,7 +1250,7 @@ "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "dev": true, "requires": { - "pend": "1.2.0" + "pend": "~1.2.0" } }, "file-type": { @@ -1260,17 +1261,17 @@ }, "finalhandler": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "dev": true, "requires": { "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.4.0", - "unpipe": "1.0.0" + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" }, "dependencies": { "debug": { @@ -1296,8 +1297,8 @@ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "for-each": { @@ -1306,7 +1307,7 @@ "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "requires": { - "is-callable": "1.1.4" + "is-callable": "^1.1.3" } }, "forever-agent": { @@ -1321,9 +1322,9 @@ "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "dev": true, "requires": { - "asynckit": "0.4.0", + "asynckit": "^0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.20" + "mime-types": "^2.1.12" }, "dependencies": { "combined-stream": { @@ -1332,7 +1333,7 @@ "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } } } @@ -1357,15 +1358,15 @@ }, "fs-extra": { "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0", - "klaw": "1.3.1", - "path-is-absolute": "1.0.1", - "rimraf": "2.6.2" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" } }, "fs-promise": { @@ -1374,10 +1375,10 @@ "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", "dev": true, "requires": { - "any-promise": "1.3.0", - "fs-extra": "2.1.2", - "mz": "2.7.0", - "thenify-all": "1.6.0" + "any-promise": "^1.3.0", + "fs-extra": "^2.0.0", + "mz": "^2.6.0", + "thenify-all": "^1.6.0" }, "dependencies": { "fs-extra": { @@ -1386,8 +1387,8 @@ "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0" } } } @@ -1404,10 +1405,10 @@ "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.1", - "mkdirp": "0.5.1", - "rimraf": "2.6.2" + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" } }, "ganache-cli": { @@ -1416,7 +1417,7 @@ "integrity": "sha512-yXzteu4SIgUL31mnpm9j+x6dpHUw0p/nsRVkcySKq0w+1vDxH9jMErP1QhZAJuTVE6ni4nfvGSNkaQx5cD3jfg==", "dev": true, "requires": { - "source-map-support": "0.5.9" + "source-map-support": "^0.5.3" } }, "get-caller-file": { @@ -1437,7 +1438,7 @@ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "glob": { @@ -1446,11 +1447,11 @@ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "dev": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "global": { @@ -1459,8 +1460,8 @@ "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", "dev": true, "requires": { - "min-document": "2.19.0", - "process": "0.5.2" + "min-document": "^2.19.0", + "process": "~0.5.1" } }, "got": { @@ -1469,20 +1470,20 @@ "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", "dev": true, "requires": { - "decompress-response": "3.3.0", - "duplexer3": "0.1.4", - "get-stream": "3.0.0", - "is-plain-obj": "1.1.0", - "is-retry-allowed": "1.1.0", - "is-stream": "1.1.0", - "isurl": "1.0.0", - "lowercase-keys": "1.0.1", - "p-cancelable": "0.3.0", - "p-timeout": "1.2.1", - "safe-buffer": "5.1.2", - "timed-out": "4.0.1", - "url-parse-lax": "1.0.0", - "url-to-options": "1.0.1" + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" } }, "graceful-fs": { @@ -1509,10 +1510,10 @@ "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", "dev": true, "requires": { - "async": "2.6.1", - "optimist": "0.6.1", - "source-map": "0.6.1", - "uglify-js": "3.4.9" + "async": "^2.5.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" }, "dependencies": { "async": { @@ -1521,7 +1522,7 @@ "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "dev": true, "requires": { - "lodash": "4.17.11" + "lodash": "^4.17.10" } } } @@ -1538,8 +1539,8 @@ "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", "dev": true, "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^5.3.0", + "har-schema": "^2.0.0" } }, "has-flag": { @@ -1560,7 +1561,7 @@ "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", "dev": true, "requires": { - "has-symbol-support-x": "1.4.2" + "has-symbol-support-x": "^1.4.1" } }, "hash-base": { @@ -1569,8 +1570,8 @@ "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "dev": true, "requires": { - "inherits": "2.0.1", - "safe-buffer": "5.1.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "hash.js": { @@ -1579,8 +1580,8 @@ "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", "dev": true, "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" }, "dependencies": { "inherits": { @@ -1603,9 +1604,9 @@ "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { - "hash.js": "1.1.5", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, "hosted-git-info": { @@ -1620,10 +1621,10 @@ "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "dev": true, "requires": { - "depd": "1.1.2", + "depd": "~1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.0", - "statuses": "1.5.0" + "statuses": ">= 1.4.0 < 2" }, "dependencies": { "inherits": { @@ -1646,9 +1647,9 @@ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.2" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "iconv-lite": { @@ -1657,7 +1658,7 @@ "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "dev": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": ">= 2.1.2 < 3" } }, "idna-uts46-hx": { @@ -1689,8 +1690,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -1729,7 +1730,7 @@ "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, "is-callable": { @@ -1744,7 +1745,7 @@ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-function": { @@ -1825,20 +1826,20 @@ "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", "dev": true, "requires": { - "abbrev": "1.0.9", - "async": "1.5.2", - "escodegen": "1.8.1", - "esprima": "2.7.3", - "glob": "5.0.15", - "handlebars": "4.0.12", - "js-yaml": "3.12.0", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "once": "1.4.0", - "resolve": "1.1.7", - "supports-color": "3.2.3", - "which": "1.3.1", - "wordwrap": "1.0.0" + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" } }, "isurl": { @@ -1847,8 +1848,8 @@ "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "dev": true, "requires": { - "has-to-string-tag-x": "1.4.1", - "is-object": "1.0.1" + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" } }, "js-sha3": { @@ -1863,8 +1864,8 @@ "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" }, "dependencies": { "esprima": { @@ -1906,7 +1907,7 @@ "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } }, "jsprim": { @@ -1927,10 +1928,10 @@ "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "dev": true, "requires": { - "bindings": "1.3.0", - "inherits": "2.0.3", - "nan": "2.11.0", - "safe-buffer": "5.1.2" + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" }, "dependencies": { "inherits": { @@ -1947,8 +1948,8 @@ "integrity": "sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0=", "dev": true, "requires": { - "browserify-sha3": "0.0.1", - "sha3": "1.2.2" + "browserify-sha3": "^0.0.1", + "sha3": "^1.1.0" } }, "klaw": { @@ -1957,7 +1958,7 @@ "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.9" } }, "lcid": { @@ -1966,7 +1967,7 @@ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "levn": { @@ -1975,8 +1976,8 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "load-json-file": { @@ -1985,11 +1986,11 @@ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, "locate-path": { @@ -1998,8 +1999,8 @@ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" }, "dependencies": { "path-exists": { @@ -2034,8 +2035,8 @@ "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "dev": true, "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "make-dir": { @@ -2044,7 +2045,7 @@ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" }, "dependencies": { "pify": { @@ -2061,8 +2062,8 @@ "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", "dev": true, "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.1" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" } }, "media-typer": { @@ -2077,7 +2078,7 @@ "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "memorystream": { @@ -2104,8 +2105,8 @@ "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0" + "bn.js": "^4.0.0", + "brorand": "^1.0.1" } }, "mime": { @@ -2126,7 +2127,7 @@ "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", "dev": true, "requires": { - "mime-db": "1.36.0" + "mime-db": "~1.36.0" } }, "mimic-fn": { @@ -2147,7 +2148,7 @@ "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", "dev": true, "requires": { - "dom-walk": "0.1.1" + "dom-walk": "^0.1.0" } }, "minimalistic-assert": { @@ -2168,7 +2169,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -2200,7 +2201,7 @@ "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", "dev": true, "requires": { - "mkdirp": "0.5.1" + "mkdirp": "*" } }, "mocha": { @@ -2233,12 +2234,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "has-flag": { @@ -2253,7 +2254,7 @@ "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "^2.0.0" } } } @@ -2282,9 +2283,9 @@ "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "dev": true, "requires": { - "any-promise": "1.3.0", - "object-assign": "4.1.1", - "thenify-all": "1.6.0" + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" } }, "nan": { @@ -2311,7 +2312,7 @@ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1.0.9" + "abbrev": "1" } }, "normalize-package-data": { @@ -2320,10 +2321,10 @@ "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { - "hosted-git-info": "2.7.1", - "is-builtin-module": "1.0.0", - "semver": "5.5.1", - "validate-npm-package-license": "3.0.4" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "npm-run-path": { @@ -2332,7 +2333,7 @@ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { @@ -2377,7 +2378,7 @@ "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", "dev": true, "requires": { - "http-https": "1.0.0" + "http-https": "^1.0.0" } }, "on-finished": { @@ -2395,7 +2396,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "optimist": { @@ -2404,8 +2405,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" }, "dependencies": { "wordwrap": { @@ -2422,12 +2423,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "original-require": { @@ -2442,7 +2443,7 @@ "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "dev": true, "requires": { - "lcid": "1.0.0" + "lcid": "^1.0.0" } }, "p-cancelable": { @@ -2463,7 +2464,7 @@ "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -2472,7 +2473,7 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "1.3.0" + "p-limit": "^1.1.0" } }, "p-timeout": { @@ -2481,7 +2482,7 @@ "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", "dev": true, "requires": { - "p-finally": "1.0.0" + "p-finally": "^1.0.0" } }, "p-try": { @@ -2496,11 +2497,11 @@ "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "dev": true, "requires": { - "asn1.js": "4.10.1", - "browserify-aes": "1.2.0", - "create-hash": "1.2.0", - "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.16" + "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": { @@ -2509,7 +2510,7 @@ "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", "dev": true, "requires": { - "for-each": "0.3.3", + "for-each": "^0.3.2", "trim": "0.0.1" } }, @@ -2519,7 +2520,7 @@ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "1.3.2" + "error-ex": "^1.2.0" } }, "parseurl": { @@ -2534,7 +2535,7 @@ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-is-absolute": { @@ -2561,9 +2562,9 @@ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pbkdf2": { @@ -2572,11 +2573,11 @@ "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", "dev": true, "requires": { - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "ripemd160": "2.0.2", - "safe-buffer": "5.1.2", - "sha.js": "2.4.11" + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, "pegjs": { @@ -2615,7 +2616,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "prelude-ls": { @@ -2648,7 +2649,7 @@ "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", "dev": true, "requires": { - "forwarded": "0.1.2", + "forwarded": "~0.1.2", "ipaddr.js": "1.8.0" } }, @@ -2670,11 +2671,11 @@ "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", "dev": true, "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.2.0", - "parse-asn1": "5.1.1", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1" } }, "punycode": { @@ -2695,9 +2696,9 @@ "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "dev": true, "requires": { - "decode-uri-component": "0.2.0", - "object-assign": "4.1.1", - "strict-uri-encode": "1.1.0" + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" } }, "randombytes": { @@ -2706,7 +2707,7 @@ "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.1.0" } }, "randomfill": { @@ -2715,8 +2716,8 @@ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { - "randombytes": "2.0.6", - "safe-buffer": "5.1.2" + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" } }, "randomhex": { @@ -2749,9 +2750,9 @@ "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -2760,8 +2761,8 @@ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" } }, "readable-stream": { @@ -2770,13 +2771,13 @@ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" }, "dependencies": { "inherits": { @@ -2793,7 +2794,7 @@ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "resolve": "1.1.7" + "resolve": "^1.1.6" } }, "req-cwd": { @@ -2802,7 +2803,7 @@ "integrity": "sha1-DXOurpJm5penj3l2AZZ352rPD/8=", "dev": true, "requires": { - "req-from": "1.0.1" + "req-from": "^1.0.1" } }, "req-from": { @@ -2811,7 +2812,7 @@ "integrity": "sha1-v4HaUUeUfTLRO5R9wSpYrUWHNQ4=", "dev": true, "requires": { - "resolve-from": "2.0.0" + "resolve-from": "^2.0.0" } }, "request": { @@ -2820,26 +2821,26 @@ "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "dev": true, "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.8.0", - "caseless": "0.12.0", - "combined-stream": "1.0.7", - "extend": "3.0.2", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.1.0", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.20", - "oauth-sign": "0.9.0", - "performance-now": "2.1.0", - "qs": "6.5.2", - "safe-buffer": "5.1.2", - "tough-cookie": "2.4.3", - "tunnel-agent": "0.6.0", - "uuid": "3.3.2" + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" } }, "require-directory": { @@ -2878,7 +2879,7 @@ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { - "glob": "7.1.3" + "glob": "^7.0.5" }, "dependencies": { "glob": { @@ -2887,12 +2888,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } } } @@ -2903,8 +2904,8 @@ "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.1" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" } }, "rlp": { @@ -2913,7 +2914,7 @@ "integrity": "sha512-93U7IKH5j7nmXFVg19MeNBGzQW5uXW1pmCuKY8veeKIhYTE32C2d0mOegfiIAfXcHOKJjjPlJisn8iHDF5AezA==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.1.1" } }, "safe-buffer": { @@ -2934,7 +2935,7 @@ "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", "dev": true, "requires": { - "nan": "2.11.0" + "nan": "^2.0.8" } }, "scrypt-js": { @@ -2949,8 +2950,8 @@ "integrity": "sha1-r40UZbcemZARC+38WTuUeeA6ito=", "dev": true, "requires": { - "scrypt": "6.0.3", - "scryptsy": "1.2.1" + "scrypt": "^6.0.2", + "scryptsy": "^1.2.1" } }, "scryptsy": { @@ -2959,7 +2960,7 @@ "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", "dev": true, "requires": { - "pbkdf2": "3.0.16" + "pbkdf2": "^3.0.3" } }, "seek-bzip": { @@ -2968,7 +2969,7 @@ "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", "dev": true, "requires": { - "commander": "2.8.1" + "commander": "~2.8.1" }, "dependencies": { "commander": { @@ -2977,7 +2978,7 @@ "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "dev": true, "requires": { - "graceful-readlink": "1.0.1" + "graceful-readlink": ">= 1.0.0" } } } @@ -2995,18 +2996,18 @@ "dev": true, "requires": { "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.6.3", + "http-errors": "~1.6.2", "mime": "1.4.1", "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" }, "dependencies": { "debug": { @@ -3032,9 +3033,9 @@ "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "dev": true, "requires": { - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "parseurl": "1.3.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", "send": "0.16.2" } }, @@ -3044,11 +3045,11 @@ "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", "dev": true, "requires": { - "body-parser": "1.18.3", - "cors": "2.8.4", - "express": "4.16.3", - "request": "2.88.0", - "xhr": "2.5.0" + "body-parser": "^1.16.0", + "cors": "^2.8.1", + "express": "^4.14.0", + "request": "^2.79.0", + "xhr": "^2.3.3" } }, "set-blocking": { @@ -3075,8 +3076,8 @@ "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { - "inherits": "2.0.1", - "safe-buffer": "5.1.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "sha3": { @@ -3090,7 +3091,7 @@ "dependencies": { "nan": { "version": "2.10.0", - "resolved": "http://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "dev": true } @@ -3102,7 +3103,7 @@ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -3117,9 +3118,9 @@ "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", "dev": true, "requires": { - "glob": "7.1.3", - "interpret": "1.1.0", - "rechoir": "0.6.2" + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" }, "dependencies": { "glob": { @@ -3128,12 +3129,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } } } @@ -3156,9 +3157,9 @@ "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", "dev": true, "requires": { - "decompress-response": "3.3.0", - "once": "1.4.0", - "simple-concat": "1.0.0" + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" } }, "sol-explore": { @@ -3173,12 +3174,12 @@ "integrity": "sha512-mdLHDl9WeYrN+FIKcMc9PlPfnA9DG9ur5QpCDKcv6VC4RINAsTF4EMuXMZMKoQTvZhtLyJIVH/BZ+KU830Z8Xg==", "dev": true, "requires": { - "fs-extra": "0.30.0", - "keccak": "1.4.0", - "memorystream": "0.3.1", - "require-from-string": "2.0.2", - "semver": "5.5.1", - "yargs": "11.1.0" + "fs-extra": "^0.30.0", + "keccak": "^1.0.2", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "yargs": "^11.0.0" }, "dependencies": { "ansi-regex": { @@ -3199,9 +3200,9 @@ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } }, "find-up": { @@ -3210,7 +3211,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "is-fullwidth-code-point": { @@ -3225,9 +3226,9 @@ "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "dev": true, "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "string-width": { @@ -3236,8 +3237,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -3246,7 +3247,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "which-module": { @@ -3261,18 +3262,18 @@ "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", "dev": true, "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.3", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "9.0.2" + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" } }, "yargs-parser": { @@ -3281,7 +3282,7 @@ "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "dev": true, "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" } } } @@ -3292,16 +3293,16 @@ "integrity": "sha512-qikdsSi6+9XbfvwA0aI7HUVpF9fIFNqRWTw23M89GMDY+b6Gj0wWU9IngJS0fimoZIAdEp3bfChxvpfVcrUesg==", "dev": true, "requires": { - "death": "1.1.0", + "death": "^1.1.0", "ethereumjs-testrpc-sc": "6.1.6", - "istanbul": "0.4.5", - "keccakjs": "0.2.1", - "req-cwd": "1.0.1", - "shelljs": "0.7.8", - "sol-explore": "1.6.2", + "istanbul": "^0.4.5", + "keccakjs": "^0.2.1", + "req-cwd": "^1.0.1", + "shelljs": "^0.7.4", + "sol-explore": "^1.6.2", "solidity-parser-sc": "0.4.11", - "tree-kill": "1.2.0", - "web3": "0.18.4" + "tree-kill": "^1.2.0", + "web3": "^0.18.4" }, "dependencies": { "solidity-parser-sc": { @@ -3310,9 +3311,9 @@ "integrity": "sha512-1kV5iC7m3CtMDfmHaVNwz2saSGQVIuF16rIxU417Al38MVCWHMQQ5vT6cmLsNwDe60S74auobWij9vNawSeOyw==", "dev": true, "requires": { - "mocha": "4.1.0", - "pegjs": "0.10.0", - "yargs": "4.8.1" + "mocha": "^4.1.0", + "pegjs": "^0.10.0", + "yargs": "^4.6.0" } }, "web3": { @@ -3322,10 +3323,10 @@ "dev": true, "requires": { "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", - "crypto-js": "3.1.8", - "utf8": "2.1.2", - "xhr2": "0.1.4", - "xmlhttprequest": "1.8.0" + "crypto-js": "^3.1.4", + "utf8": "^2.1.1", + "xhr2": "*", + "xmlhttprequest": "*" } } } @@ -3336,9 +3337,9 @@ "integrity": "sha512-t7tvtR6KU6QfPYLMv1nlCh9DA8HYIu5tbjHpKu0fhGFZ1NuSp0KKDHfFHv07g6v1xgcuUY3rVqNFjZt5b9+5qA==", "dev": true, "requires": { - "mocha": "4.1.0", - "pegjs": "0.10.0", - "yargs": "10.1.2" + "mocha": "^4.0.1", + "pegjs": "^0.10.0", + "yargs": "^10.0.3" }, "dependencies": { "ansi-regex": { @@ -3359,9 +3360,9 @@ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } }, "find-up": { @@ -3370,7 +3371,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "is-fullwidth-code-point": { @@ -3385,9 +3386,9 @@ "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "dev": true, "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "string-width": { @@ -3396,8 +3397,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -3406,7 +3407,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "which-module": { @@ -3421,18 +3422,18 @@ "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", "dev": true, "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.3", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "8.1.0" + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^8.1.0" } }, "yargs-parser": { @@ -3441,7 +3442,7 @@ "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", "dev": true, "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" } } } @@ -3458,8 +3459,8 @@ "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", "dev": true, "requires": { - "buffer-from": "1.1.1", - "source-map": "0.6.1" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, "spdx-correct": { @@ -3468,8 +3469,8 @@ "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.1" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -3484,8 +3485,8 @@ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.1" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -3506,15 +3507,15 @@ "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", "dev": true, "requires": { - "asn1": "0.2.4", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.2", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.2", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "safer-buffer": "2.1.2", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" } }, "statuses": { @@ -3535,9 +3536,9 @@ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { @@ -3546,16 +3547,16 @@ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -3564,7 +3565,7 @@ "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } }, "strip-dirs": { @@ -3573,7 +3574,7 @@ "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", "dev": true, "requires": { - "is-natural-number": "4.0.1" + "is-natural-number": "^4.0.1" } }, "strip-eof": { @@ -3597,7 +3598,7 @@ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } }, "swarm-js": { @@ -3606,19 +3607,19 @@ "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", "dev": true, "requires": { - "bluebird": "3.5.2", - "buffer": "5.2.1", - "decompress": "4.2.0", - "eth-lib": "0.1.27", - "fs-extra": "2.1.2", - "fs-promise": "2.0.3", - "got": "7.1.0", - "mime-types": "2.1.20", - "mkdirp-promise": "5.0.1", - "mock-fs": "4.7.0", - "setimmediate": "1.0.5", - "tar.gz": "1.0.7", - "xhr-request-promise": "0.1.2" + "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": { @@ -3627,8 +3628,8 @@ "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0" } } } @@ -3639,9 +3640,9 @@ "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.1" + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" } }, "tar-stream": { @@ -3650,13 +3651,13 @@ "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", "dev": true, "requires": { - "bl": "1.2.2", - "buffer-alloc": "1.2.0", - "end-of-stream": "1.4.1", - "fs-constants": "1.0.0", - "readable-stream": "2.3.6", - "to-buffer": "1.1.1", - "xtend": "4.0.1" + "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": { @@ -3665,11 +3666,11 @@ "integrity": "sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg==", "dev": true, "requires": { - "bluebird": "2.11.0", - "commander": "2.17.1", - "fstream": "1.0.11", - "mout": "0.11.1", - "tar": "2.2.1" + "bluebird": "^2.9.34", + "commander": "^2.8.1", + "fstream": "^1.0.8", + "mout": "^0.11.0", + "tar": "^2.1.1" }, "dependencies": { "bluebird": { @@ -3686,7 +3687,7 @@ "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", "dev": true, "requires": { - "any-promise": "1.3.0" + "any-promise": "^1.0.0" } }, "thenify-all": { @@ -3695,7 +3696,7 @@ "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", "dev": true, "requires": { - "thenify": "3.3.0" + "thenify": ">= 3.1.0 < 4" } }, "through": { @@ -3722,8 +3723,8 @@ "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { - "psl": "1.1.29", - "punycode": "1.4.1" + "psl": "^1.1.24", + "punycode": "^1.4.1" } }, "tree-kill": { @@ -3744,9 +3745,9 @@ "integrity": "sha512-D15MsJeKWRNxbx2Vmy50gH8z4gjBYecJIUADBBBL593hkVnhZ1ADgkIujCvvrbD6Pj69Vg5Ky/nJXl7M9TCjsg==", "dev": true, "requires": { - "mocha": "4.1.0", + "mocha": "^4.1.0", "original-require": "1.0.1", - "solc": "0.5.0" + "solc": "^0.5.0" } }, "tunnel-agent": { @@ -3755,7 +3756,7 @@ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -3771,7 +3772,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "type-is": { @@ -3781,7 +3782,7 @@ "dev": true, "requires": { "media-typer": "0.3.0", - "mime-types": "2.1.20" + "mime-types": "~2.1.18" } }, "typedarray-to-buffer": { @@ -3790,7 +3791,7 @@ "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, "requires": { - "is-typedarray": "1.0.0" + "is-typedarray": "^1.0.0" } }, "uglify-js": { @@ -3800,8 +3801,8 @@ "dev": true, "optional": true, "requires": { - "commander": "2.17.1", - "source-map": "0.6.1" + "commander": "~2.17.1", + "source-map": "~0.6.1" } }, "ultron": { @@ -3816,8 +3817,8 @@ "integrity": "sha512-kE2WkurNnPUMcryNioS68DDbhoPB8Qxsd8btHSj+sd5Pjh2GsjmeHLzMSqV9HHziAo8FzVxVCJl9ZYhk7yY1pA==", "dev": true, "requires": { - "buffer": "3.6.0", - "through": "2.3.8" + "buffer": "^3.0.1", + "through": "^2.3.6" }, "dependencies": { "base64-js": { @@ -3833,8 +3834,8 @@ "dev": true, "requires": { "base64-js": "0.0.8", - "ieee754": "1.1.12", - "isarray": "1.0.0" + "ieee754": "^1.1.4", + "isarray": "^1.0.0" } } } @@ -3857,7 +3858,7 @@ "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "dev": true, "requires": { - "prepend-http": "1.0.4" + "prepend-http": "^1.0.1" } }, "url-set-query": { @@ -3911,8 +3912,8 @@ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "vary": { @@ -3927,9 +3928,9 @@ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" } }, "web3": { @@ -4084,14 +4085,14 @@ "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", "dev": true, "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.1", - "xhr-request-promise": "0.1.2" + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" } }, "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=", "dev": true } @@ -4246,12 +4247,13 @@ }, "websocket": { "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", + "from": "websocket@git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", "dev": true, "requires": { - "debug": "2.6.9", - "nan": "2.11.0", - "typedarray-to-buffer": "3.1.5", - "yaeti": "0.0.6" + "debug": "^2.2.0", + "nan": "^2.3.3", + "typedarray-to-buffer": "^3.1.2", + "yaeti": "^0.0.6" }, "dependencies": { "debug": { @@ -4271,7 +4273,7 @@ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -4298,8 +4300,8 @@ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" } }, "wrappy": { @@ -4314,9 +4316,9 @@ "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "dev": true, "requires": { - "async-limiter": "1.0.0", - "safe-buffer": "5.1.2", - "ultron": "1.1.1" + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" } }, "xhr": { @@ -4325,10 +4327,10 @@ "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", "dev": true, "requires": { - "global": "4.3.2", - "is-function": "1.0.1", - "parse-headers": "2.0.1", - "xtend": "4.0.1" + "global": "~4.3.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" } }, "xhr-request": { @@ -4337,13 +4339,13 @@ "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", "dev": true, "requires": { - "buffer-to-arraybuffer": "0.0.5", - "object-assign": "4.1.1", - "query-string": "5.1.1", - "simple-get": "2.8.1", - "timed-out": "4.0.1", - "url-set-query": "1.0.0", - "xhr": "2.5.0" + "buffer-to-arraybuffer": "^0.0.5", + "object-assign": "^4.1.1", + "query-string": "^5.0.1", + "simple-get": "^2.7.0", + "timed-out": "^4.0.1", + "url-set-query": "^1.0.0", + "xhr": "^2.0.4" } }, "xhr-request-promise": { @@ -4352,7 +4354,7 @@ "integrity": "sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0=", "dev": true, "requires": { - "xhr-request": "1.1.0" + "xhr-request": "^1.0.1" } }, "xhr2": { @@ -4367,7 +4369,7 @@ "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", "dev": true, "requires": { - "cookiejar": "2.1.2" + "cookiejar": "^2.1.1" } }, "xmlhttprequest": { @@ -4406,20 +4408,20 @@ "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", "dev": true, "requires": { - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.3", - "lodash.assign": "4.2.0", - "os-locale": "1.4.0", - "read-pkg-up": "1.0.1", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "1.0.2", - "which-module": "1.0.0", - "window-size": "0.2.0", - "y18n": "3.2.1", - "yargs-parser": "2.4.1" + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" } }, "yargs-parser": { @@ -4428,8 +4430,8 @@ "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", "dev": true, "requires": { - "camelcase": "3.0.0", - "lodash.assign": "4.2.0" + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" } }, "yauzl": { @@ -4438,8 +4440,8 @@ "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", "dev": true, "requires": { - "buffer-crc32": "0.2.13", - "fd-slicer": "1.1.0" + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" } } } diff --git a/test/lib/organization/complete_ownership_transfer.js b/test/lib/organization/complete_ownership_transfer.js new file mode 100644 index 00000000..372fed66 --- /dev/null +++ b/test/lib/organization/complete_ownership_transfer.js @@ -0,0 +1,83 @@ +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the 'License'); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an 'AS IS' BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const Utils = require('../../test_lib/utils.js'); +const EventsDecoder = require('../../test_lib/event_decoder.js'); + +const Organization = artifacts.require('Organization'); + +contract('Organization.completeOwnershipTransfer()', async (accounts) => { + + let owner = accounts[0]; + let proposedOwner = accounts[1]; + let organization = null; + + beforeEach(async function () { + organization = await Organization.new({ from: owner }); + await organization.initiateOwnershipTransfer( + proposedOwner, + { from: owner }, + ) + }); + + it('reverts when caller is not proposed owner', async () => { + await Utils.expectRevert( + organization.completeOwnershipTransfer({ from: owner }), + 'Caller is not proposed owner address.', + ); + }); + + it('should pass when caller is proposed owner', async () => { + let response = await organization.completeOwnershipTransfer.call( + { from: proposedOwner } + ); + assert.strictEqual( + response, + true, + 'The ownership completion should return true.', + ); + + await organization.completeOwnershipTransfer({ from: proposedOwner }); + + assert.strictEqual( + await organization.owner.call(), + proposedOwner, + 'The owner must now be the proposed owner.', + ); + assert.strictEqual( + await organization.proposedOwner.call(), + '0x0000000000000000000000000000000000000000', + 'The proposed owner must be 0 after it became the owner.', + ); + }); + + it('verifies emitting of OwnershipTransferCompleted event', async () => { + const transaction = await organization.completeOwnershipTransfer( + { from: proposedOwner }, + ); + + const events = EventsDecoder.getEvents( + transaction, + organization, + ); + + assert.strictEqual( + events.OwnershipTransferCompleted.newOwner, + proposedOwner, + 'The emitted event does not record the new owner.', + ); + + }); + +}); diff --git a/test/lib/organization/constructor.js b/test/lib/organization/constructor.js new file mode 100644 index 00000000..be42616e --- /dev/null +++ b/test/lib/organization/constructor.js @@ -0,0 +1,30 @@ +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const Organization = artifacts.require('Organization'); + +contract('Organization.constructor()', async (accounts) => { + + let owner = accounts[0]; + + it('checks that organization owner is set to creator', async () => { + organization = await Organization.new({ from: owner }); + let setOwner = await organization.owner.call(); + assert.strictEqual( + setOwner, + owner, + 'The initial owner of an organization must be its creator.' + ); + }); +}); diff --git a/test/lib/organization/initiate_ownership_transfer.js b/test/lib/organization/initiate_ownership_transfer.js new file mode 100644 index 00000000..817cd9d8 --- /dev/null +++ b/test/lib/organization/initiate_ownership_transfer.js @@ -0,0 +1,103 @@ +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const Utils = require('../../test_lib/utils.js'); +const EventsDecoder = require('../../test_lib/event_decoder.js'); + +const Organization = artifacts.require('Organization'); + +contract('Organization.initiateOwnershipTransfer()', async (accounts) => { + + let owner = accounts[0]; + let proposedOwner = accounts[1]; + let organization = null; + + beforeEach(async function () { + organization = await Organization.new({ from: owner }); + }); + + it('reverts when caller is not owner', async () => { + await Utils.expectRevert( + organization.initiateOwnershipTransfer( + proposedOwner, + { from: proposedOwner }, + ), + 'Only owner is allowed to call.', + ); + }); + + it('reverts when proposed owner is same as owner', async () => { + await Utils.expectRevert( + organization.initiateOwnershipTransfer( + owner, + { from: owner }, + ), + 'Proposed owner address can\'t be current owner address.', + ); + }); + + it('should pass when valid proposed owner is passed', async () => { + let response = await organization.initiateOwnershipTransfer.call( + proposedOwner, + { from: owner }, + ); + assert.strictEqual( + response, + true, + 'The ownership initiation should return true.', + ); + + await organization.initiateOwnershipTransfer( + proposedOwner, + { from: owner }, + ); + + assert.strictEqual( + await organization.proposedOwner.call(), + proposedOwner, + 'Must accept a valid owner proposal.', + ); + }); + + it('should pass when proposed address is 0', async () => { + await organization.initiateOwnershipTransfer( + '0x0000000000000000000000000000000000000000', + { from: owner }, + ); + assert.strictEqual( + await organization.proposedOwner.call(), + '0x0000000000000000000000000000000000000000', + 'Proposed 0-address must be accepted.' + ); + }); + + it('verifies emitting of OwnershipTransferInitiated event', async () => { + const transaction = await organization.initiateOwnershipTransfer( + proposedOwner, + { from: owner }, + ); + const events = EventsDecoder.getEvents( + transaction, + organization, + ); + + assert.strictEqual( + events.OwnershipTransferInitiated.proposedOwner, + proposedOwner, + 'The event does not emit the correct proposed owner.', + ); + + }); + +}); diff --git a/test/lib/organization/is_worker.js b/test/lib/organization/is_worker.js new file mode 100644 index 00000000..1d0bc9dd --- /dev/null +++ b/test/lib/organization/is_worker.js @@ -0,0 +1,80 @@ +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const Utils = require('../../test_lib/utils.js'); +const Organization = artifacts.require('Organization'); + +contract('Organization.isWorker()', async (accounts) => { + + let owner = accounts[0]; + let worker = accounts[0]; + let organization = null; + + beforeEach(async function () { + organization = await Organization.new({ from: owner }); + }); + + it('should return false if the worker wasn\'t set', async () => { + assert.strictEqual( + await organization.isWorker.call(worker), + false, + 'An address that was never registered should not return as valid', + ); + }); + + it('should return false if the worker has expired', async () => { + let deltaExpirationHeight = 2; + let blockNumber = await web3.eth.getBlockNumber(); + let expirationHeight = blockNumber + deltaExpirationHeight; + await organization.setWorker(worker, expirationHeight, { from: owner }); + + // Dummy Transaction to increase block number. + for (let i = 0; i < deltaExpirationHeight; i++) { + await Utils.advanceBlock(); + } + assert.strictEqual( + await organization.isWorker.call(worker), + false, + 'The worker should not be active anymore after it expired.', + ); + }); + + it('Checks for added worker, isWorker returns true.', async () => { + let deltaExpirationHeight = 15; + let blockNumber = await web3.eth.getBlockNumber(); + // `+ 1` as we are now one block further then what getBlockNumber returned. + let expirationHeight = blockNumber + deltaExpirationHeight + 1; + await organization.setWorker(worker, expirationHeight, { from: owner }); + + /* + * Check for all relevant blocks. Minus one, because expiration must be + * less than current block height. + */ + for (let i = 0; i < (deltaExpirationHeight - 1); i++) { + assert.strictEqual( + await organization.isWorker.call(worker), + true, + 'The worker should be active at this height.', + ); + Utils.advanceBlock(); + } + + assert.strictEqual( + await organization.isWorker.call(worker), + false, + 'The worker should now be expired.', + ); + }); + +}); diff --git a/test/lib/organization/set_admin.js b/test/lib/organization/set_admin.js new file mode 100644 index 00000000..1c60d712 --- /dev/null +++ b/test/lib/organization/set_admin.js @@ -0,0 +1,142 @@ +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const Utils = require('../../test_lib/utils.js'); +const EventsDecoder = require('../../test_lib/event_decoder'); + +const Organization = artifacts.require('Organization'); + +contract('Organization.setAdmin()', async (accounts) => { + + let owner = accounts[0]; + let admin = accounts[1]; + let organization = null; + + beforeEach(async function () { + organization = await Organization.new({ from: owner }); + }); + + it('reverts when caller is not owner/admin', async () => { + + await Utils.expectRevert( + organization.setAdmin( + admin, + { from: accounts[2] }, + ), + 'Only owner and admin are allowed to call this method.', + ); + }); + + it('reverts when admin is same as owner', async () => { + + await Utils.expectRevert( + organization.setAdmin( + owner, + { from: owner }, + ), + 'Admin address can\'t be the same as the owner address.', + ); + + }); + + it('should pass when valid admin is passed by owner', async () => { + const admin = accounts[2]; + await organization.setAdmin( + admin, + { from: owner }, + ); + + assert.strictEqual( + await organization.admin.call(), + admin, + 'The organization should now have the right admin set.', + ); + }); + + it('should pass when valid admin is passed by admin', async () => { + await organization.setAdmin( + admin, + { from: owner }, + ); + let newAdmin = accounts[3]; + await organization.setAdmin( + newAdmin, + { from: admin }, + ); + + assert.strictEqual( + await organization.admin.call(), + newAdmin, + 'The admin should now be the newly set admin.', + ); + }); + + it('should pass when admin address is 0x', async () => { + await organization.setAdmin( + '0x0000000000000000000000000000000000000000', + { from: owner }, + ); + + assert.strictEqual( + await organization.admin.call(), + '0x0000000000000000000000000000000000000000', + 'The admin address must be set to 0x correctly.' + ); + }); + + it('verifies emitting of AdminAddressChanged event', async () => { + const transaction = await organization.setAdmin( + admin, + { from: owner }, + ); + + const events = EventsDecoder.getEvents( + transaction, + organization, + ); + + assert.strictEqual( + events.AdminAddressChanged.newAdmin, + admin, + 'The event should emit the correct admin address.' + ); + + }); + + it('Should not emit an event when the address did not change', async () => { + await organization.setAdmin(admin, { from: owner }); + + /* + * The address was already set before. This should pass, but not emit an + * event. + */ + const transaction = await organization.setAdmin( + admin, + { from: owner }, + ); + + const events = EventsDecoder.getEvents( + transaction, + organization, + ); + + assert.strictEqual( + events.AdminAddressChanged, + undefined, + 'The event should not be emitted when the address does not change.' + ); + + }); + +}); diff --git a/test/lib/organization/set_worker.js b/test/lib/organization/set_worker.js new file mode 100644 index 00000000..c1e9e885 --- /dev/null +++ b/test/lib/organization/set_worker.js @@ -0,0 +1,147 @@ +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const web3 = require('../../test_lib/web3.js'); + +const Utils = require('../../test_lib/utils.js'); +const EventsDecoder = require('../../test_lib/event_decoder.js'); + +const Organization = artifacts.require('Organization'); + +contract('Organization.setWorker()', async (accounts) => { + + let owner = accounts[0]; + let admin = accounts[1]; + let worker = accounts[2]; + let expirationHeightDelta = 10; + + let organization = null; + let expirationHeight = 0; + + beforeEach(async function () { + organization = await Organization.new({ from: owner }); + await organization.setAdmin(admin, { from: owner }); + expirationHeight = (await web3.eth.getBlockNumber()) + 10; + }); + + it('reverts when caller is not owner/admin', async () => { + + await Utils.expectRevert( + organization.setWorker( + worker, + expirationHeight, + { from: accounts[3] }, + ), + 'Only owner and admin are allowed to call this method.', + ); + }); + + it('reverts when worker address is null', async () => { + + await Utils.expectRevert( + organization.setWorker( + '0x0000000000000000000000000000000000000000', + expirationHeight, + { from: owner }, + ), + 'Worker address cannot be null.', + ); + + }); + + it('reverts when expiration height is expired', async () => { + + const blockNumber = await web3.eth.getBlockNumber(); + const expirationHeight = blockNumber + expirationHeightDelta; + for (let i = 0; i < expirationHeightDelta; i++) { + await Utils.advanceBlock(); + } + + // Checking that worker key has expired. + assert.strictEqual( + (await organization.isWorker.call(worker)), + false, + 'The worker was expected to be expired.', + ); + await Utils.expectRevert( + organization.setWorker( + worker, + expirationHeight, + { from: owner }, + ), + 'Expiration height must be in the future.', + ); + + }); + + it('should pass when owner adds a worker with valid expiration height', async () => { + + await organization.setWorker( + worker, + expirationHeight, + { from: owner }, + ); + assert( + (await organization.workers.call(worker)).eqn(expirationHeight), + 'The recorded expiration height should equal the given one.', + ); + + }); + + it('should pass when admin adds a worker with valid expiration height', async () => { + await organization.setWorker( + worker, + expirationHeight, + { from: admin }, + ); + assert( + (await organization.workers.call(worker)).eqn(expirationHeight), + 'The recorded expiration height should equal the given one.', + ); + + }); + + it('verifies emitting of WorkerSet event', async () => { + + const transaction = await organization.setWorker( + worker, + expirationHeight, + { from: owner }, + ); + + const events = EventsDecoder.getEvents( + transaction, + organization, + ); + + let currentBlockNumber = await web3.eth.getBlockNumber(); + let remainingHeight = expirationHeight - currentBlockNumber; + + assert.strictEqual( + events.WorkerSet.worker, + worker, + 'Event must emit correct worker.', + ); + assert( + events.WorkerSet.expirationHeight.eqn(expirationHeight), + 'Event must emit correct expiration height.', + ); + assert( + events.WorkerSet.remainingHeight.eqn(remainingHeight), + 'Event must emit correct remaining height.', + ); + + }); + +}); diff --git a/test/lib/organization/unset_worker.js b/test/lib/organization/unset_worker.js new file mode 100644 index 00000000..9b82a7b5 --- /dev/null +++ b/test/lib/organization/unset_worker.js @@ -0,0 +1,125 @@ +// Copyright 2018 OpenST Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const web3 = require('../../test_lib/web3.js'); + +const Utils = require('../../test_lib/utils.js'); +const EventsDecoder = require('../../test_lib/event_decoder.js'); + +const Organization = artifacts.require('Organization'); + +contract('Organization.unsetWorker()', async (accounts) => { + + let owner = accounts[0]; + let worker = accounts[1]; + let admin = accounts[2]; + + let organization = null; + + beforeEach(async function () { + organization = await Organization.new({ from: owner }); + expirationHeight = (await web3.eth.getBlockNumber()) + 10; + await organization.setWorker(worker, expirationHeight, { from: owner }); + }); + + it('reverts when caller is not owner/admin', async () => { + + await Utils.expectRevert( + organization.unsetWorker( + worker, + { from: accounts[4] }, + ), + 'Only owner and admin are allowed to call this method.', + ); + + }); + + it('should pass when owner unsets/deactivates a worker', async () => { + await organization.unsetWorker( + worker, + { from: owner }, + ); + + let returnedWorker = await organization.workers.call(worker); + assert( + returnedWorker.eqn(0), + 'Worker should be reset to zero.', + ); + + }); + + it('should pass when admin unsets/deactivates a worker', async () => { + await organization.setAdmin(admin, { from: owner }); + await organization.unsetWorker( + worker, + { from: admin }, + ); + + let returnedWorker = await organization.workers.call(worker); + assert( + returnedWorker.eqn(0), + 'Worker should be reset to zero.', + ); + + }); + + it('emits an unsetWorker event when worker is present', async () => { + await organization.setWorker(worker, expirationHeight, { from: owner }); + const transaction = await organization.unsetWorker( + worker, + { from: owner }, + ); + const events = EventsDecoder.getEvents( + transaction, + organization, + ); + + assert.strictEqual( + events.WorkerUnset.worker, + worker, + 'The event should list the worker that was unset.', + ); + assert.strictEqual( + events.WorkerUnset.wasSet, + true, + 'The event should list the worker as previously set.', + ); + + }); + + it('emits an unsetWorker event when worker is not present', async () => { + let nonSetWorker = accounts[4]; + const transaction = await organization.unsetWorker( + nonSetWorker, + { from: owner }, + ); + const events = EventsDecoder.getEvents( + transaction, + organization, + ); + + assert.strictEqual( + events.WorkerUnset.worker, + nonSetWorker, + 'The event should list the worker that was unset.', + ); + assert.strictEqual( + events.WorkerUnset.wasSet, + false, + 'The event should not list the worker as previously set.', + ); + + }); + +}); diff --git a/test/test_lib/utils.js b/test/test_lib/utils.js index c7d83816..7d444c4a 100644 --- a/test/test_lib/utils.js +++ b/test/test_lib/utils.js @@ -242,6 +242,16 @@ Utils.prototype = { }); }, + advanceBlock: async () => { + await web3.currentProvider.send({ + jsonrpc: '2.0', + method: 'evm_mine', + id: new Date().getTime(), + }, (err) => { + assert.strictEqual(err, null); + }); + }, + //Get latest hash generateHashLock: () => { return hashLock.getHashLock();