From 4e56d129b0d5e6d2ec9a002c63c7f1a316cda9c8 Mon Sep 17 00:00:00 2001 From: Andrew Drury Date: Mon, 10 May 2021 07:46:59 -0700 Subject: [PATCH 1/3] Adding original contract code for ethereum network --- ethereum/.solcover.js | 9 + ethereum/README.md | 22 + ethereum/contracts/Migrations.sol | 23 + ethereum/contracts/controller/Controller.sol | 93 + .../controller/ControllerInterface.sol | 12 + ethereum/contracts/factory/Factory.sol | 394 ++ ethereum/contracts/factory/Members.sol | 65 + .../contracts/factory/MembersInterface.sol | 10 + ethereum/contracts/mock/BasicTokenMock.sol | 12 + .../contracts/mock/IndexedMappingWrapper.sol | 30 + ethereum/contracts/token/WBTC.sol | 26 + ethereum/contracts/utils/IndexedMapping.sol | 52 + ethereum/contracts/utils/OwnableContract.sol | 8 + .../contracts/utils/OwnableContractOwner.sol | 33 + ethereum/migrations/1_initial_migration.js | 5 + ethereum/package-lock.json | 4465 +++++++++++++++++ ethereum/package.json | 34 + ethereum/scripts/deployer.js | 12 + ethereum/scripts/deployerImplementation.js | 262 + ethereum/scripts/deployerInputTestrpc.json | 6 + ethereum/test/controller/controller.js | 268 + ethereum/test/deployer.js | 15 + ethereum/test/factory/factory.js | 728 +++ ethereum/test/factory/members.js | 122 + ethereum/test/helper.js | 12 + ethereum/test/token/BasicToken.behaviour.js | 79 + .../test/token/BurnableToken.behaviour.js | 65 + .../test/token/CanReclaimToken.behaviour.js | 23 + ethereum/test/token/Claimable.behaviour.js | 51 + .../test/token/DetailedERC20.behaviour.js | 25 + ethereum/test/token/HasNoEther.behaviour.js | 32 + .../test/token/MintableToken.behaviour.js | 158 + ethereum/test/token/Ownable.behaviour.js | 56 + .../test/token/PausableToken.behaviour.js | 264 + .../test/token/StandardToken.behaviour.js | 480 ++ ethereum/test/token/ownership.js | 47 + ethereum/test/token/token.js | 78 + ethereum/test/utils/indexedMapping.js | 316 ++ ethereum/test/utils/ownableContractOwner.js | 130 + ethereum/truffle.js | 24 + 40 files changed, 8546 insertions(+) create mode 100644 ethereum/.solcover.js create mode 100644 ethereum/README.md create mode 100644 ethereum/contracts/Migrations.sol create mode 100644 ethereum/contracts/controller/Controller.sol create mode 100644 ethereum/contracts/controller/ControllerInterface.sol create mode 100644 ethereum/contracts/factory/Factory.sol create mode 100644 ethereum/contracts/factory/Members.sol create mode 100644 ethereum/contracts/factory/MembersInterface.sol create mode 100644 ethereum/contracts/mock/BasicTokenMock.sol create mode 100644 ethereum/contracts/mock/IndexedMappingWrapper.sol create mode 100644 ethereum/contracts/token/WBTC.sol create mode 100644 ethereum/contracts/utils/IndexedMapping.sol create mode 100644 ethereum/contracts/utils/OwnableContract.sol create mode 100644 ethereum/contracts/utils/OwnableContractOwner.sol create mode 100644 ethereum/migrations/1_initial_migration.js create mode 100644 ethereum/package-lock.json create mode 100644 ethereum/package.json create mode 100644 ethereum/scripts/deployer.js create mode 100644 ethereum/scripts/deployerImplementation.js create mode 100644 ethereum/scripts/deployerInputTestrpc.json create mode 100644 ethereum/test/controller/controller.js create mode 100644 ethereum/test/deployer.js create mode 100644 ethereum/test/factory/factory.js create mode 100644 ethereum/test/factory/members.js create mode 100644 ethereum/test/helper.js create mode 100644 ethereum/test/token/BasicToken.behaviour.js create mode 100644 ethereum/test/token/BurnableToken.behaviour.js create mode 100644 ethereum/test/token/CanReclaimToken.behaviour.js create mode 100644 ethereum/test/token/Claimable.behaviour.js create mode 100644 ethereum/test/token/DetailedERC20.behaviour.js create mode 100644 ethereum/test/token/HasNoEther.behaviour.js create mode 100644 ethereum/test/token/MintableToken.behaviour.js create mode 100644 ethereum/test/token/Ownable.behaviour.js create mode 100644 ethereum/test/token/PausableToken.behaviour.js create mode 100644 ethereum/test/token/StandardToken.behaviour.js create mode 100644 ethereum/test/token/ownership.js create mode 100644 ethereum/test/token/token.js create mode 100644 ethereum/test/utils/indexedMapping.js create mode 100644 ethereum/test/utils/ownableContractOwner.js create mode 100644 ethereum/truffle.js diff --git a/ethereum/.solcover.js b/ethereum/.solcover.js new file mode 100644 index 0000000..33338c9 --- /dev/null +++ b/ethereum/.solcover.js @@ -0,0 +1,9 @@ +module.exports = { + norpc: false, + testCommand: '../node_modules/.bin/truffle test --network coverage', + compileCommand: '../node_modules/.bin/truffle compile', + skipFiles: [ + 'Migrations.sol', + 'mocks' + ] +} diff --git a/ethereum/README.md b/ethereum/README.md new file mode 100644 index 0000000..a70dfbd --- /dev/null +++ b/ethereum/README.md @@ -0,0 +1,22 @@ +This repository has the contracts that implement the wrapped btc token. + +# Installation + + npm install + +# Compilation + + node_modules/.bin/truffle compile + +# Testing + + node_modules/.bin/truffle test + +# Testing Coverage + + node node_modules/.bin/solidity-coverage + +# Deployment + + node scripts/deployer.js --input-file [file] --gas-price-gwei [gwei] --rpc-url [url] + diff --git a/ethereum/contracts/Migrations.sol b/ethereum/contracts/Migrations.sol new file mode 100644 index 0000000..c4efb65 --- /dev/null +++ b/ethereum/contracts/Migrations.sol @@ -0,0 +1,23 @@ +pragma solidity ^0.4.23; + +contract Migrations { + address public owner; + uint public last_completed_migration; + + constructor() public { + owner = msg.sender; + } + + modifier restricted() { + if (msg.sender == owner) _; + } + + function setCompleted(uint completed) public restricted { + last_completed_migration = completed; + } + + function upgrade(address new_address) public restricted { + Migrations upgraded = Migrations(new_address); + upgraded.setCompleted(last_completed_migration); + } +} diff --git a/ethereum/contracts/controller/Controller.sol b/ethereum/contracts/controller/Controller.sol new file mode 100644 index 0000000..0050a74 --- /dev/null +++ b/ethereum/contracts/controller/Controller.sol @@ -0,0 +1,93 @@ +pragma solidity 0.4.24; + +import "../utils/OwnableContract.sol"; +import "../utils/OwnableContractOwner.sol"; +import "../controller/ControllerInterface.sol"; +import "../token/WBTC.sol"; +import "../factory/MembersInterface.sol"; + + +contract Controller is ControllerInterface, OwnableContract, OwnableContractOwner { + + WBTC public token; + MembersInterface public members; + address public factory; + + constructor(WBTC _token) public { + require(_token != address(0), "invalid _token address"); + token = _token; + } + + modifier onlyFactory() { + require(msg.sender == factory, "sender not authorized for minting or burning."); + _; + } + + // setters + event MembersSet(MembersInterface indexed members); + + function setMembers(MembersInterface _members) external onlyOwner returns (bool) { + require(_members != address(0), "invalid _members address"); + members = _members; + emit MembersSet(members); + return true; + } + + event FactorySet(address indexed factory); + + function setFactory(address _factory) external onlyOwner returns (bool) { + require(_factory != address(0), "invalid _factory address"); + factory = _factory; + emit FactorySet(factory); + return true; + } + + // only owner actions on token + event Paused(); + + function pause() external onlyOwner returns (bool) { + token.pause(); + emit Paused(); + return true; + } + + event Unpaused(); + + function unpause() external onlyOwner returns (bool) { + token.unpause(); + emit Unpaused(); + return true; + } + + // only factory actions on token + function mint(address to, uint amount) external onlyFactory returns (bool) { + require(to != address(0), "invalid to address"); + require(!token.paused(), "token is paused."); + require(token.mint(to, amount), "minting failed."); + return true; + } + + function burn(uint value) external onlyFactory returns (bool) { + require(!token.paused(), "token is paused."); + token.burn(value); + return true; + } + + // all accessible + function isCustodian(address addr) external view returns (bool) { + return members.isCustodian(addr); + } + + function isMerchant(address addr) external view returns (bool) { + return members.isMerchant(addr); + } + + function getWBTC() external view returns (ERC20) { + return token; + } + + // overriding + function renounceOwnership() public onlyOwner { + revert("renouncing ownership is blocked."); + } +} diff --git a/ethereum/contracts/controller/ControllerInterface.sol b/ethereum/contracts/controller/ControllerInterface.sol new file mode 100644 index 0000000..8cf516b --- /dev/null +++ b/ethereum/contracts/controller/ControllerInterface.sol @@ -0,0 +1,12 @@ +pragma solidity 0.4.24; + +import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; + + +interface ControllerInterface { + function mint(address to, uint amount) external returns (bool); + function burn(uint value) external returns (bool); + function isCustodian(address addr) external view returns (bool); + function isMerchant(address addr) external view returns (bool); + function getWBTC() external view returns (ERC20); +} diff --git a/ethereum/contracts/factory/Factory.sol b/ethereum/contracts/factory/Factory.sol new file mode 100644 index 0000000..3eb18f2 --- /dev/null +++ b/ethereum/contracts/factory/Factory.sol @@ -0,0 +1,394 @@ +pragma solidity 0.4.24; + +import "../utils/OwnableContract.sol"; +import "../controller/ControllerInterface.sol"; + + +contract Factory is OwnableContract { + + enum RequestStatus {PENDING, CANCELED, APPROVED, REJECTED} + + struct Request { + address requester; // sender of the request. + uint amount; // amount of wbtc to mint/burn. + string btcDepositAddress; // custodian's btc address in mint, merchant's btc address in burn. + string btcTxid; // bitcoin txid for sending/redeeming btc in the mint/burn process. + uint nonce; // serial number allocated for each request. + uint timestamp; // time of the request creation. + RequestStatus status; // status of the request. + } + + ControllerInterface public controller; + + // mapping between merchant to the corresponding custodian deposit address, used in the minting process. + // by using a different deposit address per merchant the custodian can identify which merchant deposited. + mapping(address=>string) public custodianBtcDepositAddress; + + // mapping between merchant to the its deposit address where btc should be moved to, used in the burning process. + mapping(address=>string) public merchantBtcDepositAddress; + + // mapping between a mint request hash and the corresponding request nonce. + mapping(bytes32=>uint) public mintRequestNonce; + + // mapping between a burn request hash and the corresponding request nonce. + mapping(bytes32=>uint) public burnRequestNonce; + + Request[] public mintRequests; + Request[] public burnRequests; + + constructor(ControllerInterface _controller) public { + require(_controller != address(0), "invalid _controller address"); + controller = _controller; + owner = _controller; + } + + modifier onlyMerchant() { + require(controller.isMerchant(msg.sender), "sender not a merchant."); + _; + } + + modifier onlyCustodian() { + require(controller.isCustodian(msg.sender), "sender not a custodian."); + _; + } + + event CustodianBtcDepositAddressSet(address indexed merchant, address indexed sender, string btcDepositAddress); + + function setCustodianBtcDepositAddress( + address merchant, + string btcDepositAddress + ) + external + onlyCustodian + returns (bool) + { + require(merchant != 0, "invalid merchant address"); + require(controller.isMerchant(merchant), "merchant address is not a real merchant."); + require(!isEmptyString(btcDepositAddress), "invalid btc deposit address"); + + custodianBtcDepositAddress[merchant] = btcDepositAddress; + emit CustodianBtcDepositAddressSet(merchant, msg.sender, btcDepositAddress); + return true; + } + + event MerchantBtcDepositAddressSet(address indexed merchant, string btcDepositAddress); + + function setMerchantBtcDepositAddress(string btcDepositAddress) external onlyMerchant returns (bool) { + require(!isEmptyString(btcDepositAddress), "invalid btc deposit address"); + + merchantBtcDepositAddress[msg.sender] = btcDepositAddress; + emit MerchantBtcDepositAddressSet(msg.sender, btcDepositAddress); + return true; + } + + event MintRequestAdd( + uint indexed nonce, + address indexed requester, + uint amount, + string btcDepositAddress, + string btcTxid, + uint timestamp, + bytes32 requestHash + ); + + function addMintRequest( + uint amount, + string btcTxid, + string btcDepositAddress + ) + external + onlyMerchant + returns (bool) + { + require(!isEmptyString(btcDepositAddress), "invalid btc deposit address"); + require(compareStrings(btcDepositAddress, custodianBtcDepositAddress[msg.sender]), "wrong btc deposit address"); + + uint nonce = mintRequests.length; + uint timestamp = getTimestamp(); + + Request memory request = Request({ + requester: msg.sender, + amount: amount, + btcDepositAddress: btcDepositAddress, + btcTxid: btcTxid, + nonce: nonce, + timestamp: timestamp, + status: RequestStatus.PENDING + }); + + bytes32 requestHash = calcRequestHash(request); + mintRequestNonce[requestHash] = nonce; + mintRequests.push(request); + + emit MintRequestAdd(nonce, msg.sender, amount, btcDepositAddress, btcTxid, timestamp, requestHash); + return true; + } + + event MintRequestCancel(uint indexed nonce, address indexed requester, bytes32 requestHash); + + function cancelMintRequest(bytes32 requestHash) external onlyMerchant returns (bool) { + uint nonce; + Request memory request; + + (nonce, request) = getPendingMintRequest(requestHash); + + require(msg.sender == request.requester, "cancel sender is different than pending request initiator"); + mintRequests[nonce].status = RequestStatus.CANCELED; + + emit MintRequestCancel(nonce, msg.sender, requestHash); + return true; + } + + event MintConfirmed( + uint indexed nonce, + address indexed requester, + uint amount, + string btcDepositAddress, + string btcTxid, + uint timestamp, + bytes32 requestHash + ); + + function confirmMintRequest(bytes32 requestHash) external onlyCustodian returns (bool) { + uint nonce; + Request memory request; + + (nonce, request) = getPendingMintRequest(requestHash); + + mintRequests[nonce].status = RequestStatus.APPROVED; + require(controller.mint(request.requester, request.amount), "mint failed"); + + emit MintConfirmed( + request.nonce, + request.requester, + request.amount, + request.btcDepositAddress, + request.btcTxid, + request.timestamp, + requestHash + ); + return true; + } + + event MintRejected( + uint indexed nonce, + address indexed requester, + uint amount, + string btcDepositAddress, + string btcTxid, + uint timestamp, + bytes32 requestHash + ); + + function rejectMintRequest(bytes32 requestHash) external onlyCustodian returns (bool) { + uint nonce; + Request memory request; + + (nonce, request) = getPendingMintRequest(requestHash); + + mintRequests[nonce].status = RequestStatus.REJECTED; + + emit MintRejected( + request.nonce, + request.requester, + request.amount, + request.btcDepositAddress, + request.btcTxid, + request.timestamp, + requestHash + ); + return true; + } + + event Burned( + uint indexed nonce, + address indexed requester, + uint amount, + string btcDepositAddress, + uint timestamp, + bytes32 requestHash + ); + + function burn(uint amount) external onlyMerchant returns (bool) { + string memory btcDepositAddress = merchantBtcDepositAddress[msg.sender]; + require(!isEmptyString(btcDepositAddress), "merchant btc deposit address was not set"); + + uint nonce = burnRequests.length; + uint timestamp = getTimestamp(); + + // set txid as empty since it is not known yet. + string memory btcTxid = ""; + + Request memory request = Request({ + requester: msg.sender, + amount: amount, + btcDepositAddress: btcDepositAddress, + btcTxid: btcTxid, + nonce: nonce, + timestamp: timestamp, + status: RequestStatus.PENDING + }); + + bytes32 requestHash = calcRequestHash(request); + burnRequestNonce[requestHash] = nonce; + burnRequests.push(request); + + require(controller.getWBTC().transferFrom(msg.sender, controller, amount), "trasnfer tokens to burn failed"); + require(controller.burn(amount), "burn failed"); + + emit Burned(nonce, msg.sender, amount, btcDepositAddress, timestamp, requestHash); + return true; + } + + event BurnConfirmed( + uint indexed nonce, + address indexed requester, + uint amount, + string btcDepositAddress, + string btcTxid, + uint timestamp, + bytes32 inputRequestHash + ); + + function confirmBurnRequest(bytes32 requestHash, string btcTxid) external onlyCustodian returns (bool) { + uint nonce; + Request memory request; + + (nonce, request) = getPendingBurnRequest(requestHash); + + burnRequests[nonce].btcTxid = btcTxid; + burnRequests[nonce].status = RequestStatus.APPROVED; + burnRequestNonce[calcRequestHash(burnRequests[nonce])] = nonce; + + emit BurnConfirmed( + request.nonce, + request.requester, + request.amount, + request.btcDepositAddress, + btcTxid, + request.timestamp, + requestHash + ); + return true; + } + + function getMintRequest(uint nonce) + external + view + returns ( + uint requestNonce, + address requester, + uint amount, + string btcDepositAddress, + string btcTxid, + uint timestamp, + string status, + bytes32 requestHash + ) + { + Request memory request = mintRequests[nonce]; + string memory statusString = getStatusString(request.status); + + requestNonce = request.nonce; + requester = request.requester; + amount = request.amount; + btcDepositAddress = request.btcDepositAddress; + btcTxid = request.btcTxid; + timestamp = request.timestamp; + status = statusString; + requestHash = calcRequestHash(request); + } + + function getMintRequestsLength() external view returns (uint length) { + return mintRequests.length; + } + + function getBurnRequest(uint nonce) + external + view + returns ( + uint requestNonce, + address requester, + uint amount, + string btcDepositAddress, + string btcTxid, + uint timestamp, + string status, + bytes32 requestHash + ) + { + Request storage request = burnRequests[nonce]; + string memory statusString = getStatusString(request.status); + + requestNonce = request.nonce; + requester = request.requester; + amount = request.amount; + btcDepositAddress = request.btcDepositAddress; + btcTxid = request.btcTxid; + timestamp = request.timestamp; + status = statusString; + requestHash = calcRequestHash(request); + } + + function getBurnRequestsLength() external view returns (uint length) { + return burnRequests.length; + } + + function getTimestamp() internal view returns (uint) { + // timestamp is only used for data maintaining purpose, it is not relied on for critical logic. + return block.timestamp; // solhint-disable-line not-rely-on-time + } + + function getPendingMintRequest(bytes32 requestHash) internal view returns (uint nonce, Request memory request) { + require(requestHash != 0, "request hash is 0"); + nonce = mintRequestNonce[requestHash]; + request = mintRequests[nonce]; + validatePendingRequest(request, requestHash); + } + + function getPendingBurnRequest(bytes32 requestHash) internal view returns (uint nonce, Request memory request) { + require(requestHash != 0, "request hash is 0"); + nonce = burnRequestNonce[requestHash]; + request = burnRequests[nonce]; + validatePendingRequest(request, requestHash); + } + + function validatePendingRequest(Request memory request, bytes32 requestHash) internal pure { + require(request.status == RequestStatus.PENDING, "request is not pending"); + require(requestHash == calcRequestHash(request), "given request hash does not match a pending request"); + } + + function calcRequestHash(Request request) internal pure returns (bytes32) { + return keccak256(abi.encode( + request.requester, + request.amount, + request.btcDepositAddress, + request.btcTxid, + request.nonce, + request.timestamp + )); + } + + function compareStrings (string a, string b) internal pure returns (bool) { + return (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b))); + } + + function isEmptyString (string a) internal pure returns (bool) { + return (compareStrings(a, "")); + } + + function getStatusString(RequestStatus status) internal pure returns (string) { + if (status == RequestStatus.PENDING) { + return "pending"; + } else if (status == RequestStatus.CANCELED) { + return "canceled"; + } else if (status == RequestStatus.APPROVED) { + return "approved"; + } else if (status == RequestStatus.REJECTED) { + return "rejected"; + } else { + // this fallback can never be reached. + return "unknown"; + } + } +} diff --git a/ethereum/contracts/factory/Members.sol b/ethereum/contracts/factory/Members.sol new file mode 100644 index 0000000..51db21e --- /dev/null +++ b/ethereum/contracts/factory/Members.sol @@ -0,0 +1,65 @@ +pragma solidity 0.4.24; + +import "../utils/OwnableContract.sol"; +import "../utils/IndexedMapping.sol"; +import "../factory/MembersInterface.sol"; + + +contract Members is MembersInterface, OwnableContract { + + address public custodian; + + using IndexedMapping for IndexedMapping.Data; + IndexedMapping.Data internal merchants; + + constructor(address _owner) public { + require(_owner != address(0), "invalid _owner address"); + owner = _owner; + } + + event CustodianSet(address indexed custodian); + + function setCustodian(address _custodian) external onlyOwner returns (bool) { + require(_custodian != address(0), "invalid custodian address"); + custodian = _custodian; + + emit CustodianSet(_custodian); + return true; + } + + event MerchantAdd(address indexed merchant); + + function addMerchant(address merchant) external onlyOwner returns (bool) { + require(merchant != address(0), "invalid merchant address"); + require(merchants.add(merchant), "merchant add failed"); + + emit MerchantAdd(merchant); + return true; + } + + event MerchantRemove(address indexed merchant); + + function removeMerchant(address merchant) external onlyOwner returns (bool) { + require(merchant != address(0), "invalid merchant address"); + require(merchants.remove(merchant), "merchant remove failed"); + + emit MerchantRemove(merchant); + return true; + } + + function isCustodian(address addr) external view returns (bool) { + return (addr == custodian); + } + + function isMerchant(address addr) external view returns (bool) { + return merchants.exists(addr); + } + + function getMerchant(uint index) external view returns (address) { + return merchants.getValue(index); + } + + function getMerchants() external view returns (address[]) { + return merchants.getValueList(); + } +} diff --git a/ethereum/contracts/factory/MembersInterface.sol b/ethereum/contracts/factory/MembersInterface.sol new file mode 100644 index 0000000..c263db0 --- /dev/null +++ b/ethereum/contracts/factory/MembersInterface.sol @@ -0,0 +1,10 @@ +pragma solidity 0.4.24; + + +interface MembersInterface { + function setCustodian(address _custodian) external returns (bool); + function addMerchant(address merchant) external returns (bool); + function removeMerchant(address merchant) external returns (bool); + function isCustodian(address addr) external view returns (bool); + function isMerchant(address addr) external view returns (bool); +} diff --git a/ethereum/contracts/mock/BasicTokenMock.sol b/ethereum/contracts/mock/BasicTokenMock.sol new file mode 100644 index 0000000..5924f47 --- /dev/null +++ b/ethereum/contracts/mock/BasicTokenMock.sol @@ -0,0 +1,12 @@ +pragma solidity 0.4.24; + +import "openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol"; + + +contract BasicTokenMock is BasicToken { + + constructor(address _initialAccount, uint256 _initialBalance) public { + balances[_initialAccount] = _initialBalance; + totalSupply_ = _initialBalance; + } +} diff --git a/ethereum/contracts/mock/IndexedMappingWrapper.sol b/ethereum/contracts/mock/IndexedMappingWrapper.sol new file mode 100644 index 0000000..497d96a --- /dev/null +++ b/ethereum/contracts/mock/IndexedMappingWrapper.sol @@ -0,0 +1,30 @@ +pragma solidity 0.4.24; + +import "../utils/IndexedMapping.sol"; + + +contract IndexedMappingWrapper { + + using IndexedMapping for IndexedMapping.Data; + IndexedMapping.Data internal data; + + function add(address val) external returns (bool) { + return data.add(val); + } + + function remove(address val) external returns (bool) { + return data.remove(val); + } + + function exists(address val) external view returns (bool) { + return data.exists(val); + } + + function getValue(uint index) external view returns (address) { + return data.getValue(index); + } + + function getValueList() external view returns (address[]) { + return data.getValueList(); + } +} diff --git a/ethereum/contracts/token/WBTC.sol b/ethereum/contracts/token/WBTC.sol new file mode 100644 index 0000000..ae313dc --- /dev/null +++ b/ethereum/contracts/token/WBTC.sol @@ -0,0 +1,26 @@ +pragma solidity 0.4.24; + +import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol"; +import "openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol"; +import "openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol"; +import "openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol"; +import "openzeppelin-solidity/contracts/token/ERC20/PausableToken.sol"; +import "../utils/OwnableContract.sol"; + + +contract WBTC is StandardToken, DetailedERC20("Wrapped BTC", "WBTC", 8), + MintableToken, BurnableToken, PausableToken, OwnableContract { + + function burn(uint value) public onlyOwner { + super.burn(value); + } + + function finishMinting() public onlyOwner returns (bool) { + return false; + } + + function renounceOwnership() public onlyOwner { + revert("renouncing ownership is blocked"); + } +} + diff --git a/ethereum/contracts/utils/IndexedMapping.sol b/ethereum/contracts/utils/IndexedMapping.sol new file mode 100644 index 0000000..abfd75f --- /dev/null +++ b/ethereum/contracts/utils/IndexedMapping.sol @@ -0,0 +1,52 @@ +pragma solidity 0.4.24; + + +library IndexedMapping { + + struct Data { + mapping(address=>bool) valueExists; + mapping(address=>uint) valueIndex; + address[] valueList; + } + + function add(Data storage self, address val) internal returns (bool) { + if (exists(self, val)) return false; + + self.valueExists[val] = true; + self.valueIndex[val] = self.valueList.push(val) - 1; + return true; + } + + function remove(Data storage self, address val) internal returns (bool) { + uint index; + address lastVal; + + if (!exists(self, val)) return false; + + index = self.valueIndex[val]; + lastVal = self.valueList[self.valueList.length - 1]; + + // replace value with last value + self.valueList[index] = lastVal; + self.valueIndex[lastVal] = index; + self.valueList.length--; + + // remove value + delete self.valueExists[val]; + delete self.valueIndex[val]; + + return true; + } + + function exists(Data storage self, address val) internal view returns (bool) { + return self.valueExists[val]; + } + + function getValue(Data storage self, uint index) internal view returns (address) { + return self.valueList[index]; + } + + function getValueList(Data storage self) internal view returns (address[]) { + return self.valueList; + } +} diff --git a/ethereum/contracts/utils/OwnableContract.sol b/ethereum/contracts/utils/OwnableContract.sol new file mode 100644 index 0000000..90aec14 --- /dev/null +++ b/ethereum/contracts/utils/OwnableContract.sol @@ -0,0 +1,8 @@ +pragma solidity 0.4.24; + +import "openzeppelin-solidity/contracts/ownership/Claimable.sol"; +import "openzeppelin-solidity/contracts/ownership/CanReclaimToken.sol"; + + +// empty block is used as this contract just inherits others. +contract OwnableContract is CanReclaimToken, Claimable { } /* solhint-disable-line no-empty-blocks */ diff --git a/ethereum/contracts/utils/OwnableContractOwner.sol b/ethereum/contracts/utils/OwnableContractOwner.sol new file mode 100644 index 0000000..53eeff8 --- /dev/null +++ b/ethereum/contracts/utils/OwnableContractOwner.sol @@ -0,0 +1,33 @@ +pragma solidity 0.4.24; + +import "../utils/OwnableContract.sol"; + + +contract OwnableContractOwner is OwnableContract { + + event CalledTransferOwnership(OwnableContract ownedContract, address newOwner); + + function callTransferOwnership(OwnableContract ownedContract, address newOwner) external onlyOwner returns (bool) { + require(newOwner != address(0), "invalid newOwner address"); + ownedContract.transferOwnership(newOwner); + emit CalledTransferOwnership(ownedContract, newOwner); + return true; + } + + event CalledClaimOwnership(OwnableContract contractToOwn); + + function callClaimOwnership(OwnableContract contractToOwn) external onlyOwner returns (bool) { + contractToOwn.claimOwnership(); + emit CalledClaimOwnership(contractToOwn); + return true; + } + + event CalledReclaimToken(OwnableContract ownedContract, ERC20 _token); + + function callReclaimToken(OwnableContract ownedContract, ERC20 _token) external onlyOwner returns (bool) { + require(_token != address(0), "invalid _token address"); + ownedContract.reclaimToken(_token); + emit CalledReclaimToken(ownedContract, _token); + return true; + } +} diff --git a/ethereum/migrations/1_initial_migration.js b/ethereum/migrations/1_initial_migration.js new file mode 100644 index 0000000..4d5f3f9 --- /dev/null +++ b/ethereum/migrations/1_initial_migration.js @@ -0,0 +1,5 @@ +var Migrations = artifacts.require("./Migrations.sol"); + +module.exports = function(deployer) { + deployer.deploy(Migrations); +}; diff --git a/ethereum/package-lock.json b/ethereum/package-lock.json new file mode 100644 index 0000000..5882671 --- /dev/null +++ b/ethereum/package-lock.json @@ -0,0 +1,4465 @@ +{ + "name": "bitcoin-token-smart-contracts", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" + }, + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "requires": { + "mime-types": "2.1.19", + "negotiator": "0.6.1" + } + }, + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==" + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=" + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "optional": true + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==" + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "antlr4": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.7.0.tgz", + "integrity": "sha1-KX+VbdwG+DOX/AmQ7PLgzyC/u+4=" + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "1.0.3" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "2.1.2" + } + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "requires": { + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "bignumber.js": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", + "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" + }, + "bl": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "requires": { + "readable-stream": "2.3.6", + "safe-buffer": "5.1.2" + } + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "requires": { + "inherits": "2.0.3" + } + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "body-parser": { + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "1.6.16" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "requires": { + "browserify-aes": "1.2.0", + "browserify-des": "1.0.2", + "evp_bytestokey": "1.0.3" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "requires": { + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "requires": { + "bn.js": "4.11.8", + "randombytes": "2.0.6" + } + }, + "browserify-sha3": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.1.tgz", + "integrity": "sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE=", + "requires": { + "js-sha3": "0.3.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "elliptic": "6.4.0", + "inherits": "2.0.3", + "parse-asn1": "5.1.1" + } + }, + "buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.0.tgz", + "integrity": "sha512-nUJyfChH7PMJy75eRDCCKtszSEFokUNXC1hNVSe+o+VdcgvDPLs20k3v8UXI8ruRYAJiYtyRea8mYyqPxoHWDw==", + "requires": { + "base64-js": "1.3.0", + "ieee754": "1.1.12" + } + }, + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "requires": { + "buffer-alloc-unsafe": "1.1.0", + "buffer-fill": "1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" + }, + "buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, + "buffer-to-arraybuffer": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", + "integrity": "sha1-YGSkD6dutDxyOrqe+PbhIW0QURo=" + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=" + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chai": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", + "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", + "requires": { + "assertion-error": "1.1.0", + "check-error": "1.0.2", + "deep-eql": "3.0.1", + "get-func-name": "2.0.0", + "pathval": "1.1.0", + "type-detect": "4.0.8" + } + }, + "chai-as-promised": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz", + "integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==", + "requires": { + "check-error": "1.0.2" + } + }, + "chai-bignumber": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/chai-bignumber/-/chai-bignumber-2.0.2.tgz", + "integrity": "sha512-BIdRNjRaoRj4bMsZLKbIZPMNKqmwnzNiyxqBYDSs6dFOCs9w8OHPuUE8e1bH60i1IhOzT0NjLtCD+lKEWB1KTQ==" + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.5.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "1.9.3" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=" + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==" + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "requires": { + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", + "requires": { + "graceful-readlink": "1.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "1.1.1", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + } + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cors": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", + "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", + "requires": { + "object-assign": "4.1.1", + "vary": "1.1.2" + } + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "md5.js": "1.3.4", + "ripemd160": "2.0.2", + "sha.js": "2.4.11" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "inherits": "2.0.3", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "1.0.5", + "path-key": "2.0.1", + "semver": "5.5.0", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "requires": { + "browserify-cipher": "1.0.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.3", + "pbkdf2": "3.0.16", + "public-encrypt": "4.0.2", + "randombytes": "2.0.6", + "randomfill": "1.0.4" + } + }, + "crypto-js": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", + "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "death": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", + "integrity": "sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", + "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==", + "requires": { + "xregexp": "4.0.0" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "decompress": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz", + "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", + "requires": { + "decompress-tar": "4.1.1", + "decompress-tarbz2": "4.1.1", + "decompress-targz": "4.1.1", + "decompress-unzip": "4.0.1", + "graceful-fs": "4.1.11", + "make-dir": "1.3.0", + "pify": "2.3.0", + "strip-dirs": "2.1.0" + } + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "requires": { + "mimic-response": "1.0.1" + } + }, + "decompress-tar": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", + "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", + "requires": { + "file-type": "5.2.0", + "is-stream": "1.1.0", + "tar-stream": "1.6.1" + } + }, + "decompress-tarbz2": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", + "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", + "requires": { + "decompress-tar": "4.1.1", + "file-type": "6.2.0", + "is-stream": "1.1.0", + "seek-bzip": "1.0.5", + "unbzip2-stream": "1.2.5" + }, + "dependencies": { + "file-type": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", + "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==" + } + } + }, + "decompress-targz": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", + "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", + "requires": { + "decompress-tar": "4.1.1", + "file-type": "5.2.0", + "is-stream": "1.1.0" + } + }, + "decompress-unzip": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", + "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", + "requires": { + "file-type": "3.9.0", + "get-stream": "2.3.1", + "pify": "2.3.0", + "yauzl": "2.10.0" + }, + "dependencies": { + "file-type": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=" + }, + "get-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", + "requires": { + "object-assign": "4.1.1", + "pinkie-promise": "2.0.1" + } + } + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "requires": { + "type-detect": "4.0.8" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "diff": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", + "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==" + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "requires": { + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.0.6" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "requires": { + "esutils": "2.0.2" + } + }, + "dom-walk": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", + "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=" + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "optional": true, + "requires": { + "jsbn": "0.1.1", + "safer-buffer": "2.1.2" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.5", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "0.2.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "requires": { + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" + }, + "dependencies": { + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "eslint": { + "version": "4.19.1", + "resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.4.1", + "concat-stream": "1.6.2", + "cross-spawn": "5.1.0", + "debug": "3.2.5", + "doctrine": "2.1.0", + "eslint-scope": "3.7.3", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.1", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.7.0", + "ignore": "3.3.10", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.12.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.10", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "regexpp": "1.1.0", + "require-uncached": "1.0.3", + "semver": "5.5.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "4.1.3", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + }, + "debug": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz", + "integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==", + "requires": { + "ms": "2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "eslint-scope": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + } + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==" + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "requires": { + "acorn": "5.7.3", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "requires": { + "estraverse": "4.2.0" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "requires": { + "estraverse": "4.2.0" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + } + } + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "eth-lib": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", + "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.0", + "keccakjs": "0.2.1", + "nano-json-stream-parser": "0.1.2", + "servify": "0.1.12", + "ws": "3.3.3", + "xhr-request-promise": "0.1.2" + } + }, + "ethereumjs-testrpc-sc": { + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/ethereumjs-testrpc-sc/-/ethereumjs-testrpc-sc-6.1.6.tgz", + "integrity": "sha512-iv2qiGBFgk9mn5Nq2enX8dG5WQ7Lk+FCqpnxfPfH4Ns8KLPwttmNOy264nh3SXDJJvcQwz/XnlLteDQVILotbg==", + "requires": { + "source-map-support": "0.5.9" + } + }, + "ethjs-unit": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", + "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", + "requires": { + "bn.js": "4.11.6", + "number-to-bn": "1.7.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + } + } + }, + "eventemitter3": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz", + "integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA=" + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "1.3.4", + "safe-buffer": "5.1.2" + } + }, + "execa": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "requires": { + "cross-spawn": "6.0.5", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "express": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", + "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", + "requires": { + "accepts": "1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.2", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.4", + "qs": "6.5.1", + "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", + "utils-merge": "1.0.1", + "vary": "1.1.2" + }, + "dependencies": { + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.3", + "iconv-lite": "0.4.19", + "on-finished": "2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "1.6.16" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.4.0" + } + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + } + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "external-editor": { + "version": "2.2.0", + "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.23", + "tmp": "0.0.33" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "requires": { + "pend": "1.2.0" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "file-type": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", + "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=" + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.4.0", + "unpipe": "1.0.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } + } + }, + "find-parent-dir": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.0.tgz", + "integrity": "sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ=" + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "3.0.0" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "requires": { + "is-callable": "1.1.4" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.19" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "klaw": "1.3.1", + "path-is-absolute": "1.0.1", + "rimraf": "2.6.2" + } + }, + "fs-promise": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/fs-promise/-/fs-promise-2.0.3.tgz", + "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", + "requires": { + "any-promise": "1.3.0", + "fs-extra": "2.1.2", + "mz": "2.7.0", + "thenify-all": "1.6.0" + }, + "dependencies": { + "fs-extra": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", + "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0" + } + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + } + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "global": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", + "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", + "requires": { + "min-document": "2.19.0", + "process": "0.5.2" + } + }, + "globals": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==" + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "requires": { + "decompress-response": "3.3.0", + "duplexer3": "0.1.4", + "get-stream": "3.0.0", + "is-plain-obj": "1.1.0", + "is-retry-allowed": "1.1.0", + "is-stream": "1.1.0", + "isurl": "1.0.0", + "lowercase-keys": "1.0.1", + "p-cancelable": "0.3.0", + "p-timeout": "1.2.1", + "safe-buffer": "5.1.2", + "timed-out": "4.0.1", + "url-parse-lax": "1.0.0", + "url-to-options": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" + }, + "growl": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", + "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==" + }, + "handlebars": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", + "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", + "requires": { + "async": "2.6.1", + "optimist": "0.6.1", + "source-map": "0.6.1", + "uglify-js": "3.4.9" + }, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "requires": { + "lodash": "4.17.10" + } + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "5.5.2", + "har-schema": "2.0.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + } + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==" + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "requires": { + "has-symbol-support-x": "1.4.2" + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "hash.js": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", + "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "1.1.5", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "requires": { + "depd": "1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": "1.5.0" + } + }, + "http-https": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", + "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.14.2" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ieee754": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==" + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "requires": { + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.2.0", + "figures": "2.0.0", + "lodash": "4.17.10", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" + }, + "ipaddr.js": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", + "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "is-function": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", + "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + }, + "is-natural-number": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", + "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=" + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=" + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==" + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "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" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "requires": { + "has-to-string-tag-x": "1.4.1", + "is-object": "1.0.1" + } + }, + "js-sha3": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.3.1.tgz", + "integrity": "sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=" + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.1" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + } + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "requires": { + "graceful-fs": "4.1.11" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keccakjs": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.1.tgz", + "integrity": "sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0=", + "requires": { + "browserify-sha3": "0.0.1", + "sha3": "1.2.2" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "requires": { + "graceful-fs": "4.1.11" + } + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "requires": { + "invert-kv": "2.0.0" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "3.0.0", + "path-exists": "3.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "requires": { + "pify": "3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + } + } + }, + "map-age-cleaner": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", + "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==", + "requires": { + "p-defer": "1.0.0" + } + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.3" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "mem": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", + "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", + "requires": { + "map-age-cleaner": "0.1.2", + "mimic-fn": "1.2.0", + "p-is-promise": "1.1.0" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0" + } + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "mime-db": { + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" + }, + "mime-types": { + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", + "requires": { + "mime-db": "1.35.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "requires": { + "dom-walk": "0.1.1" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "mkdirp-promise": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", + "requires": { + "mkdirp": "0.5.1" + } + }, + "mocha": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", + "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.3.1", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + }, + "dependencies": { + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "mock-fs": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.5.0.tgz", + "integrity": "sha512-qqudNfOX7ZmX9vm1WIAU+gWlmxVNAnwY6UG3RkFutNywmRCUGP83tujP6IxX2DS1TmcaEZBOhYwDuYEmJYE+3w==" + }, + "mout": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/mout/-/mout-0.11.1.tgz", + "integrity": "sha1-ujYR318OWx/7/QEWa48C0fX6K5k=" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "requires": { + "any-promise": "1.3.0", + "object-assign": "4.1.1", + "thenify-all": "1.6.0" + } + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" + }, + "nano-json-stream-parser": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", + "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=" + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "requires": { + "abbrev": "1.0.9" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "requires": { + "hosted-git-info": "2.7.1", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.4" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "2.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "number-to-bn": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", + "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", + "requires": { + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + } + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "oboe": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.3.tgz", + "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", + "requires": { + "http-https": "1.0.0" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "requires": { + "mimic-fn": "1.2.0" + } + }, + "openzeppelin-solidity": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-1.12.0.tgz", + "integrity": "sha512-WlorzMXIIurugiSdw121RVD5qA3EfSI7GybTn+/Du0mPNgairjt29NpVTAaH8eLjAeAwlw46y7uQKy0NYem/gA==" + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "original-require": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/original-require/-/original-require-1.0.1.tgz", + "integrity": "sha1-DxMEcVhM0zURxew4yNWSE/msXiA=" + }, + "os-locale": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", + "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", + "requires": { + "execa": "0.10.0", + "lcid": "2.0.0", + "mem": "4.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==" + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-is-promise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "requires": { + "p-try": "2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "2.0.0" + } + }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "requires": { + "p-finally": "1.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" + }, + "parse-asn1": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "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" + } + }, + "parse-headers": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", + "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", + "requires": { + "for-each": "0.3.3", + "trim": "0.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "1.3.2" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=" + }, + "pbkdf2": { + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.16.tgz", + "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", + "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" + } + }, + "pegjs": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", + "integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=" + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "2.0.4" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==" + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" + }, + "process": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", + "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=" + }, + "proxy-addr": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", + "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "requires": { + "forwarded": "0.1.2", + "ipaddr.js": "1.8.0" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "public-encrypt": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz", + "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", + "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" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "requires": { + "decode-uri-component": "0.2.0", + "object-assign": "4.1.1", + "strict-uri-encode": "1.1.0" + } + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "requires": { + "randombytes": "2.0.6", + "safe-buffer": "5.1.2" + } + }, + "randomhex": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", + "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "unpipe": "1.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "2.0.1" + } + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "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" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "1.1.7" + } + }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==" + }, + "req-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-1.0.1.tgz", + "integrity": "sha1-DXOurpJm5penj3l2AZZ352rPD/8=", + "requires": { + "req-from": "1.0.1" + } + }, + "req-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/req-from/-/req-from-1.0.1.tgz", + "integrity": "sha1-v4HaUUeUfTLRO5R9wSpYrUWHNQ4=", + "requires": { + "resolve-from": "2.0.0" + } + }, + "request": { + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.7.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.0.3", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.19", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.2", + "safe-buffer": "5.1.2", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.6.0", + "uuid": "3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-from-string": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + }, + "dependencies": { + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=" + } + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" + }, + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "7.1.2" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.3" + } + }, + "rlp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.1.0.tgz", + "integrity": "sha512-93U7IKH5j7nmXFVg19MeNBGzQW5uXW1pmCuKY8veeKIhYTE32C2d0mOegfiIAfXcHOKJjjPlJisn8iHDF5AezA==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=" + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "requires": { + "rx-lite": "4.0.8" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "scrypt": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz", + "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", + "requires": { + "nan": "2.10.0" + } + }, + "scrypt.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.2.0.tgz", + "integrity": "sha1-r40UZbcemZARC+38WTuUeeA6ito=", + "requires": { + "scrypt": "6.0.3", + "scryptsy": "1.2.1" + } + }, + "scryptsy": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", + "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", + "requires": { + "pbkdf2": "3.0.16" + } + }, + "seek-bzip": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", + "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", + "requires": { + "commander": "2.8.1" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "requires": { + "debug": "2.6.9", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.3", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.4.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } + } + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "requires": { + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.16.2" + } + }, + "servify": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", + "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", + "requires": { + "body-parser": "1.18.3", + "cors": "2.8.4", + "express": "4.16.3", + "request": "2.87.0", + "xhr": "2.5.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "sha3": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.2.tgz", + "integrity": "sha1-pmxQmN5MJbyIM27ItIF9AFvKe6k=", + "requires": { + "nan": "2.10.0" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "requires": { + "glob": "7.1.2", + "interpret": "1.1.0", + "rechoir": "0.6.2" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" + }, + "simple-get": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", + "requires": { + "decompress-response": "3.3.0", + "once": "1.4.0", + "simple-concat": "1.0.0" + } + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, + "sol-explore": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/sol-explore/-/sol-explore-1.6.2.tgz", + "integrity": "sha1-Q66MQZ/TrAVqBfip0fsQIs1B7MI=" + }, + "solc": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.24.tgz", + "integrity": "sha512-2xd7Cf1HeVwrIb6Bu1cwY2/TaLRodrppCq3l7rhLimFQgmxptXhTC3+/wesVLpB09F1A2kZgvbMOgH7wvhFnBQ==", + "requires": { + "fs-extra": "0.30.0", + "memorystream": "0.3.1", + "require-from-string": "1.2.1", + "semver": "5.5.0", + "yargs": "4.8.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "1.0.0" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yargs": { + "version": "4.8.1", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "requires": { + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.3", + "lodash.assign": "4.2.0", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.2", + "which-module": "1.0.0", + "window-size": "0.2.0", + "y18n": "3.2.1", + "yargs-parser": "2.4.1" + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "requires": { + "camelcase": "3.0.0", + "lodash.assign": "4.2.0" + } + } + } + }, + "solhint": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-1.2.1.tgz", + "integrity": "sha512-3B0ydhkOlicyyTmKnwJC6kiwdJUXvbbDYXcy8m7rznoQPgzzkmSOsJgb9BAe+KBQP5BD3PLgcoOQ84t3FSxqsQ==", + "requires": { + "antlr4": "4.7.0", + "commander": "2.11.0", + "eslint": "4.19.1", + "glob": "7.1.2", + "ignore": "3.3.10", + "lodash": "4.17.10" + }, + "dependencies": { + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + } + } + }, + "solidity-coverage": { + "version": "0.5.11", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.5.11.tgz", + "integrity": "sha512-qikdsSi6+9XbfvwA0aI7HUVpF9fIFNqRWTw23M89GMDY+b6Gj0wWU9IngJS0fimoZIAdEp3bfChxvpfVcrUesg==", + "requires": { + "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", + "solidity-parser-sc": "0.4.11", + "tree-kill": "1.2.0", + "web3": "0.18.4" + }, + "dependencies": { + "bignumber.js": { + "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" + }, + "web3": { + "version": "0.18.4", + "resolved": "https://registry.npmjs.org/web3/-/web3-0.18.4.tgz", + "integrity": "sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0=", + "requires": { + "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "crypto-js": "3.1.8", + "utf8": "2.1.1", + "xhr2": "0.1.4", + "xmlhttprequest": "1.8.0" + } + } + } + }, + "solidity-parser-sc": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/solidity-parser-sc/-/solidity-parser-sc-0.4.11.tgz", + "integrity": "sha512-1kV5iC7m3CtMDfmHaVNwz2saSGQVIuF16rIxU417Al38MVCWHMQQ5vT6cmLsNwDe60S74auobWij9vNawSeOyw==", + "requires": { + "mocha": "4.1.0", + "pegjs": "0.10.0", + "yargs": "4.8.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "1.0.0" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yargs": { + "version": "4.8.1", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "requires": { + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.3", + "lodash.assign": "4.2.0", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.2", + "which-module": "1.0.0", + "window-size": "0.2.0", + "y18n": "3.2.1", + "yargs-parser": "2.4.1" + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "requires": { + "camelcase": "3.0.0", + "lodash.assign": "4.2.0" + } + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-support": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "requires": { + "buffer-from": "1.1.1", + "source-map": "0.6.1" + } + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.1" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==" + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.1" + } + }, + "spdx-license-ids": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", + "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "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" + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "3.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-dirs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", + "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", + "requires": { + "is-natural-number": "4.0.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "requires": { + "has-flag": "2.0.0" + } + }, + "swarm-js": { + "version": "0.1.37", + "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.37.tgz", + "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", + "requires": { + "bluebird": "3.5.1", + "buffer": "5.2.0", + "decompress": "4.2.0", + "eth-lib": "0.1.27", + "fs-extra": "2.1.2", + "fs-promise": "2.0.3", + "got": "7.1.0", + "mime-types": "2.1.19", + "mkdirp-promise": "5.0.1", + "mock-fs": "4.5.0", + "setimmediate": "1.0.5", + "tar.gz": "1.0.7", + "xhr-request-promise": "0.1.2" + }, + "dependencies": { + "fs-extra": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", + "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0" + } + } + } + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "requires": { + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.4.1", + "lodash": "4.17.10", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + } + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-stream": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.1.tgz", + "integrity": "sha512-IFLM5wp3QrJODQFPm6/to3LJZrONdBY/otxcvDIQzu217zKye6yVR3hhi9lAjrC2Z+m/j5oDxMPb1qcd8cIvpA==", + "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" + } + }, + "tar.gz": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/tar.gz/-/tar.gz-1.0.7.tgz", + "integrity": "sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg==", + "requires": { + "bluebird": "2.11.0", + "commander": "2.8.1", + "fstream": "1.0.11", + "mout": "0.11.1", + "tar": "2.2.1" + }, + "dependencies": { + "bluebird": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=" + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + }, + "thenify": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", + "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "requires": { + "any-promise": "1.3.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "requires": { + "thenify": "3.3.0" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "to-buffer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", + "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "requires": { + "punycode": "1.4.1" + } + }, + "tree-kill": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.0.tgz", + "integrity": "sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg==" + }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" + }, + "truffle": { + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/truffle/-/truffle-4.1.13.tgz", + "integrity": "sha1-vydYaYi0/4RWPt+/MrR5QUCKdq0=", + "requires": { + "mocha": "4.1.0", + "original-require": "1.0.1", + "solc": "0.4.24" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.19" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "requires": { + "is-typedarray": "1.0.0" + } + }, + "uglify-js": { + "version": "3.4.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", + "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "optional": true, + "requires": { + "commander": "2.17.1", + "source-map": "0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "optional": true + } + } + }, + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" + }, + "unbzip2-stream": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz", + "integrity": "sha512-izD3jxT8xkzwtXRUZjtmRwKnZoeECrfZ8ra/ketwOcusbZEp4mjULMnJOCfTDZBgGQAAY1AJ/IgxcwkavcX9Og==", + "requires": { + "buffer": "3.6.0", + "through": "2.3.8" + }, + "dependencies": { + "base64-js": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", + "integrity": "sha1-EQHpVE9KdrG8OybUUsqW16NeeXg=" + }, + "buffer": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-3.6.0.tgz", + "integrity": "sha1-pyyTb3e5a/UvX357RnGAYoVR3vs=", + "requires": { + "base64-js": "0.0.8", + "ieee754": "1.1.12", + "isarray": "1.0.0" + } + } + } + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "requires": { + "prepend-http": "1.0.4" + } + }, + "url-set-query": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", + "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=" + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=" + }, + "utf8": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", + "integrity": "sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g=" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + }, + "web3": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.35.tgz", + "integrity": "sha512-xwDmUhvTcHQvvNnOPcPZZgCxKUsI2e+GbHy7JkTK3/Rmnutazy8x7fsAXT9myw7V1qpi3GgLoZ3fkglSUbg1Mg==", + "requires": { + "web3-bzz": "1.0.0-beta.35", + "web3-core": "1.0.0-beta.35", + "web3-eth": "1.0.0-beta.35", + "web3-eth-personal": "1.0.0-beta.35", + "web3-net": "1.0.0-beta.35", + "web3-shh": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + } + }, + "web3-bzz": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.35.tgz", + "integrity": "sha512-BhAU0qhlr8zltm4gs/+P1gki2VkxHJaM2Rrh4DGesDW0lzwufRoNvWFlwx1bKHoFPWNbSmm9PRkHOYOINL/Tgw==", + "requires": { + "got": "7.1.0", + "swarm-js": "0.1.37", + "underscore": "1.8.3" + } + }, + "web3-core": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.35.tgz", + "integrity": "sha512-ayGavbgVk4KL9Y88Uv411fBJ0SVgVfKhKEBweKYzmP0zOqneMzWt6YsyD1n6kRvjAbqA0AfUPEOKyMNjcx2tjw==", + "requires": { + "web3-core-helpers": "1.0.0-beta.35", + "web3-core-method": "1.0.0-beta.35", + "web3-core-requestmanager": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + } + }, + "web3-core-helpers": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.35.tgz", + "integrity": "sha512-APOu3sEsamyqWt//8o4yq9KF25/uqGm+pQShson/sC4gKzmfJB07fLo2ond0X30E8fIqAPeVCotPXQxGciGUmA==", + "requires": { + "underscore": "1.8.3", + "web3-eth-iban": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + } + }, + "web3-core-method": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.35.tgz", + "integrity": "sha512-jidImCide8q0GpfsO4L73qoHrbkeWgwU3uOH5DKtJtv0ccmG086knNMRgryb/o9ZgetDWLmDEsJnHjBSoIwcbA==", + "requires": { + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.35", + "web3-core-promievent": "1.0.0-beta.35", + "web3-core-subscriptions": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + } + }, + "web3-core-promievent": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.35.tgz", + "integrity": "sha512-GvqXqKq07OmHuVi5uNRg6k79a1/CI0ViCC+EtNv4CORHtDRmYEt5Bvdv6z6FJEiaaQkD0lKbFwNhLxutx7HItw==", + "requires": { + "any-promise": "1.3.0", + "eventemitter3": "1.1.1" + } + }, + "web3-core-requestmanager": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.35.tgz", + "integrity": "sha512-S+zW2h17ZZQU9oe3yaCJE0E7aJS4C3Kf4kGPDv+nXjW0gKhQQhgVhw1Doq/aYQGqNSWJp7f1VHkz5gQWwg6RRg==", + "requires": { + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.35", + "web3-providers-http": "1.0.0-beta.35", + "web3-providers-ipc": "1.0.0-beta.35", + "web3-providers-ws": "1.0.0-beta.35" + } + }, + "web3-core-subscriptions": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.35.tgz", + "integrity": "sha512-gXzLrWvcGkGiWq1y33Z4Y80XI8XMrwowiQJkrPSjQ81K5PBKquOGwcMffLaKcwdmEy/NpsOXDeFo3eLE1Ghvvw==", + "requires": { + "eventemitter3": "1.1.1", + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.35" + } + }, + "web3-eth": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.35.tgz", + "integrity": "sha512-04mcb2nGPXThawuuYICPOxv0xOHofvQKsjZeIq+89nyOC8DQMGTAErDkGyMHQYtjpth5XDhic0wuEsA80AmFZA==", + "requires": { + "underscore": "1.8.3", + "web3-core": "1.0.0-beta.35", + "web3-core-helpers": "1.0.0-beta.35", + "web3-core-method": "1.0.0-beta.35", + "web3-core-subscriptions": "1.0.0-beta.35", + "web3-eth-abi": "1.0.0-beta.35", + "web3-eth-accounts": "1.0.0-beta.35", + "web3-eth-contract": "1.0.0-beta.35", + "web3-eth-iban": "1.0.0-beta.35", + "web3-eth-personal": "1.0.0-beta.35", + "web3-net": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + } + }, + "web3-eth-abi": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.35.tgz", + "integrity": "sha512-KUDC+EtFFYG8z01ZleKrASdjj327/rtWHzEt6RWsEj7bBa0bGp9nEh+nqdZx/Sdgz1O8tnfFzJlrRcXpfr1vGg==", + "requires": { + "bn.js": "4.11.6", + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + } + } + }, + "web3-eth-accounts": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.35.tgz", + "integrity": "sha512-duIgRsfht/0kAW/eQ0X9lKtVIykbETrnM2H7EnvplCzPHtQLodpib4o9JXfh9n6ZDgdDC7cuJoiVB9QJg089ew==", + "requires": { + "any-promise": "1.3.0", + "crypto-browserify": "3.12.0", + "eth-lib": "0.2.7", + "scrypt.js": "0.2.0", + "underscore": "1.8.3", + "uuid": "2.0.1", + "web3-core": "1.0.0-beta.35", + "web3-core-helpers": "1.0.0-beta.35", + "web3-core-method": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.0", + "xhr-request-promise": "0.1.2" + } + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" + } + } + }, + "web3-eth-contract": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.35.tgz", + "integrity": "sha512-foPohOg5O1UCGKGZOIs+kQK5IZdV2QQ7pAWwNxH8WHplUA+fre1MurXNpoxknUmH6mYplFhXjqgYq2MsrBpHrA==", + "requires": { + "underscore": "1.8.3", + "web3-core": "1.0.0-beta.35", + "web3-core-helpers": "1.0.0-beta.35", + "web3-core-method": "1.0.0-beta.35", + "web3-core-promievent": "1.0.0-beta.35", + "web3-core-subscriptions": "1.0.0-beta.35", + "web3-eth-abi": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + } + }, + "web3-eth-iban": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.35.tgz", + "integrity": "sha512-H5wkcNcAIc+h/WoDIKv7ZYmrM2Xqu3O7jBQl1IWo73EDVQji+AoB2i3J8tuwI1yZRInRwrfpI3Zuwuf54hXHmQ==", + "requires": { + "bn.js": "4.11.6", + "web3-utils": "1.0.0-beta.35" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + } + } + }, + "web3-eth-personal": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.35.tgz", + "integrity": "sha512-AcM9nnlxu7ZRRxPvkrFB9eLxMM4A2cPfj2aCg21Wb2EpMnhR+b/O1cT33k7ApRowoMpM+T9M8vx2oPNwXfaCOQ==", + "requires": { + "web3-core": "1.0.0-beta.35", + "web3-core-helpers": "1.0.0-beta.35", + "web3-core-method": "1.0.0-beta.35", + "web3-net": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + } + }, + "web3-net": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.35.tgz", + "integrity": "sha512-bbwaQ/KohGjIJ6HAKbZ6KrklCAaG6/B7hIbAbVLSFLxF+Yz9lmAgQYaDInpidpC/NLb3WOmcbRF+P77J4qMVIA==", + "requires": { + "web3-core": "1.0.0-beta.35", + "web3-core-method": "1.0.0-beta.35", + "web3-utils": "1.0.0-beta.35" + } + }, + "web3-providers-http": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.0.0-beta.35.tgz", + "integrity": "sha512-DcIMFq52Fb08UpWyZ3ZlES6NsNqJnco4hBS/Ej6eOcASfuUayPI+GLkYVZsnF3cBYqlH+DOKuArcKSuIxK7jIA==", + "requires": { + "web3-core-helpers": "1.0.0-beta.35", + "xhr2-cookies": "1.1.0" + } + }, + "web3-providers-ipc": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.35.tgz", + "integrity": "sha512-iB0FG0HcpUnayfa8pn4guqEQ4Y1nrroi/jffdtQgFkrNt0sD3fMSwwC0AbmECqj3tDLl0e1slBR0RENll+ZF0g==", + "requires": { + "oboe": "2.1.3", + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.35" + } + }, + "web3-providers-ws": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.35.tgz", + "integrity": "sha512-Cx64NgDStynKaUGDIIOfaCd0fZusL8h5avKTkdTjUu2aHhFJhZoVBGVLhoDtUaqZGWIZGcBJOoVf2JkGUOjDRQ==", + "requires": { + "underscore": "1.8.3", + "web3-core-helpers": "1.0.0-beta.35", + "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2" + } + }, + "web3-shh": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.35.tgz", + "integrity": "sha512-8qSonk/x0xabERS9Sr6AIADN/Ty+5KwARkkGIfSYHKqFpdMDz+76F7cUCxtoCZoS8K04xgZlDKYe0TJXLYA0Fw==", + "requires": { + "web3-core": "1.0.0-beta.35", + "web3-core-method": "1.0.0-beta.35", + "web3-core-subscriptions": "1.0.0-beta.35", + "web3-net": "1.0.0-beta.35" + } + }, + "web3-utils": { + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.35.tgz", + "integrity": "sha512-Dq6f0SOKj3BDFRgOPnE6ALbzBDCKVIW8mKWVf7tGVhTDHf+wQaWwQSC3aArFSqdExB75BPBPyDpuMTNszhljpA==", + "requires": { + "bn.js": "4.11.6", + "eth-lib": "0.1.27", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.8.3", + "utf8": "2.1.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + } + } + }, + "websocket": { + "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", + "requires": { + "debug": "2.6.9", + "nan": "2.10.0", + "typedarray-to-buffer": "3.1.5", + "yaeti": "0.0.6" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "requires": { + "mkdirp": "0.5.1" + } + }, + "ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "requires": { + "async-limiter": "1.0.0", + "safe-buffer": "5.1.2", + "ultron": "1.1.1" + } + }, + "xhr": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", + "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", + "requires": { + "global": "4.3.2", + "is-function": "1.0.1", + "parse-headers": "2.0.1", + "xtend": "4.0.1" + } + }, + "xhr-request": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", + "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", + "requires": { + "buffer-to-arraybuffer": "0.0.5", + "object-assign": "4.1.1", + "query-string": "5.1.1", + "simple-get": "2.8.1", + "timed-out": "4.0.1", + "url-set-query": "1.0.0", + "xhr": "2.5.0" + } + }, + "xhr-request-promise": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz", + "integrity": "sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0=", + "requires": { + "xhr-request": "1.1.0" + } + }, + "xhr2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.4.tgz", + "integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=" + }, + "xhr2-cookies": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", + "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", + "requires": { + "cookiejar": "2.1.2" + } + }, + "xmlhttprequest": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" + }, + "xregexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz", + "integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz", + "integrity": "sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==", + "requires": { + "cliui": "4.1.0", + "decamelize": "2.0.0", + "find-up": "3.0.0", + "get-caller-file": "1.0.3", + "os-locale": "3.0.1", + "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": "4.0.0", + "yargs-parser": "10.1.0" + } + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "requires": { + "camelcase": "4.1.0" + } + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "requires": { + "buffer-crc32": "0.2.13", + "fd-slicer": "1.1.0" + } + } + } +} diff --git a/ethereum/package.json b/ethereum/package.json new file mode 100644 index 0000000..7a93ea1 --- /dev/null +++ b/ethereum/package.json @@ -0,0 +1,34 @@ +{ + "name": "bitcoin-token-smart-contracts", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/KyberNetwork/bitcoin-token-smart-contracts.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/KyberNetwork/bitcoin-token-smart-contracts/issues" + }, + "homepage": "https://github.com/KyberNetwork/bitcoin-token-smart-contracts#readme", + "dependencies": { + "bignumber.js": "^7.2.1", + "chai": "^4.1.2", + "chai-as-promised": "^7.1.1", + "chai-bignumber": "^2.0.2", + "find-parent-dir": "^0.3.0", + "openzeppelin-solidity": "1.12.0", + "rlp": "^2.1.0", + "solc": "^0.4.24", + "solhint": "^1.2.1", + "solidity-coverage": "^0.5.11", + "truffle": "^4.1.13", + "web3": "^1.0.0-beta.35", + "yargs": "^12.0.2" + } +} diff --git a/ethereum/scripts/deployer.js b/ethereum/scripts/deployer.js new file mode 100644 index 0000000..e5b2add --- /dev/null +++ b/ethereum/scripts/deployer.js @@ -0,0 +1,12 @@ +#!/usr/bin/env node + +process.on('unhandledRejection', console.error.bind(console)) + +const { inputFile, gasPriceGwei, rpcUrl, dontSendTx } = require('yargs') + .usage('Usage: $0 --input-file [file] --gas-price-gwei [gwei] --rpc-url [url] --dont-send-tx [bool]') + .demandOption(['inputFile', 'gasPriceGwei', 'rpcUrl']) + .boolean('dontSendTx') + .argv; + +const deployer = require("./deployerImplementation.js"); +deployer.deploy(inputFile, gasPriceGwei, rpcUrl, dontSendTx); diff --git a/ethereum/scripts/deployerImplementation.js b/ethereum/scripts/deployerImplementation.js new file mode 100644 index 0000000..8802f92 --- /dev/null +++ b/ethereum/scripts/deployerImplementation.js @@ -0,0 +1,262 @@ +module.exports.deploy = async function (inputFile, gasPriceGwei, rpcUrl, dontSendTx) { + + const Web3 = require("web3"); + const fs = require("fs"); + const path = require('path'); + const RLP = require('rlp'); + const BigNumber = require('bignumber.js') + const solc = require('solc') + + const web3 = new Web3(new Web3.providers.HttpProvider(rpcUrl)); + const gasPrice = BigNumber(gasPriceGwei).times(10 ** 9); + const signedTxs = []; + let chainId; + + let nonce; + let privateKey, account, sender; + let privateKeyCustodian, accountCustodian, accountCustodianAddress; + let privateKeyMerchant, accountMerchant, accountMerchantAddress; + let accountMultiSigAddress; + + const controllerContractPath = path.join(__dirname, "../contracts/controller/"); + const factoryContractPath = path.join(__dirname, "../contracts/factory/"); + const tokenContractPath = path.join(__dirname, "../contracts/token/"); + const utilsContractPath = path.join(__dirname, "../contracts/utils/"); + + const compilationInput = { + "OwnableContract.sol" : fs.readFileSync(utilsContractPath + 'OwnableContract.sol', 'utf8'), + "OwnableContractOwner.sol" : fs.readFileSync(utilsContractPath + 'OwnableContractOwner.sol', 'utf8'), + "IndexedMapping.sol" : fs.readFileSync(utilsContractPath + 'IndexedMapping.sol', 'utf8'), + "Controller.sol" : fs.readFileSync(controllerContractPath + 'Controller.sol', 'utf8'), + "ControllerInterface.sol" : fs.readFileSync(controllerContractPath + 'ControllerInterface.sol', 'utf8'), + "Factory.sol" : fs.readFileSync(factoryContractPath + 'Factory.sol', 'utf8'), + "Members.sol" : fs.readFileSync(factoryContractPath + 'Members.sol', 'utf8'), + "MembersInterface.sol" : fs.readFileSync(factoryContractPath + 'MembersInterface.sol', 'utf8'), + "WBTC.sol" : fs.readFileSync(tokenContractPath + 'WBTC.sol', 'utf8') + }; + + function findImports (_path) { + if(_path.includes("openzeppelin-solidity")) + return { contents: fs.readFileSync("node_modules/" + _path, 'utf8') } + else + return { contents: fs.readFileSync(path.join(__dirname, "../contracts/", _path), 'utf8') } + } + + function sleep(ms){ + return new Promise(resolve=>{ + setTimeout(resolve,ms) + }) + } + + function getKeyAndAccounts() { + + let content = JSON.parse(fs.readFileSync(inputFile, 'utf8')); + privateKey = content["privateKey"] + privateKeyCustodian = content["privateKeyCustodian"] + privateKeyMerchant = content["privateKeyMerchant"] + accountMultiSigAddress = content["accountMultiSigAddress"] + + account = web3.eth.accounts.privateKeyToAccount(privateKey); + sender = account.address; + console.log("from",sender); + + accountCustodian = web3.eth.accounts.privateKeyToAccount(privateKeyCustodian); + accountCustodianAddress = accountCustodian.address; + console.log("accountCustodianAddress", accountCustodianAddress); + + accountMerchant = web3.eth.accounts.privateKeyToAccount(privateKeyMerchant); + accountMerchantAddress = accountMerchant.address; + console.log("accountMerchantAddress", accountMerchantAddress); + + console.log("accountMultiSigAddress", accountMultiSigAddress); + } + + async function sendTx(txObject, fromAccount) { + const txTo = txObject._parent.options.address; + + let gasLimit; + try { + gasLimit = await txObject.estimateGas(); + } + catch (e) { + gasLimit = 500 * 1000; + } + + if(txTo !== null) { + gasLimit = 500 * 1000; + } + + gasLimit *= 1.2; + gasLimit -= gasLimit % 1; + + const txData = txObject.encodeABI(); + const txFrom = fromAccount.address; + const txKey = fromAccount.privateKey; + + const tx = { + from : txFrom, + to : txTo, + nonce : nonce, + data : txData, + gas : gasLimit, + chainId, + gasPrice + }; + + const signedTx = await web3.eth.accounts.signTransaction(tx, txKey); + nonce++; + // don't wait for confirmation + signedTxs.push(signedTx.rawTransaction) + if (!dontSendTx) { + web3.eth.sendSignedTransaction(signedTx.rawTransaction, {from:fromAccount.address}); + } + } + + async function deployContract(solcOutput, contractName, ctorArgs) { + + const actualName = contractName; + const bytecode = solcOutput.contracts[actualName].bytecode; + const abi = solcOutput.contracts[actualName].interface; + const myContract = new web3.eth.Contract(JSON.parse(abi)); + const deploy = myContract.deploy({data:"0x" + bytecode, arguments: ctorArgs}); + + let address = "0x" + web3.utils.sha3(RLP.encode([sender,nonce])).slice(12).substring(14); + address = web3.utils.toChecksumAddress(address); + + await sendTx(deploy, account); + + myContract.options.address = address; + + return [address, myContract]; + } + + async function waitForEth(address) { + while(true) { + const balance = await web3.eth.getBalance(address); + console.log("waiting for balance to account " + address); + if(balance.toString() !== "0") { + console.log("received " + balance.toString() + " wei"); + return; + } + else await sleep(10000) + } + } + + async function fundTestRpcAccounts() { + const accounts = await web3.eth.getAccounts(); + const amount = BigNumber(1).times(10 ** 18) // 1 eth + await web3.eth.sendTransaction({to: sender, from: accounts[0], value: amount}); + await web3.eth.sendTransaction({to: accountCustodianAddress, from: accounts[0], value: amount}); + await web3.eth.sendTransaction({to: accountMerchantAddress, from: accounts[0], value: amount}); + } + + async function main() { + + getKeyAndAccounts(); + + ///////////////////////////////////////////////////////////// + networkType = await web3.eth.net.getNetworkType(); + if (networkType == "private") { + fundTestRpcAccounts(); + } + + ///////////////////////////////////////////////////////////// + + nonce = await web3.eth.getTransactionCount(sender); + console.log("nonce",nonce); + + chainId = await web3.eth.net.getId() + console.log('chainId', chainId); + + console.log("starting compilation"); + const output = await solc.compile({ sources: compilationInput }, 1, findImports); + console.log(output.errors); + console.log("finished compilation"); + + if (!dontSendTx) { + await waitForEth(sender); + await waitForEth(accountCustodianAddress); + await waitForEth(accountMerchantAddress); + } + + ///////////////////////////////////////////////////////////// + + let tokenAddress, tokenContract; + [tokenAddress, tokenContract] = await deployContract(output, "WBTC.sol:WBTC", []); + console.log("tokenAddress: " + tokenAddress); + + let controllerAddress, controllerContract; + [controllerAddress, controllerContract] = await deployContract(output, "Controller.sol:Controller", [tokenAddress]); + console.log("controllerAddress: " + controllerAddress) + + let membersAddress, membersContract; + // set sender as owner here, can use controller in final deployment. + [membersAddress, membersContract] = await deployContract(output, "Members.sol:Members", [sender]); + console.log("membersAddress: " + membersAddress) + + let factoryAddress, factoryContract; + [factoryAddress, factoryContract] = await deployContract(output, "Factory.sol:Factory", [controllerAddress]); + console.log("factoryAddress: " + factoryAddress) + + //////////////////////////////////////////////////////////// + + console.log("controllerContract.methods.setFactory: " + factoryAddress) + await sendTx(controllerContract.methods.setFactory(factoryAddress), account); + + console.log("controllerContract.methods.setMembers: " + membersAddress) + await sendTx(controllerContract.methods.setMembers(membersAddress), account); + + //////////////////////////////////////////////////////////// + + console.log("tokenContract.methods.transferOwnership: " + controllerAddress) + await sendTx(tokenContract.methods.transferOwnership(controllerAddress), account); + + console.log("controllerContract.methods.callClaimOwnership: " + tokenAddress) + await sendTx(controllerContract.methods.callClaimOwnership(tokenAddress), account); + + //////////////////////////////////////////////////////////// + + console.log("membersContract.methods.setCustodian: " + accountCustodianAddress) + await sendTx(membersContract.methods.setCustodian(accountCustodianAddress), account); + + console.log("membersContract.methods.addMerchant: " + accountMerchantAddress) + await sendTx(membersContract.methods.addMerchant(accountMerchantAddress), account); + + //////////////////////////////////////////////////////////// + + console.log("controllerContract.methods.transferOwnership: " + accountMultiSigAddress) + await sendTx(controllerContract.methods.transferOwnership(accountMultiSigAddress), account); + + console.log("membersContract.methods.transferOwnership: " + accountMultiSigAddress) + await sendTx(membersContract.methods.transferOwnership(accountMultiSigAddress), account); + + //////////////////////////////////////////////////////////// + + console.log("waiting to make sure the custodian and merchant were added on chain.") + await sleep(20000) + + nonce = await web3.eth.getTransactionCount(accountCustodianAddress); + console.log("accountCustodianAddress nonce: " + nonce); + let custodianBtcDepositAddress = "1JPhiNBhZzBgWwjG6zaDchmXZyTyUN5Qny"; + console.log("factoryContract.methods.setCustodianBtcDepositAddress: " + accountMerchantAddress + ", " + custodianBtcDepositAddress); + await sendTx(factoryContract.methods.setCustodianBtcDepositAddress(accountMerchantAddress, custodianBtcDepositAddress), accountCustodian); + + nonce = await web3.eth.getTransactionCount(accountMerchantAddress); + console.log("accountMerchantAddress nonce: " + nonce); + let merchantBtcDepositAddress = "1E57B5SCkGVhFxDugko3quHxamPgkS8NxJ"; + console.log("factoryContract.methods.setMerchantBtcDepositAddress: " + merchantBtcDepositAddress); + await sendTx(factoryContract.methods.setMerchantBtcDepositAddress(merchantBtcDepositAddress), accountMerchant); + + nonce = await web3.eth.getTransactionCount(sender); + + //////////////////////////////////////////////////////////// + + console.log("last nonce is", nonce); + + //////////////////////////////////////////////////////////// + + console.log("next step: multisig should claim ownership for controller and members.") + } + + await main(); +}; diff --git a/ethereum/scripts/deployerInputTestrpc.json b/ethereum/scripts/deployerInputTestrpc.json new file mode 100644 index 0000000..97f0d49 --- /dev/null +++ b/ethereum/scripts/deployerInputTestrpc.json @@ -0,0 +1,6 @@ +{ + "privateKey": "0xABCD", + "privateKeyCustodian": "0x1234", + "privateKeyMerchant": "0x5678", + "accountMultiSigAddress": "0xFFc4E87e971bb9000F4F042ED4A9A0E349415D98" +} \ No newline at end of file diff --git a/ethereum/test/controller/controller.js b/ethereum/test/controller/controller.js new file mode 100644 index 0000000..deb1c0b --- /dev/null +++ b/ethereum/test/controller/controller.js @@ -0,0 +1,268 @@ +const { ZEPPELIN_LOCATION } = require("../helper.js"); +const { expectThrow } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/expectThrow'); + +const WBTC = artifacts.require("./token/WBTC.sol") +const Members = artifacts.require("./factory/Members.sol") +const Controller = artifacts.require("./controller/Controller.sol") +const BasicTokenMock = artifacts.require('BasicTokenMock'); + +contract('Controller', function(accounts) { + + const admin = accounts[0]; + const other = accounts[1]; + const factory = accounts[2]; // factory simulated as a regular address here + const otherFactory = accounts[3]; + + let wbtc; + let controller; + let members; + + beforeEach('create controller and transfer wbtc ownership to it', async function () { + wbtc = await WBTC.new(); + controller = await Controller.new(wbtc.address); + members = await Members.new(admin); + otherToken = await BasicTokenMock.new(admin, 100); + + await controller.setFactory(factory) + await controller.setMembers(members.address) + + await wbtc.transferOwnership(controller.address) + await controller.callClaimOwnership(wbtc.address) + }); + + describe('as owner', function () { + const from = admin; + + it("should create controller with 0 token address.", async function () { + await expectThrow(Controller.new(0), "invalid _token address"); + }); + + it("should setMembers.", async function () { + const otherMembers = await Members.new(admin); + assert.notEqual(otherMembers.address, members.address) + + const membersBefore = await controller.members.call(); + assert.equal(membersBefore, members.address); + + await controller.setMembers(otherMembers.address); + + const membersAfter = await controller.members.call(); + assert.equal(membersAfter, otherMembers.address); + }); + + it("should setMembers with 0 address.", async function () { + await expectThrow(controller.setMembers(0), "invalid _members address"); + }); + + it("should check setMembers event.", async function () { + const otherMembers = await Members.new(admin); + const { logs } = await controller.setMembers(otherMembers.address); + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'MembersSet'); + assert.equal(logs[0].args.members, otherMembers.address); + }); + + it("should setFactory.", async function () { + assert.notEqual(otherFactory, factory) + + const factoryBefore = await controller.factory.call(); + assert.equal(factoryBefore, factory); + + await controller.setFactory(otherFactory); + + const factoryAfter = await controller.factory.call(); + assert.equal(factoryAfter, otherFactory); + }); + + it("should setFactory with 0 address.", async function () { + await expectThrow(controller.setFactory(0), "invalid _factory address"); + }); + + it("should check setFactory event.", async function () { + const { logs } = await controller.setFactory(otherFactory); + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'FactorySet'); + assert.equal(logs[0].args.factory, otherFactory); + }); + + it("should check transfer succeeds when not paused.", async function () { + const balanceBefore = await wbtc.balanceOf(admin) + assert.equal(balanceBefore, 0); + + await controller.mint(admin, 100, {from: factory}); + const balanceAfterMint = await wbtc.balanceOf(admin); + assert.equal(balanceAfterMint, 100); + + await wbtc.transfer(other, 20); + const balanceAfterTransfer = await wbtc.balanceOf(admin) + assert.equal(balanceAfterTransfer, 80); + }); + + it("should check transfer fails after pause.", async function () { + await controller.mint(admin, 100, {from: factory}); + await controller.pause(); + await expectThrow(wbtc.transfer(other, 20)); + }); + + it("should check mint fails after pause.", async function () { + await controller.pause(); + await expectThrow(controller.mint(admin, 100, {from: factory})); + }); + + it("should check burn fails after pause.", async function () { + await controller.mint(factory, 100, {from: factory}); + + // when burning through factory we only need to approve. + // here we transfer since checking internally. + await wbtc.transfer(controller.address, 20, {from: factory}) + await controller.pause(); + await expectThrow(controller.burn(20, {from: factory})); + }); + + it("should check pause emits an event.", async function () { + const { logs } = await controller.pause(); + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Paused'); + }); + + it("should check transfer succeeds after unpause.", async function () { + await controller.mint(admin, 100, {from: factory}); + const balanceBefore = await wbtc.balanceOf(admin) + assert.equal(balanceBefore, 100); + + await controller.pause(); + const isPausedBefore = await wbtc.paused.call(); + assert.equal(isPausedBefore, true); + + await expectThrow(wbtc.transfer(other, 20)); + + await controller.unpause(); + const isPausedAfter = await wbtc.paused.call(); + assert.equal(isPausedAfter, false); + + await wbtc.transfer(other, 20); + const balanceAfterTransfer = await wbtc.balanceOf(admin) + assert.equal(balanceAfterTransfer, 80); + }); + + it("should check unpause emits an event.", async function () { + await controller.pause(); + const { logs } = await controller.unpause(); + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Unpaused'); + }); + + it('does not lose owner after renouncement', async function () { + await expectThrow(controller.renounceOwnership()); + const owner = await controller.owner(); + assert.equal(owner, admin); + }); + }); + + describe('not as owner', function () { + const from = other; + + it("setMembers reverts.", async function () { + await expectThrow(controller.setMembers(otherToken.address, {from})); + }); + + it("setFactory reverts.", async function () { + await expectThrow(controller.setFactory(otherFactory, {from})); + }); + + it("pause reverts.", async function () { + await expectThrow(controller.pause({from})); + }); + + it("unpause reverts.", async function () { + await expectThrow(controller.unpause({from})); + }); + }); + + describe('as factory', function () { + it("mint", async function () { + const balanceBefore = await wbtc.balanceOf(admin) + assert.equal(balanceBefore, 0); + + await controller.mint(admin, 100, {from: factory}); + const balanceAfter = await wbtc.balanceOf(admin); + assert.equal(balanceAfter, 100); + }); + + it("should mint with 0 address", async function () { + await expectThrow(controller.mint(0, 100, {from: factory}), "invalid to address"); + }); + + it("mint of token that controller does not own should fail", async function () { + await controller.callTransferOwnership(wbtc.address, admin) + await wbtc.claimOwnership() + await expectThrow(controller.mint(admin, 100, {from: factory})); + }); + + it("burn", async function () { + await controller.mint(factory, 100, {from: factory}); + + const balanceBefore = await wbtc.balanceOf(factory) + assert.equal(balanceBefore, 100); + + // when burning through factory we only need to approve. + // here we transfer since checking internally. + await wbtc.transfer(controller.address, 20, {from: factory}) + await controller.burn(20, {from: factory}); + const balanceAfter = await wbtc.balanceOf(factory); + assert.equal(balanceAfter, 80); + }); + + it("burn of token that controller does not own should fail", async function () { + await controller.mint(factory, 100, {from: factory}); + await wbtc.transfer(controller.address, 20, {from: factory}) + + await controller.callTransferOwnership(wbtc.address, admin) + await wbtc.claimOwnership() + + await expectThrow(controller.burn(20, {from: factory})); + }); + }); + + describe('not as factory', function () { + it("mint reverts.", async function () { + await expectThrow(controller.mint(admin, 100, {other})); + }); + it("burn reverts.", async function () { + await controller.mint(other, 100, {from: factory}); + + const balanceBefore = await wbtc.balanceOf(other) + assert.equal(balanceBefore, 100); + + // when burning through factory we only need to approve. + // here we transfer since checking internally. + await wbtc.transfer(controller.address, 20, {from: other}) + await expectThrow(controller.burn(20, {from: other})); + }); + }); + + describe('as anyone', function () { + it("check isCustodian.", async function () { + const isCustodianBefore = await controller.isCustodian(other); + assert.equal(isCustodianBefore, false); + + await members.setCustodian(other); + const isCustodianAfter = await controller.isCustodian(other); + assert.equal(isCustodianAfter, true); + }); + + it("check isMerchant.", async function () { + const isMerchantBefore = await controller.isMerchant(other); + assert.equal(isMerchantBefore, false); + + await members.addMerchant(other); + const isMerchantAfter = await controller.isMerchant(other); + assert.equal(isMerchantAfter, true); + }); + + it("check getWBTC.", async function () { + const gotWBTC = await controller.getWBTC(); + assert.equal(gotWBTC, wbtc.address); + }); + }); +}); diff --git a/ethereum/test/deployer.js b/ethereum/test/deployer.js new file mode 100644 index 0000000..1249900 --- /dev/null +++ b/ethereum/test/deployer.js @@ -0,0 +1,15 @@ +const BigNumber = web3.BigNumber + +const deployer = require("../scripts/deployerImplementation.js"); + +require("chai") + .use(require("chai-as-promised")) + .use(require('chai-bignumber')(BigNumber)) + .should() + +contract('Deployer', function(accounts) { + + it("test deployer script on private net.", async function () { + await deployer.deploy("scripts/deployerInputTestrpc.json", 20, web3.currentProvider.host, false); + }); +}); diff --git a/ethereum/test/factory/factory.js b/ethereum/test/factory/factory.js new file mode 100644 index 0000000..d5c08a5 --- /dev/null +++ b/ethereum/test/factory/factory.js @@ -0,0 +1,728 @@ +const BigNumber = web3.BigNumber + +const { ZEPPELIN_LOCATION } = require("../helper.js"); +const { expectThrow } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/expectThrow'); + +require("chai") + .use(require("chai-as-promised")) + .use(require('chai-bignumber')(BigNumber)) + .should() + +const WBTC = artifacts.require("./token/WBTC.sol") +const Members = artifacts.require("./factory/Members.sol") +const Controller = artifacts.require("./controller/Controller.sol") +const Factory = artifacts.require("./factory/Factory.sol") + +const REQUEST_NONCE_FIELD = 0 +const REQUEST_REQUESTER_FIELD = 1 +const REQUEST_AMOUNT_FIELD = 2 +const REQUEST_BTC_DEPOSIT_ADDRESS_FIELD = 3 +const REQUEST_BTC_TXID_FIELD = 4 +const REQUEST_TIMESTAMP_FIELD = 5 +const REQUEST_STATUS_FIELD = 6 +const REQUEST_HASH_FIELD = 7 + +const REQUEST_STATUS_PENDING = "pending" +const REQUEST_STATUS_CANCELED = "canceled" +const REQUEST_STATUS_APPROVED = "approved" +const REQUEST_STATUS_REJECTED = "rejected" + +contract('Factory', function(accounts) { + + const admin = accounts[0]; + const other = accounts[1]; + const custodian0 = accounts[2]; + const merchant0 = accounts[4]; + const merchant1 = accounts[5]; + const merchant2 = accounts[6]; + + const custodianBtcDepositAddressForMerchant0 = "1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY" + const custodianBtcDepositAddressForMerchant1 = "1CK6KHY6MHgYvmRQ4PAafKYDrg1ejbH1cE" + const custodianBtcDepositAddressForMerchant2 = "1LCgURAohwmQas667XmMT8VeEdPSu9ThpC" + const merchant0BtcDepositAddress = "33186S4aTEmv67cAygmzL9CWzoMNV7RNCn" + const merchant1BtcDepositAddress = "3CRCW2DLqBa336QPhJK3SvLVRCueckcJ1f " + const otherBtcAddress = "15kiNKfDWsq7UsPg87UwxA8rVvWAjzRkYS" + + const btcTxid0 = "955c0816db69040dddf858c599c5e5ea915f193b65fde641021a297cce754a25" + const btcTxid1 = "5ad004d3cae3204048ceb2b119b060a5e8cf07b94e39d92a79386677106312ed" + const btcTxid2 = "a2f2bd19f2d294eec53e0421069c82b949253260c2cadf54eb1f823856923799" + + beforeEach('create contracts', async function () { + wbtc = await WBTC.new(); + controller = await Controller.new(wbtc.address); + members = await Members.new(admin); + factory = await Factory.new(controller.address); + + await controller.setFactory(factory.address) + await controller.setMembers(members.address) + + await wbtc.transferOwnership(controller.address) + await controller.callClaimOwnership(wbtc.address) + + await members.setCustodian(custodian0); + await members.addMerchant(merchant0); + await members.addMerchant(merchant1); + await members.addMerchant(merchant2); // this merchant does not set btc deposit address + + await factory.setMerchantBtcDepositAddress(merchant0BtcDepositAddress, {from: merchant0}); + await factory.setMerchantBtcDepositAddress(merchant1BtcDepositAddress, {from: merchant1}); + + await factory.setCustodianBtcDepositAddress(merchant0, custodianBtcDepositAddressForMerchant0, {from: custodian0}); + await factory.setCustodianBtcDepositAddress(merchant1, custodianBtcDepositAddressForMerchant1, {from: custodian0}); + await factory.setCustodianBtcDepositAddress(merchant2, custodianBtcDepositAddressForMerchant2, {from: custodian0}); + + }); + + describe('as merchant', function () { + const from = merchant0; + const amount = 100; + + it("check setMerchantBtcDepositAddress", async function () { + await factory.setMerchantBtcDepositAddress(merchant0BtcDepositAddress, {from}); + const merchantBtcDepositAddress = await factory.merchantBtcDepositAddress(merchant0); + assert.equal(merchantBtcDepositAddress, merchant0BtcDepositAddress); + }); + + it("setMerchantBtcDepositAddress with empty string reverts", async function () { + await expectThrow(factory.setMerchantBtcDepositAddress("", {from})); + }); + + it("setMerchantBtcDepositAddress emits event", async function () { + const { logs } = await factory.setMerchantBtcDepositAddress(merchant0BtcDepositAddress, {from}); + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'MerchantBtcDepositAddressSet'); + assert.equal(logs[0].args.merchant, merchant0); + assert.equal(logs[0].args.btcDepositAddress, merchant0BtcDepositAddress); + }); + + it("addMintRequest", async function () { + const balanceBefore = await wbtc.balanceOf(merchant0) + assert.equal(balanceBefore, 0); + + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + const timestamp = logs[0].args.timestamp; + const hash = logs[0].args.requestHash; + + const request = await factory.getMintRequest(0); + assert.equal(request[REQUEST_NONCE_FIELD], 0) + assert.equal(request[REQUEST_REQUESTER_FIELD], merchant0) + assert.equal(request[REQUEST_AMOUNT_FIELD], amount) + assert.equal(request[REQUEST_BTC_DEPOSIT_ADDRESS_FIELD], custodianBtcDepositAddressForMerchant0) + assert.equal(request[REQUEST_BTC_TXID_FIELD], btcTxid0) + assert.equal((request[REQUEST_TIMESTAMP_FIELD]).valueOf(), timestamp.valueOf()) + assert.equal(request[REQUEST_STATUS_FIELD], REQUEST_STATUS_PENDING) + assert.equal(request[REQUEST_HASH_FIELD], hash) + + // verify balance is still 0 (actual mint is not done yet) + const balanceAfter = await wbtc.balanceOf(merchant0) + assert.equal(balanceAfter, 0); + }); + + it("addMintRequest with empty btcDepositAdress fails", async function () { + await expectThrow(factory.addMintRequest(amount, btcTxid0, "", {from})); + }); + + it("addMintRequest with non existing btcDepositAdress fails", async function () { + await expectThrow(factory.addMintRequest(amount, btcTxid0, otherBtcAddress, {from})); + }); + + it("addMintRequest with other merchant's custodian btcDepositAdress fails", async function () { + await expectThrow(factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant1, {from})); + }); + + it("addMintRequest sets request status to pending", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + + const request = await factory.getMintRequest(0); + assert.equal(request[REQUEST_STATUS_FIELD], REQUEST_STATUS_PENDING) + }); + + it("addMintRequest emits an event", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'MintRequestAdd'); + + assert.equal(logs[0].args.nonce, 0); + assert.equal(logs[0].args.requester, merchant0); + assert.equal(logs[0].args.amount, amount); + assert.equal(logs[0].args.btcDepositAddress, custodianBtcDepositAddressForMerchant0); + assert.equal(logs[0].args.btcTxid, btcTxid0); + assert.notEqual(logs[0].args.timestamp, 0); + assert.notEqual(logs[0].args.requestHash, 0); + }); + + it("add several mint requests and see nonce is incremented", async function () { + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.addMintRequest(amount, btcTxid1, custodianBtcDepositAddressForMerchant0, {from}); + const { logs } = await factory.addMintRequest(amount, btcTxid2, custodianBtcDepositAddressForMerchant0, {from}); + + assert.equal(logs[0].args.nonce, 2); + const request = await factory.getMintRequest(2); + assert.equal(request[REQUEST_NONCE_FIELD], 2) + assert.equal(request[REQUEST_BTC_TXID_FIELD], btcTxid2) + }); + + it("cancelMintRequest", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + const hash = logs[0].args.requestHash; + + await factory.cancelMintRequest(hash, {from}); + const request = await factory.getMintRequest(0); + assert.equal(request[REQUEST_STATUS_FIELD], REQUEST_STATUS_CANCELED) + }); + + it("cancelMintRequest for 0 request hash fails", async function () { + await expectThrow(factory.cancelMintRequest(0, {from}), "request hash is 0"); + }); + + it("cancelMintRequest for already canceled request fails", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + const hash = logs[0].args.requestHash; + await factory.cancelMintRequest(hash, {from}); + await expectThrow (factory.cancelMintRequest(hash, {from})); + }); + + it("cancelMintRequest for already confirmed request fails", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + const hash = logs[0].args.requestHash; + await factory.confirmMintRequest(hash, {from: custodian0}); + await expectThrow(factory.cancelMintRequest(hash, {from})); + }); + + it("cancelMintRequest for already rejected request fails", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + const hash = logs[0].args.requestHash; + await factory.rejectMintRequest(hash, {from: custodian0}); + await expectThrow(factory.cancelMintRequest(hash, {from})); + + }); + + it("cancelMintRequest for another merchant's request fails", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant1, {from: merchant1}); + const hash = logs[0].args.requestHash; + await expectThrow(factory.cancelMintRequest(hash, {from})); + }); + + it("cancelMintRequest with unknown request hash fails", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + + const hash = logs[0].args.requestHash; + const alteredHash = "0x0123456789012345678901234567890123456789012345678901234567890123456789012345" + + await expectThrow(factory.cancelMintRequest(alteredHash, {from})); + await factory.cancelMintRequest(hash, {from}) + }); + + it("cancelMintRequest changes request status to canceled", async function () { + const {logs} = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + const hash = logs[0].args.requestHash; + await factory.cancelMintRequest(hash, {from}) + + const request = await factory.getMintRequest(0); + assert.equal(request[REQUEST_STATUS_FIELD], REQUEST_STATUS_CANCELED) + }); + + it("cancelMintRequeste does not change request hash", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + const hash = logs[0].args.requestHash; + await factory.cancelMintRequest(hash, {from}) + + const request = await factory.getMintRequest(0); + assert.equal(request[REQUEST_HASH_FIELD], hash) + }); + + it("cancelMintRequest emits an event", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + const hash = logs[0].args.requestHash; + const tx = await factory.cancelMintRequest(hash, {from}); + + const cancelLogs = tx["logs"] + assert.equal(cancelLogs.length, 1); + assert.equal(cancelLogs[0].event, 'MintRequestCancel'); + + assert.equal(cancelLogs[0].args.nonce, 0); + assert.equal(cancelLogs[0].args.requester, merchant0); + assert.equal(cancelLogs[0].args.requestHash, hash); + }); + + it("burn", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.confirmMintRequest(logs[0].args.requestHash, {from: custodian0}) + + const balanceBefore = await wbtc.balanceOf(merchant0); + assert.equal(balanceBefore, amount); + + await wbtc.approve(factory.address, amount, {from}); + await factory.burn(amount, {from}); + + const balanceAfter = await wbtc.balanceOf(merchant0) + assert.equal(balanceAfter, 0); + }); + + it("burn without setting merchant btcDepositAdress beforehand fails", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant2, {from: merchant2}); + await factory.confirmMintRequest(logs[0].args.requestHash, {from: custodian0}); + + const balanceBefore = await wbtc.balanceOf(merchant2) + assert.equal(balanceBefore, amount); + + await wbtc.approve(factory.address, amount, {from: merchant2}); + await expectThrow(factory.burn(amount, {from: merchant2}), "merchant btc deposit address was not set"); + + await factory.setMerchantBtcDepositAddress(merchant0BtcDepositAddress, {from: merchant2}); + await factory.burn(amount, {from: merchant2}) + + const balanceAfter = await wbtc.balanceOf(merchant2) + assert.equal(balanceAfter, 0); + }); + + it("burn without allowance fails", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.confirmMintRequest(logs[0].args.requestHash, {from: custodian0}); + + await expectThrow(factory.burn(amount, {from: merchant0})); + }); + + it("burn without being the configured factory in controller fails", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.confirmMintRequest(logs[0].args.requestHash, {from: custodian0}) + await wbtc.approve(factory.address, amount, {from: merchant0}); + await controller.setFactory(other); + await expectThrow( + factory.burn(amount, {from: merchant0}), + "sender not authorized for minting or burning" + ); + }); + + it("burn sets request status to pending", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.confirmMintRequest(logs[0].args.requestHash, {from: custodian0}) + await wbtc.approve(factory.address, amount, {from}); + await factory.burn(amount, {from}); + + const request = await factory.getBurnRequest(0); + assert.equal(request[REQUEST_STATUS_FIELD], REQUEST_STATUS_PENDING); + }); + + it("burn emits an event", async function () { + const addTx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.confirmMintRequest(addTx.logs[0].args.requestHash, {from: custodian0}) + await wbtc.approve(factory.address, amount, {from}); + const { logs } = await factory.burn(amount, {from}); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Burned'); + + assert.equal(logs[0].args.nonce, 0); + assert.equal(logs[0].args.requester, merchant0); + assert.equal(logs[0].args.amount, amount); + assert.equal(logs[0].args.btcDepositAddress, merchant0BtcDepositAddress); + assert.equal(logs[0].args.btcTxid, null); // txid of burn is sent only upon confirmation. + assert.notEqual(logs[0].args.timestamp, 0); + assert.notEqual(logs[0].args.requestHash, 0); + }); + }); + + describe('as non merchant', function () { + const from = other; + const amount = 100; + + it("setMerchantBtcDepositAddress reverts", async function () { + await expectThrow( + factory.setMerchantBtcDepositAddress(merchant0BtcDepositAddress, {from}), + "sender not a merchant" + ); + }); + + it("addMintRequest reverts", async function () { + await expectThrow( + factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}), + "sender not a merchant" + ); + }); + + it("cancelMintRequest reverts", async function () { + await expectThrow( + factory.cancelMintRequest("0xab", {from}), + "sender not a merchant" + ); + }); + + it("burn reverts", async function () { + await expectThrow( + factory.burn(amount, {from}), + "sender not a merchant" + ); + }); + }); + + describe('as custodian', function () { + const from = custodian0; + const amount = 100; + + it("setCustodianBtcDepositAddress", async function () { + await factory.setCustodianBtcDepositAddress(merchant0, custodianBtcDepositAddressForMerchant0, {from}); + const custodianBtcDepositAddress = await factory.custodianBtcDepositAddress(merchant0); + assert.equal(custodianBtcDepositAddress, custodianBtcDepositAddressForMerchant0); + }); + + it("setCustodianBtcDepositAddress with 0 merchant address fails", async function () { + await expectThrow(factory.setCustodianBtcDepositAddress(0, custodianBtcDepositAddressForMerchant0, {from}), "invalid merchant address"); + }); + + it("setCustodianBtcDepositAddress with faulty merchant address fails", async function () { + await expectThrow(factory.setCustodianBtcDepositAddress(other, custodianBtcDepositAddressForMerchant0, {from}), "merchant address is not a real merchant."); + }); + + it("setCustodianBtcDepositAddress with empty string reverts", async function () { + await expectThrow( + factory.setCustodianBtcDepositAddress(merchant0, "", {from}), + "invalid btc deposit address" + ) + }); + + it("setCustodianBtcDepositAddress emits event", async function () { + const { logs } = await factory.setCustodianBtcDepositAddress(merchant0, custodianBtcDepositAddressForMerchant0, {from}); + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'CustodianBtcDepositAddressSet'); + assert.equal(logs[0].args.merchant, merchant0); + assert.equal(logs[0].args.btcDepositAddress, custodianBtcDepositAddressForMerchant0); + assert.equal(logs[0].args.sender, custodian0); + }); + + it("confirmMintRequest", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + + const balanceBefore = await wbtc.balanceOf(merchant0) + assert.equal(balanceBefore, 0); + + await factory.confirmMintRequest(tx.logs[0].args.requestHash, {from}); + + const balanceAfter = await wbtc.balanceOf(merchant0) + assert.equal(balanceAfter, amount); + }); + + it("confirmMintRequest with non exsting request hash", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await expectThrow( + factory.confirmMintRequest("hash", {from}), + "given request hash does not match a pending request" + ); + }); + + it("confirmMintRequest of cancled request fails", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.cancelMintRequest(tx.logs[0].args.requestHash, {from: merchant0}); + await expectThrow( + factory.confirmMintRequest(tx.logs[0].args.requestHash, {from}), + "request is not pending" + ); + }); + + it("confirmMintRequest of rejected request fails", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.rejectMintRequest(tx.logs[0].args.requestHash, {from: custodian0}); + await expectThrow( + factory.confirmMintRequest(tx.logs[0].args.requestHash, {from}), + "request is not pending" + ); + }); + + it("confirmMintRequest without being the configured factory in controller fails", async function () { + await controller.setFactory(other); + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await expectThrow( + factory.confirmMintRequest(tx.logs[0].args.requestHash, {from}), + "sender not authorized for minting or burning" + ); + }); + + it("confirmMintRequest of request in the middle of the list (not last)", async function () { + const tx0 = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + const tx1 = await factory.addMintRequest(amount, btcTxid1, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + const tx2 =await factory.addMintRequest(amount, btcTxid2, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + + assert.notEqual(tx0.logs[0].args.requestHash,tx1.logs[0].args.requestHash); + assert.notEqual(tx1.logs[0].args.requestHash,tx2.logs[0].args.requestHash); + assert.notEqual(tx0.logs[0].args.requestHash,tx2.logs[0].args.requestHash); + + const balanceBefore = await wbtc.balanceOf(merchant0) + assert.equal(balanceBefore, 0); + + await factory.confirmMintRequest(tx1.logs[0].args.requestHash, {from}); + + const balanceAfter = await wbtc.balanceOf(merchant0) + assert.equal(balanceAfter, amount); + }); + + it("confirmMintRequest does not change request hash", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + const requestBefore = await factory.getMintRequest(0); + const hashBefore = requestBefore[REQUEST_HASH_FIELD]; + + await factory.confirmMintRequest(tx.logs[0].args.requestHash, {from}); + const requestAfter = await factory.getMintRequest(0); + const hashAfter= requestAfter[REQUEST_HASH_FIELD]; + + assert.equal(hashBefore, hashAfter); + }); + + it("confirmMintRequest emits an event", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + const { logs } = await factory.confirmMintRequest(tx.logs[0].args.requestHash, {from}); + + const requestAfter = await factory.getMintRequest(0); + const hashAfter= requestAfter[REQUEST_HASH_FIELD]; + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'MintConfirmed'); + assert.equal(logs[0].args.nonce, 0); + assert.equal(logs[0].args.requester, merchant0); + assert.equal(logs[0].args.amount, amount); + assert.equal(logs[0].args.btcDepositAddress, custodianBtcDepositAddressForMerchant0); + assert.equal(logs[0].args.btcTxid, btcTxid0); + assert.notEqual(logs[0].args.timestamp, 0); + assert.equal(logs[0].args.requestHash, hashAfter); + }); + + it("rejectMintRequest", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.rejectMintRequest(tx.logs[0].args.requestHash, {from}); + + const request = await factory.getMintRequest(0); + assert.equal(request[REQUEST_STATUS_FIELD], REQUEST_STATUS_REJECTED); + }); + + it("rejectMintRequest with non exsting request hash", async function () { + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await expectThrow( + factory.rejectMintRequest("hash", {from}), + "given request hash does not match a pending request" + ); + }); + + it("rejectMintRequest of approved request fails", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.confirmMintRequest(tx.logs[0].args.requestHash, {from}); + await expectThrow( + factory.rejectMintRequest(tx.logs[0].args.requestHash, {from}), + "request is not pending" + ); + }); + + it("rejectMintRequest of canceled request fails", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.cancelMintRequest(tx.logs[0].args.requestHash, {from: merchant0}); + await expectThrow( + factory.rejectMintRequest(tx.logs[0].args.requestHash, {from}), + "request is not pending" + ); + }); + + it("rejectMintRequest of rejected request fails", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.rejectMintRequest(tx.logs[0].args.requestHash, {from}); + await expectThrow( + factory.rejectMintRequest(tx.logs[0].args.requestHash, {from}), + "request is not pending" + ); + }); + + it("rejectMintRequest does not change request hash", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + const requestBefore = await factory.getMintRequest(0); + const hashBefore = requestBefore[REQUEST_HASH_FIELD]; + + await factory.rejectMintRequest(tx.logs[0].args.requestHash, {from}); + const requestAfter = await factory.getMintRequest(0); + const hashAfter= requestAfter[REQUEST_HASH_FIELD]; + + assert.equal(hashBefore, hashAfter); + }); + + it("rejectMintRequest emits an event", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + const { logs } = await factory.rejectMintRequest(tx.logs[0].args.requestHash, {from}); + + const requestAfter = await factory.getMintRequest(0); + const hashAfter= requestAfter[REQUEST_HASH_FIELD]; + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'MintRejected'); + assert.equal(logs[0].args.nonce, 0); + assert.equal(logs[0].args.requester, merchant0); + assert.equal(logs[0].args.amount, amount); + assert.equal(logs[0].args.btcDepositAddress, custodianBtcDepositAddressForMerchant0); + assert.equal(logs[0].args.btcTxid, btcTxid0); + assert.notEqual(logs[0].args.timestamp, 0); + assert.equal(logs[0].args.requestHash, hashAfter); + }); + + it("confirmBurnRequest", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.confirmMintRequest(logs[0].args.requestHash, {from}) + await wbtc.approve(factory.address, amount, {from: merchant0}); + const tx = await factory.burn(amount, {from: merchant0}); + await factory.confirmBurnRequest(tx.logs[0].args.requestHash, btcTxid0, {from}); + + const request = await factory.getBurnRequest(0); + assert.equal(request[REQUEST_STATUS_FIELD], REQUEST_STATUS_APPROVED); + }); + + it("confirmBurnRequest with 0 hash fails", async function () { + await expectThrow(factory.confirmBurnRequest(0, btcTxid0, {from}), "request hash is 0"); + }); + + it("confirmBurnRequest with non exsting request hash", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.confirmMintRequest(logs[0].args.requestHash, {from}) + await wbtc.approve(factory.address, amount, {from: merchant0}); + await factory.burn(amount, {from: merchant0}); + await expectThrow( + factory.confirmBurnRequest("hash", btcTxid0, {from}), + "given request hash does not match a pending request" + ); + }); + + it("confirmBurnRequest of request in the middle of the list (not last)", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.confirmMintRequest(tx.logs[0].args.requestHash, {from}) + + await wbtc.approve(factory.address, amount, {from: merchant0}); + const tx0 = await factory.burn(amount / 4 , {from: merchant0}); + const tx1 = await factory.burn(amount / 4 , {from: merchant0}); + const tx2 = await factory.burn(amount / 4 , {from: merchant0}); + const tx3 = await factory.burn(amount / 4 , {from: merchant0}); + + await factory.confirmBurnRequest(tx2.logs[0].args.requestHash, btcTxid0, {from}); + + const request0 = await factory.getBurnRequest(0); + const request1 = await factory.getBurnRequest(1); + const request2 = await factory.getBurnRequest(2); + const request3 = await factory.getBurnRequest(3); + assert.equal(request0[REQUEST_STATUS_FIELD], REQUEST_STATUS_PENDING); + assert.equal(request1[REQUEST_STATUS_FIELD], REQUEST_STATUS_PENDING); + assert.equal(request2[REQUEST_STATUS_FIELD], REQUEST_STATUS_APPROVED); + assert.equal(request3[REQUEST_STATUS_FIELD], REQUEST_STATUS_PENDING); + }); + + it("confirmBurnRequest does change the request hash", async function () { + const { logs } = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.confirmMintRequest(logs[0].args.requestHash, {from}) + await wbtc.approve(factory.address, amount, {from: merchant0}); + + await factory.burn(amount, {from: merchant0}); + const requestBefore = await factory.getBurnRequest(0); + await factory.confirmBurnRequest(requestBefore[REQUEST_HASH_FIELD], btcTxid0, {from}) + const requestAfter = await factory.getBurnRequest(0); + assert.notEqual(requestBefore[REQUEST_HASH_FIELD], requestAfter[REQUEST_HASH_FIELD]); + }); + + it("confirmBurnRequest emits an event", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from: merchant0}); + await factory.confirmMintRequest(tx.logs[0].args.requestHash, {from}) + await wbtc.approve(factory.address, amount, {from: merchant0}); + + await factory.burn(amount, {from: merchant0}); + const request = await factory.getBurnRequest(0); + const { logs } = await factory.confirmBurnRequest(request[REQUEST_HASH_FIELD], btcTxid0, {from}) + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'BurnConfirmed'); + assert.equal(logs[0].args.nonce, 0); + assert.equal(logs[0].args.requester, merchant0); + assert.equal(logs[0].args.amount, amount); + assert.equal(logs[0].args.btcDepositAddress, merchant0BtcDepositAddress); + assert.equal(logs[0].args.btcTxid, btcTxid0); + assert.notEqual(logs[0].args.timestamp, 0); + assert.equal(logs[0].args.inputRequestHash, request[REQUEST_HASH_FIELD]); + }); + }); + + describe('as non custodian', function () { + const from = other; + const amount = 100; + + it("setCustodianBtcDepositAddress reverts", async function () { + await expectThrow( + factory.setCustodianBtcDepositAddress(merchant0, custodianBtcDepositAddressForMerchant0, {from: other}), + "sender not a custodian" + ); + }); + + it("confirmMintRequest reverts", async function () { + await expectThrow( + factory.confirmMintRequest("hash", {from: other}), + "sender not a custodian" + ); + }); + + it("rejectMintRequest reverts", async function () { + await expectThrow( + factory.rejectMintRequest("hash", {from: other}), + "sender not a custodian" + ); + }); + + it("confirmBurnRequest reverts", async function () { + await expectThrow( + factory.confirmBurnRequest("hash", btcTxid0, {from}), + "sender not a custodian" + ); + }); + }); + + describe('as anyone', function () { + const from = merchant0; + const amount = 60; + + it("check creae contract with 0 controller address fails", async function () { + await expectThrow(Factory.new(0), "invalid _controller address"); + }); + + it("getMintRequestsLength", async function () { + const lengthBefore = await factory.getMintRequestsLength(); + assert.equal(lengthBefore, 0); + + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + + const lengthAfter = await factory.getMintRequestsLength(); + assert.equal(lengthAfter, 5); + }); + + it("getBurnRequestsLength", async function () { + const tx = await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.confirmMintRequest(tx.logs[0].args.requestHash, {from: custodian0}) + + const lengthBefore = await factory.getBurnRequestsLength(); + assert.equal(lengthBefore, 0); + + await wbtc.approve(factory.address, amount, {from}); + await factory.burn(amount/3, {from}); + await factory.burn(amount/3, {from}); + await factory.burn(amount/3, {from}); + + const lengthAfter = await factory.getBurnRequestsLength(); + assert.equal(lengthAfter, 3); + }); + + it("getMintRequests with invalid nonce", async function () { + const lengthBefore = await factory.getMintRequestsLength(); + assert.equal(lengthBefore, 0); + + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + await factory.addMintRequest(amount, btcTxid0, custodianBtcDepositAddressForMerchant0, {from}); + + const lengthAfter = await factory.getMintRequestsLength(); + assert.equal(lengthAfter, 5); + }); + }); +}); + diff --git a/ethereum/test/factory/members.js b/ethereum/test/factory/members.js new file mode 100644 index 0000000..f55212a --- /dev/null +++ b/ethereum/test/factory/members.js @@ -0,0 +1,122 @@ +const BigNumber = web3.BigNumber + +const { ZEPPELIN_LOCATION } = require("../helper.js"); +const { expectThrow } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/expectThrow'); + +require("chai") + .use(require("chai-as-promised")) + .use(require('chai-bignumber')(BigNumber)) + .should() + +const Members = artifacts.require("./factory/Members.sol"); + +contract('Members', function(accounts) { + + beforeEach('setup contract for each test', async () => { + admin = accounts[0]; + user1 = accounts[1]; + user2 = accounts[2]; + user3 = accounts[3]; + user4 = accounts[4]; + user5 = accounts[5]; + user6 = accounts[6]; + members = await Members.new(admin); + }); + + it("create members with 0 owner address parameter fails.", async function () { + await expectThrow(Members.new(0), "invalid _owner address"); + }); + + it("set a custodian.", async function () { + await members.setCustodian(user1); + + custodian0 = await members.custodian(); + custodian0.should.equal(user1); + }); + + it("set a custodian with 0 address fails.", async function () { + await expectThrow(members.setCustodian(0), "invalid custodian address"); + }); + + it("set a custodian not as owner.", async function () { + await expectThrow(members.setCustodian(user1, {from:user1})); + }); + + it("add a merchant.", async function () { + await members.addMerchant(user1); + + merchant0 = await members.getMerchant(0); + merchants = await members.getMerchants(); + + merchant0.should.equal(user1); + (merchants.length).should.equal(1); + merchants[0].should.equal(user1); + }); + + it("add a merchant with 0 address fails.", async function () { + await expectThrow(members.addMerchant(0), "invalid merchant address"); + }); + + it("remove a merchant.", async function () { + await members.addMerchant(user1); + await members.addMerchant(user2); + await members.removeMerchant(user1); + + merchant0 = await members.getMerchant(0); + merchants = await members.getMerchants(); + + merchant0.should.equal(user2); + (merchants.length).should.equal(1); + merchants[0].should.equal(user2); + }); + + it("remove merchant with 0 address fails.", async function () { + await expectThrow(members.removeMerchant(0), "invalid merchant address"); + }); + + it("remove a merchant which was already removed.", async function () { + await members.addMerchant(user1); + await members.removeMerchant(user1); + await expectThrow(members.removeMerchant(user1), "merchant remove failed"); + }); + + it("add a merchant not as owner.", async function () { + await expectThrow(members.addMerchant(user1, {from:user1})); + }); + + it("add a merchant which was already added.", async function () { + members.addMerchant(user1); + await expectThrow(members.addMerchant(user1), "merchant add failed"); + }); + + it("remove a merchant not as owner.", async function () { + await members.addMerchant(user1); + await expectThrow(members.removeMerchant(user1, {from:user1})); + }); + + it("add a few merchants and get the entire list.", async function () { + await members.addMerchant(user1); + await members.addMerchant(user2); + await members.addMerchant(user3); + await members.removeMerchant(user3); + await members.removeMerchant(user2); + await members.addMerchant(user4); + await members.addMerchant(user5); + await members.addMerchant(user6); + await members.removeMerchant(user5); + // at this level should have users 1, 4, 6 + + merchants = await members.getMerchants(); + merchant0 = await members.getMerchant(0); + merchant1 = await members.getMerchant(1); + merchant2 = await members.getMerchant(2); + + (merchants.length).should.equal(3); + merchants[0].should.equal(user1) + merchants[1].should.equal(user4) + merchants[2].should.equal(user6) + merchant0.should.equal(user1) + merchant1.should.equal(user4) + merchant2.should.equal(user6) + }); +}); diff --git a/ethereum/test/helper.js b/ethereum/test/helper.js new file mode 100644 index 0000000..237a3b4 --- /dev/null +++ b/ethereum/test/helper.js @@ -0,0 +1,12 @@ +let findParentDir = require('find-parent-dir'); + +const repoName = 'bitcoin-token-smart-contracts' +const repoRootDir = findParentDir.sync(__dirname, repoName); + +/* +since zeppelin js code is require from different locations depending +on coverage mode or not, it needs to be required using an absolute path. +*/ +module.exports.ZEPPELIN_LOCATION = repoRootDir + repoName + '/node_modules/' + +module.exports.ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; \ No newline at end of file diff --git a/ethereum/test/token/BasicToken.behaviour.js b/ethereum/test/token/BasicToken.behaviour.js new file mode 100644 index 0000000..03ed9f0 --- /dev/null +++ b/ethereum/test/token/BasicToken.behaviour.js @@ -0,0 +1,79 @@ +const { ZEPPELIN_LOCATION, ZERO_ADDRESS } = require("../helper.js"); +const { assertRevert } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/assertRevert'); + +function shouldBehaveLikeBasicToken ([owner, recipient, anotherAccount]) { + + describe('total supply', function () { + it('returns the total amount of tokens', async function () { + const totalSupply = await this.token.totalSupply(); + + assert.equal(totalSupply, 100); + }); + }); + + describe('balanceOf', function () { + describe('when the requested account has no tokens', function () { + it('returns zero', async function () { + const balance = await this.token.balanceOf(anotherAccount); + + assert.equal(balance, 0); + }); + }); + + describe('when the requested account has some tokens', function () { + it('returns the total amount of tokens', async function () { + const balance = await this.token.balanceOf(owner); + + assert.equal(balance, 100); + }); + }); + }); + + describe('transfer', function () { + describe('when the recipient is not the zero address', function () { + const to = recipient; + + describe('when the sender does not have enough balance', function () { + const amount = 101; + + it('reverts', async function () { + await assertRevert(this.token.transfer(to, amount, { from: owner })); + }); + }); + + describe('when the sender has enough balance', function () { + const amount = 100; + + it('transfers the requested amount', async function () { + await this.token.transfer(to, amount, { from: owner }); + + const senderBalance = await this.token.balanceOf(owner); + assert.equal(senderBalance, 0); + + const recipientBalance = await this.token.balanceOf(to); + assert.equal(recipientBalance, amount); + }); + + it('emits a transfer event', async function () { + const { logs } = await this.token.transfer(to, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Transfer'); + assert.equal(logs[0].args.from, owner); + assert.equal(logs[0].args.to, to); + assert(logs[0].args.value.eq(amount)); + }); + }); + }); + + describe('when the recipient is the zero address', function () { + const to = ZERO_ADDRESS; + + it('reverts', async function () { + await assertRevert(this.token.transfer(to, 100, { from: owner })); + }); + }); + }); +}; + +module.exports = { shouldBehaveLikeBasicToken }; diff --git a/ethereum/test/token/BurnableToken.behaviour.js b/ethereum/test/token/BurnableToken.behaviour.js new file mode 100644 index 0000000..949da1a --- /dev/null +++ b/ethereum/test/token/BurnableToken.behaviour.js @@ -0,0 +1,65 @@ +const BigNumber = web3.BigNumber; + +const { ZEPPELIN_LOCATION, ZERO_ADDRESS } = require("../helper.js"); +const { assertRevert } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/assertRevert'); +const { inLogs } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/expectEvent'); + +require('chai') + .use(require('chai-bignumber')(BigNumber)) + .should(); + +function shouldBehaveLikeBurnableToken ([owner, anotherAccount], initialBalance) { + describe('as a basic burnable token', function () { + describe('when the sender is the token owner', function () { + + const from = owner; + + describe('when the given amount is not greater than balance of the sender', function () { + const amount = 100; + + beforeEach(async function () { + ({ logs: this.logs } = await this.token.burn(amount, { from })); + }); + + it('burns the requested amount', async function () { + const balance = await this.token.balanceOf(from); + balance.should.be.bignumber.equal(initialBalance - amount); + }); + + it('emits a burn event', async function () { + const event = await inLogs(this.logs, 'Burn'); + event.args.burner.should.eq(owner); + event.args.value.should.be.bignumber.equal(amount); + }); + + it('emits a transfer event', async function () { + const event = await inLogs(this.logs, 'Transfer'); + event.args.from.should.eq(owner); + event.args.to.should.eq(ZERO_ADDRESS); + event.args.value.should.be.bignumber.equal(amount); + }); + }); + + describe('when the given amount is greater than the balance of the sender', function () { + const amount = initialBalance + 1; + + it('reverts', async function () { + await assertRevert(this.token.burn(amount, { from })); + }); + }); + }); + + describe('when the sender is not the token owner', function () { + const from = anotherAccount; + const amount = 100; + + it('reverts', async function () { + await assertRevert(this.token.burn(amount, { from })); + }); + }); + }); +} + +module.exports = { + shouldBehaveLikeBurnableToken, +}; diff --git a/ethereum/test/token/CanReclaimToken.behaviour.js b/ethereum/test/token/CanReclaimToken.behaviour.js new file mode 100644 index 0000000..495a357 --- /dev/null +++ b/ethereum/test/token/CanReclaimToken.behaviour.js @@ -0,0 +1,23 @@ +const { ZEPPELIN_LOCATION } = require("../helper.js"); +const { expectThrow } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/expectThrow'); + +function shouldBehaveLikeCanReclaimToken(accounts) { + + it('should allow owner to reclaim tokens', async function () { + const ownerStartBalance = await token.balanceOf(accounts[0]); + await canReclaimToken.reclaimToken(token.address); + const ownerFinalBalance = await token.balanceOf(accounts[0]); + const finalBalance = await token.balanceOf(canReclaimToken.address); + assert.equal(finalBalance, 0); + assert.equal(ownerFinalBalance - ownerStartBalance, 10); + }); + + it('should allow only owner to reclaim tokens', async function () { + await expectThrow( + canReclaimToken.reclaimToken(token.address, { from: accounts[1] }), + ); + }); +}; + + +module.exports = { shouldBehaveLikeCanReclaimToken }; diff --git a/ethereum/test/token/Claimable.behaviour.js b/ethereum/test/token/Claimable.behaviour.js new file mode 100644 index 0000000..f6b83bf --- /dev/null +++ b/ethereum/test/token/Claimable.behaviour.js @@ -0,0 +1,51 @@ +const { ZEPPELIN_LOCATION } = require("../helper.js"); +const { assertRevert } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/assertRevert'); + +const Claimable = artifacts.require('Claimable'); + +function shouldBehaveLikeClaimable (accounts) { + + it('should have an owner', async function () { + const owner = await claimable.owner(); + assert.isTrue(owner !== 0); + }); + + it('changes pendingOwner after transfer', async function () { + const newOwner = accounts[1]; + await claimable.transferOwnership(newOwner); + const pendingOwner = await claimable.pendingOwner(); + + assert.isTrue(pendingOwner === newOwner); + }); + + it('should prevent to claimOwnership from no pendingOwner', async function () { + await assertRevert(claimable.claimOwnership({ from: accounts[2] })); + }); + + it('should prevent non-owners from transfering', async function () { + const other = accounts[2]; + const owner = await claimable.owner.call(); + + assert.isTrue(owner !== other); + await assertRevert(claimable.transferOwnership(other, { from: other })); + }); + + describe('after initiating a transfer', function () { + let newOwner; + + beforeEach(async function () { + newOwner = accounts[1]; + await claimable.transferOwnership(newOwner); + }); + + it('changes allow pending owner to claim ownership', async function () { + await claimable.claimOwnership({ from: newOwner }); + const owner = await claimable.owner(); + + assert.isTrue(owner === newOwner); + }); + }); +}; + +module.exports = { shouldBehaveLikeClaimable }; + diff --git a/ethereum/test/token/DetailedERC20.behaviour.js b/ethereum/test/token/DetailedERC20.behaviour.js new file mode 100644 index 0000000..fce5223 --- /dev/null +++ b/ethereum/test/token/DetailedERC20.behaviour.js @@ -0,0 +1,25 @@ +const BigNumber = web3.BigNumber; + +require('chai') + .use(require('chai-bignumber')(BigNumber)) + .should(); + +function shouldBehaveLikeDetailedERC20 (accounts, _name, _symbol, _decimals) { + + it('has a name', async function () { + const name = await this.detailedERC20.name(); + name.should.be.equal(_name); + }); + + it('has a symbol', async function () { + const symbol = await this.detailedERC20.symbol(); + symbol.should.be.equal(_symbol); + }); + + it('has an amount of decimals', async function () { + const decimals = await this.detailedERC20.decimals(); + decimals.should.be.bignumber.equal(_decimals); + }); +}; + +module.exports = { shouldBehaveLikeDetailedERC20 }; diff --git a/ethereum/test/token/HasNoEther.behaviour.js b/ethereum/test/token/HasNoEther.behaviour.js new file mode 100644 index 0000000..2fb4f89 --- /dev/null +++ b/ethereum/test/token/HasNoEther.behaviour.js @@ -0,0 +1,32 @@ +const { ZEPPELIN_LOCATION } = require("../helper.js"); +const { expectThrow } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/expectThrow'); +const { ethSendTransaction, ethGetBalance } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/web3'); + +const HasNoEtherTest = artifacts.require('WBTC'); + +function shouldBehaveLikeHasNoEther (accounts) { + + const amount = web3.toWei('1', 'ether'); + + it('should be constructible', async function () { + await HasNoEtherTest.new(); + }); + + it('should not accept ether in constructor', async function () { + await expectThrow(HasNoEtherTest.new({ value: amount }), "Cannot send value to non-payable constructor"); + }); + + it('should not accept ether', async function () { + const hasNoEther = await HasNoEtherTest.new(); + + await expectThrow( + ethSendTransaction({ + from: accounts[1], + to: hasNoEther.address, + value: amount, + }), + ); + }); +}; + +module.exports = { shouldBehaveLikeHasNoEther }; diff --git a/ethereum/test/token/MintableToken.behaviour.js b/ethereum/test/token/MintableToken.behaviour.js new file mode 100644 index 0000000..914b80f --- /dev/null +++ b/ethereum/test/token/MintableToken.behaviour.js @@ -0,0 +1,158 @@ +const BigNumber = web3.BigNumber; + +const { ZEPPELIN_LOCATION } = require("../helper.js"); +const { assertRevert } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/assertRevert'); + +require('chai') + .use(require('chai-bignumber')(BigNumber)) + .should(); + +function shouldBehaveLikeMintableToken ([owner, anotherAccount, minter]) { + describe('as a basic mintable token', function () { + describe('after token creation', function () { + it('sender should be token owner', async function () { + const tokenOwner = await this.token.owner({ from: owner }); + tokenOwner.should.equal(owner); + }); + }); + + describe('minting finished', function () { + describe('when the token minting is not finished', function () { + it('returns false', async function () { + const mintingFinished = await this.token.mintingFinished(); + assert.equal(mintingFinished, false); + }); + }); + + describe('when the token is minting finished', function () { + beforeEach(async function () { + await this.token.finishMinting({ from: owner }); + }); + + // finish minting should have no affect in WBTC. + it('returns false', async function () { + const mintingFinished = await this.token.mintingFinished(); + assert.equal(mintingFinished, false); + }); + }); + }); + + describe('finish minting', function () { + describe('when the sender is the token owner', function () { + const from = owner; + + describe('when the token minting was not finished', function () { + it('finishes token minting', async function () { + await this.token.finishMinting({ from }); + + // finish minting should have no affect in WBTC. + const mintingFinished = await this.token.mintingFinished(); + assert.equal(mintingFinished, false); + }); + + // finish minting should have no affect in WBTC. + it('does not emit a mint finished event', async function () { + const { logs } = await this.token.finishMinting({ from }); + + assert.equal(logs.length, 0); + //assert.equal(logs[0].event, 'MintFinished'); + }); + }); + + describe('when the token minting was already finished', function () { + beforeEach(async function () { + await this.token.finishMinting({ from }); + }); + + // finish minting should have no affect in WBTC so the below should not revert. + it('does not revert', async function () { + await this.token.finishMinting({ from }); + }); + }); + }); + + describe('when the sender is not the token owner', function () { + const from = anotherAccount; + + describe('when the token minting was not finished', function () { + it('reverts', async function () { + await assertRevert(this.token.finishMinting({ from })); + }); + }); + + describe('when the token minting was already finished', function () { + beforeEach(async function () { + await this.token.finishMinting({ from: owner }); + }); + + // finish minting still has the onlyOwner modifier so should revert from non owner. + it('revert', async function () { + await assertRevert(this.token.finishMinting({ from })); + }); + }); + }); + }); + + describe('mint', function () { + const amount = 100; + + describe('when the sender has the minting permission', function () { + const from = minter; + + describe('when the token minting is not finished', function () { + it('mints the requested amount', async function () { + await this.token.mint(owner, amount, { from }); + + const balance = await this.token.balanceOf(owner); + assert.equal(balance, amount); + }); + + it('emits a mint and a transfer event', async function () { + const { logs } = await this.token.mint(owner, amount, { from }); + + assert.equal(logs.length, 2); + assert.equal(logs[0].event, 'Mint'); + assert.equal(logs[0].args.to, owner); + assert.equal(logs[0].args.amount, amount); + assert.equal(logs[1].event, 'Transfer'); + }); + }); + + describe('when the token minting is finished', function () { + beforeEach(async function () { + await this.token.finishMinting({ from: owner }); + }); + + // finish minting should have no affect in WBTC so the below should not revert. + it('does not revert', async function () { + await this.token.mint(owner, amount, { from }); + }); + }); + }); + + describe('when the sender has not the minting permission', function () { + const from = anotherAccount; + + describe('when the token minting is not finished', function () { + it('reverts', async function () { + await assertRevert(this.token.mint(owner, amount, { from })); + }); + }); + + describe('when the token minting is already finished', function () { + beforeEach(async function () { + await this.token.finishMinting({ from: owner }); + }); + + it('reverts', async function () { + await assertRevert(this.token.mint(owner, amount, { from })); + }); + }); + }); + }); + }); +} + +module.exports = { + shouldBehaveLikeMintableToken, +}; diff --git a/ethereum/test/token/Ownable.behaviour.js b/ethereum/test/token/Ownable.behaviour.js new file mode 100644 index 0000000..ea05b90 --- /dev/null +++ b/ethereum/test/token/Ownable.behaviour.js @@ -0,0 +1,56 @@ +const { ZEPPELIN_LOCATION, ZERO_ADDRESS } = require("../helper.js"); +const { expectThrow } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/expectThrow'); +const { EVMRevert } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/EVMRevert'); + +require('chai') + .should(); + +function shouldBehaveLikeOwnable (accounts) { + describe('as an ownable', function () { + it('should have an owner', async function () { + const owner = await this.ownable.owner(); + owner.should.not.eq(ZERO_ADDRESS); + }); + + // since need to also claim ownership, simple transfer ownership is not enoguh + it('does not change owner after transfer without claim', async function () { + const other = accounts[1]; + await this.ownable.transferOwnership(other); + const owner = await this.ownable.owner(); + + owner.should.not.eq(other); + }); + + it('should prevent non-owners from transfering', async function () { + const other = accounts[2]; + const owner = await this.ownable.owner.call(); + owner.should.not.eq(other); + await expectThrow(this.ownable.transferOwnership(other, { from: other }), EVMRevert); + }); + + // since transfer ownership awaits claim, transfer to 0 address can not happen implicitly. + it('should not revert for transferownership to 0 address', async function () { + const originalOwner = await this.ownable.owner(); + await this.ownable.transferOwnership(null, { from: originalOwner }); + }); + + it('does not lose owner after renouncement', async function () { + const ownerBefore = await this.ownable.owner(); + await expectThrow(this.ownable.renounceOwnership(), EVMRevert); + const ownerAfter = await this.ownable.owner(); + ownerAfter.should.not.eq(ZERO_ADDRESS); + ownerAfter.should.eq(ownerBefore); + }); + + it('should prevent non-owners from renouncement', async function () { + const other = accounts[2]; + const owner = await this.ownable.owner.call(); + owner.should.not.eq(other); + await expectThrow(this.ownable.renounceOwnership({ from: other }), EVMRevert); + }); + }); +} + +module.exports = { + shouldBehaveLikeOwnable, +}; diff --git a/ethereum/test/token/PausableToken.behaviour.js b/ethereum/test/token/PausableToken.behaviour.js new file mode 100644 index 0000000..699b404 --- /dev/null +++ b/ethereum/test/token/PausableToken.behaviour.js @@ -0,0 +1,264 @@ +const { ZEPPELIN_LOCATION } = require("../helper.js"); +const { assertRevert } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/assertRevert'); + +function shouldBehaveLikePausableToken ([owner, recipient, anotherAccount]) { + + describe('pause', function () { + describe('when the sender is the token owner', function () { + const from = owner; + + describe('when the token is unpaused', function () { + it('pauses the token', async function () { + await this.token.pause({ from }); + + const paused = await this.token.paused(); + assert.equal(paused, true); + }); + + it('emits a Pause event', async function () { + const { logs } = await this.token.pause({ from }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Pause'); + }); + }); + + describe('when the token is paused', function () { + beforeEach(async function () { + await this.token.pause({ from }); + }); + + it('reverts', async function () { + await assertRevert(this.token.pause({ from })); + }); + }); + }); + + describe('when the sender is not the token owner', function () { + const from = anotherAccount; + + it('reverts', async function () { + await assertRevert(this.token.pause({ from })); + }); + }); + }); + + describe('unpause', function () { + describe('when the sender is the token owner', function () { + const from = owner; + + describe('when the token is paused', function () { + beforeEach(async function () { + await this.token.pause({ from }); + }); + + it('unpauses the token', async function () { + await this.token.unpause({ from }); + + const paused = await this.token.paused(); + assert.equal(paused, false); + }); + + it('emits an Unpause event', async function () { + const { logs } = await this.token.unpause({ from }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Unpause'); + }); + }); + + describe('when the token is unpaused', function () { + it('reverts', async function () { + await assertRevert(this.token.unpause({ from })); + }); + }); + }); + + describe('when the sender is not the token owner', function () { + const from = anotherAccount; + + it('reverts', async function () { + await assertRevert(this.token.unpause({ from })); + }); + }); + }); + + describe('pausable token', function () { + const from = owner; + + describe('paused', function () { + it('is not paused by default', async function () { + const paused = await this.token.paused({ from }); + + assert.equal(paused, false); + }); + + it('is paused after being paused', async function () { + await this.token.pause({ from }); + const paused = await this.token.paused({ from }); + + assert.equal(paused, true); + }); + + it('is not paused after being paused and then unpaused', async function () { + await this.token.pause({ from }); + await this.token.unpause({ from }); + const paused = await this.token.paused(); + + assert.equal(paused, false); + }); + }); + + describe('transfer', function () { + it('allows to transfer when unpaused', async function () { + await this.token.transfer(recipient, 100, { from: owner }); + + const senderBalance = await this.token.balanceOf(owner); + assert.equal(senderBalance, 0); + + const recipientBalance = await this.token.balanceOf(recipient); + assert.equal(recipientBalance, 100); + }); + + it('allows to transfer when paused and then unpaused', async function () { + await this.token.pause({ from: owner }); + await this.token.unpause({ from: owner }); + + await this.token.transfer(recipient, 100, { from: owner }); + + const senderBalance = await this.token.balanceOf(owner); + assert.equal(senderBalance, 0); + + const recipientBalance = await this.token.balanceOf(recipient); + assert.equal(recipientBalance, 100); + }); + + it('reverts when trying to transfer when paused', async function () { + await this.token.pause({ from: owner }); + + await assertRevert(this.token.transfer(recipient, 100, { from: owner })); + }); + }); + + describe('approve', function () { + it('allows to approve when unpaused', async function () { + await this.token.approve(anotherAccount, 40, { from: owner }); + + const allowance = await this.token.allowance(owner, anotherAccount); + assert.equal(allowance, 40); + }); + + it('allows to transfer when paused and then unpaused', async function () { + await this.token.pause({ from: owner }); + await this.token.unpause({ from: owner }); + + await this.token.approve(anotherAccount, 40, { from: owner }); + + const allowance = await this.token.allowance(owner, anotherAccount); + assert.equal(allowance, 40); + }); + + it('reverts when trying to transfer when paused', async function () { + await this.token.pause({ from: owner }); + + await assertRevert(this.token.approve(anotherAccount, 40, { from: owner })); + }); + }); + + describe('transfer from', function () { + beforeEach(async function () { + await this.token.approve(anotherAccount, 50, { from: owner }); + }); + + it('allows to transfer from when unpaused', async function () { + await this.token.transferFrom(owner, recipient, 40, { from: anotherAccount }); + + const senderBalance = await this.token.balanceOf(owner); + assert.equal(senderBalance, 60); + + const recipientBalance = await this.token.balanceOf(recipient); + assert.equal(recipientBalance, 40); + }); + + it('allows to transfer when paused and then unpaused', async function () { + await this.token.pause({ from: owner }); + await this.token.unpause({ from: owner }); + + await this.token.transferFrom(owner, recipient, 40, { from: anotherAccount }); + + const senderBalance = await this.token.balanceOf(owner); + assert.equal(senderBalance, 60); + + const recipientBalance = await this.token.balanceOf(recipient); + assert.equal(recipientBalance, 40); + }); + + it('reverts when trying to transfer from when paused', async function () { + await this.token.pause({ from: owner }); + + await assertRevert(this.token.transferFrom(owner, recipient, 40, { from: anotherAccount })); + }); + }); + + describe('decrease approval', function () { + beforeEach(async function () { + await this.token.approve(anotherAccount, 100, { from: owner }); + }); + + it('allows to decrease approval when unpaused', async function () { + await this.token.decreaseApproval(anotherAccount, 40, { from: owner }); + + const allowance = await this.token.allowance(owner, anotherAccount); + assert.equal(allowance, 60); + }); + + it('allows to decrease approval when paused and then unpaused', async function () { + await this.token.pause({ from: owner }); + await this.token.unpause({ from: owner }); + + await this.token.decreaseApproval(anotherAccount, 40, { from: owner }); + + const allowance = await this.token.allowance(owner, anotherAccount); + assert.equal(allowance, 60); + }); + + it('reverts when trying to transfer when paused', async function () { + await this.token.pause({ from: owner }); + + await assertRevert(this.token.decreaseApproval(anotherAccount, 40, { from: owner })); + }); + }); + + describe('increase approval', function () { + beforeEach(async function () { + await this.token.approve(anotherAccount, 100, { from: owner }); + }); + + it('allows to increase approval when unpaused', async function () { + await this.token.increaseApproval(anotherAccount, 40, { from: owner }); + + const allowance = await this.token.allowance(owner, anotherAccount); + assert.equal(allowance, 140); + }); + + it('allows to increase approval when paused and then unpaused', async function () { + await this.token.pause({ from: owner }); + await this.token.unpause({ from: owner }); + + await this.token.increaseApproval(anotherAccount, 40, { from: owner }); + + const allowance = await this.token.allowance(owner, anotherAccount); + assert.equal(allowance, 140); + }); + + it('reverts when trying to increase approval when paused', async function () { + await this.token.pause({ from: owner }); + + await assertRevert(this.token.increaseApproval(anotherAccount, 40, { from: owner })); + }); + }); + }); +}; + +module.exports = { shouldBehaveLikePausableToken }; + diff --git a/ethereum/test/token/StandardToken.behaviour.js b/ethereum/test/token/StandardToken.behaviour.js new file mode 100644 index 0000000..c0a4d82 --- /dev/null +++ b/ethereum/test/token/StandardToken.behaviour.js @@ -0,0 +1,480 @@ +const { ZEPPELIN_LOCATION, ZERO_ADDRESS } = require("../helper.js"); +const { assertRevert } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/assertRevert'); + +function shouldBehaveLikeStandardToken ([owner, recipient, anotherAccount]) { + + describe('total supply', function () { + it('returns the total amount of tokens', async function () { + const totalSupply = await this.token.totalSupply(); + + assert.equal(totalSupply, 100); + }); + }); + + describe('balanceOf', function () { + describe('when the requested account has no tokens', function () { + it('returns zero', async function () { + const balance = await this.token.balanceOf(anotherAccount); + + assert.equal(balance, 0); + }); + }); + + describe('when the requested account has some tokens', function () { + it('returns the total amount of tokens', async function () { + const balance = await this.token.balanceOf(owner); + + assert.equal(balance, 100); + }); + }); + }); + + describe('transfer', function () { + describe('when the recipient is not the zero address', function () { + const to = recipient; + + describe('when the sender does not have enough balance', function () { + const amount = 101; + + it('reverts', async function () { + await assertRevert(this.token.transfer(to, amount, { from: owner })); + }); + }); + + describe('when the sender has enough balance', function () { + const amount = 100; + + it('transfers the requested amount', async function () { + await this.token.transfer(to, amount, { from: owner }); + + const senderBalance = await this.token.balanceOf(owner); + assert.equal(senderBalance, 0); + + const recipientBalance = await this.token.balanceOf(to); + assert.equal(recipientBalance, amount); + }); + + it('emits a transfer event', async function () { + const { logs } = await this.token.transfer(to, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Transfer'); + assert.equal(logs[0].args.from, owner); + assert.equal(logs[0].args.to, to); + assert(logs[0].args.value.eq(amount)); + }); + }); + }); + + describe('when the recipient is the zero address', function () { + const to = ZERO_ADDRESS; + + it('reverts', async function () { + await assertRevert(this.token.transfer(to, 100, { from: owner })); + }); + }); + }); + + describe('approve', function () { + describe('when the spender is not the zero address', function () { + const spender = recipient; + + describe('when the sender has enough balance', function () { + const amount = 100; + + it('emits an approval event', async function () { + const { logs } = await this.token.approve(spender, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Approval'); + assert.equal(logs[0].args.owner, owner); + assert.equal(logs[0].args.spender, spender); + assert(logs[0].args.value.eq(amount)); + }); + + describe('when there was no approved amount before', function () { + it('approves the requested amount', async function () { + await this.token.approve(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount); + }); + }); + + describe('when the spender had an approved amount', function () { + beforeEach(async function () { + await this.token.approve(spender, 1, { from: owner }); + }); + + it('approves the requested amount and replaces the previous one', async function () { + await this.token.approve(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount); + }); + }); + }); + + describe('when the sender does not have enough balance', function () { + const amount = 101; + + it('emits an approval event', async function () { + const { logs } = await this.token.approve(spender, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Approval'); + assert.equal(logs[0].args.owner, owner); + assert.equal(logs[0].args.spender, spender); + assert(logs[0].args.value.eq(amount)); + }); + + describe('when there was no approved amount before', function () { + it('approves the requested amount', async function () { + await this.token.approve(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount); + }); + }); + + describe('when the spender had an approved amount', function () { + beforeEach(async function () { + await this.token.approve(spender, 1, { from: owner }); + }); + + it('approves the requested amount and replaces the previous one', async function () { + await this.token.approve(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount); + }); + }); + }); + }); + + describe('when the spender is the zero address', function () { + const amount = 100; + const spender = ZERO_ADDRESS; + + it('approves the requested amount', async function () { + await this.token.approve(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount); + }); + + it('emits an approval event', async function () { + const { logs } = await this.token.approve(spender, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Approval'); + assert.equal(logs[0].args.owner, owner); + assert.equal(logs[0].args.spender, spender); + assert(logs[0].args.value.eq(amount)); + }); + }); + }); + + describe('transfer from', function () { + const spender = recipient; + + describe('when the recipient is not the zero address', function () { + const to = anotherAccount; + + describe('when the spender has enough approved balance', function () { + beforeEach(async function () { + await this.token.approve(spender, 100, { from: owner }); + }); + + describe('when the owner has enough balance', function () { + const amount = 100; + + it('transfers the requested amount', async function () { + await this.token.transferFrom(owner, to, amount, { from: spender }); + + const senderBalance = await this.token.balanceOf(owner); + assert.equal(senderBalance, 0); + + const recipientBalance = await this.token.balanceOf(to); + assert.equal(recipientBalance, amount); + }); + + it('decreases the spender allowance', async function () { + await this.token.transferFrom(owner, to, amount, { from: spender }); + + const allowance = await this.token.allowance(owner, spender); + assert(allowance.eq(0)); + }); + + it('emits a transfer event', async function () { + const { logs } = await this.token.transferFrom(owner, to, amount, { from: spender }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Transfer'); + assert.equal(logs[0].args.from, owner); + assert.equal(logs[0].args.to, to); + assert(logs[0].args.value.eq(amount)); + }); + }); + + describe('when the owner does not have enough balance', function () { + const amount = 101; + + it('reverts', async function () { + await assertRevert(this.token.transferFrom(owner, to, amount, { from: spender })); + }); + }); + }); + + describe('when the spender does not have enough approved balance', function () { + beforeEach(async function () { + await this.token.approve(spender, 99, { from: owner }); + }); + + describe('when the owner has enough balance', function () { + const amount = 100; + + it('reverts', async function () { + await assertRevert(this.token.transferFrom(owner, to, amount, { from: spender })); + }); + }); + + describe('when the owner does not have enough balance', function () { + const amount = 101; + + it('reverts', async function () { + await assertRevert(this.token.transferFrom(owner, to, amount, { from: spender })); + }); + }); + }); + }); + + describe('when the recipient is the zero address', function () { + const amount = 100; + const to = ZERO_ADDRESS; + + beforeEach(async function () { + await this.token.approve(spender, amount, { from: owner }); + }); + + it('reverts', async function () { + await assertRevert(this.token.transferFrom(owner, to, amount, { from: spender })); + }); + }); + }); + + describe('decrease approval', function () { + describe('when the spender is not the zero address', function () { + const spender = recipient; + + describe('when the sender has enough balance', function () { + const amount = 100; + + it('emits an approval event', async function () { + const { logs } = await this.token.decreaseApproval(spender, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Approval'); + assert.equal(logs[0].args.owner, owner); + assert.equal(logs[0].args.spender, spender); + assert(logs[0].args.value.eq(0)); + }); + + describe('when there was no approved amount before', function () { + it('keeps the allowance to zero', async function () { + await this.token.decreaseApproval(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, 0); + }); + }); + + describe('when the spender had an approved amount', function () { + const approvedAmount = amount; + + beforeEach(async function () { + await this.token.approve(spender, approvedAmount, { from: owner }); + }); + + it('decreases the spender allowance subtracting the requested amount', async function () { + await this.token.decreaseApproval(spender, approvedAmount - 5, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, 5); + }); + + it('sets the allowance to zero when all allowance is removed', async function () { + await this.token.decreaseApproval(spender, approvedAmount, { from: owner }); + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, 0); + }); + + it('sets the allowance to zero when more than the full allowance is removed', async function () { + await this.token.decreaseApproval(spender, approvedAmount + 5, { from: owner }); + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, 0); + }); + }); + }); + + describe('when the sender does not have enough balance', function () { + const amount = 101; + + it('emits an approval event', async function () { + const { logs } = await this.token.decreaseApproval(spender, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Approval'); + assert.equal(logs[0].args.owner, owner); + assert.equal(logs[0].args.spender, spender); + assert(logs[0].args.value.eq(0)); + }); + + describe('when there was no approved amount before', function () { + it('keeps the allowance to zero', async function () { + await this.token.decreaseApproval(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, 0); + }); + }); + + describe('when the spender had an approved amount', function () { + beforeEach(async function () { + await this.token.approve(spender, amount + 1, { from: owner }); + }); + + it('decreases the spender allowance subtracting the requested amount', async function () { + await this.token.decreaseApproval(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, 1); + }); + }); + }); + }); + + describe('when the spender is the zero address', function () { + const amount = 100; + const spender = ZERO_ADDRESS; + + it('decreases the requested amount', async function () { + await this.token.decreaseApproval(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, 0); + }); + + it('emits an approval event', async function () { + const { logs } = await this.token.decreaseApproval(spender, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Approval'); + assert.equal(logs[0].args.owner, owner); + assert.equal(logs[0].args.spender, spender); + assert(logs[0].args.value.eq(0)); + }); + }); + }); + + describe('increase approval', function () { + const amount = 100; + + describe('when the spender is not the zero address', function () { + const spender = recipient; + + describe('when the sender has enough balance', function () { + it('emits an approval event', async function () { + const { logs } = await this.token.increaseApproval(spender, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Approval'); + assert.equal(logs[0].args.owner, owner); + assert.equal(logs[0].args.spender, spender); + assert(logs[0].args.value.eq(amount)); + }); + + describe('when there was no approved amount before', function () { + it('approves the requested amount', async function () { + await this.token.increaseApproval(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount); + }); + }); + + describe('when the spender had an approved amount', function () { + beforeEach(async function () { + await this.token.approve(spender, 1, { from: owner }); + }); + + it('increases the spender allowance adding the requested amount', async function () { + await this.token.increaseApproval(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount + 1); + }); + }); + }); + + describe('when the sender does not have enough balance', function () { + const amount = 101; + + it('emits an approval event', async function () { + const { logs } = await this.token.increaseApproval(spender, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Approval'); + assert.equal(logs[0].args.owner, owner); + assert.equal(logs[0].args.spender, spender); + assert(logs[0].args.value.eq(amount)); + }); + + describe('when there was no approved amount before', function () { + it('approves the requested amount', async function () { + await this.token.increaseApproval(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount); + }); + }); + + describe('when the spender had an approved amount', function () { + beforeEach(async function () { + await this.token.approve(spender, 1, { from: owner }); + }); + + it('increases the spender allowance adding the requested amount', async function () { + await this.token.increaseApproval(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount + 1); + }); + }); + }); + }); + + describe('when the spender is the zero address', function () { + const spender = ZERO_ADDRESS; + + it('approves the requested amount', async function () { + await this.token.increaseApproval(spender, amount, { from: owner }); + + const allowance = await this.token.allowance(owner, spender); + assert.equal(allowance, amount); + }); + + it('emits an approval event', async function () { + const { logs } = await this.token.increaseApproval(spender, amount, { from: owner }); + + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'Approval'); + assert.equal(logs[0].args.owner, owner); + assert.equal(logs[0].args.spender, spender); + assert(logs[0].args.value.eq(amount)); + }); + }); + }); +}; + +module.exports = { shouldBehaveLikeStandardToken }; diff --git a/ethereum/test/token/ownership.js b/ethereum/test/token/ownership.js new file mode 100644 index 0000000..f93bb28 --- /dev/null +++ b/ethereum/test/token/ownership.js @@ -0,0 +1,47 @@ +const { shouldBehaveLikeOwnable } = require("./Ownable.behaviour.js") +const { shouldBehaveLikeClaimable } = require("./Claimable.behaviour.js") +const { shouldBehaveLikeCanReclaimToken } = require("./CanReclaimToken.behaviour.js") +const { shouldBehaveLikeHasNoEther } = require("./HasNoEther.behaviour.js") + +const Token = artifacts.require("./token/WBTC.sol"); +const BasicTokenMock = artifacts.require('BasicTokenMock'); + +contract('Ownable', function (accounts) { + beforeEach(async function () { + this.ownable = await Token.new(); + }); + + shouldBehaveLikeOwnable(accounts); +}); + + +contract('Claimable', function (accounts) { + beforeEach(async function () { + claimable = await Token.new(); + }); + + shouldBehaveLikeClaimable(accounts); +}); + + +contract('CanReclaimToken', function (accounts) { + beforeEach(async function () { + const owner = accounts[0]; + + // Create contract and token + token = await BasicTokenMock.new(owner, 100); + canReclaimToken = await Token.new(); + + // Force token into contract + await token.transfer(canReclaimToken.address, 10); + const startBalance = await token.balanceOf(canReclaimToken.address); + assert.equal(startBalance, 10); + }); + + shouldBehaveLikeCanReclaimToken(accounts); +}); + + +contract('HasNoEther', function (accounts) { + shouldBehaveLikeHasNoEther(accounts); +}); \ No newline at end of file diff --git a/ethereum/test/token/token.js b/ethereum/test/token/token.js new file mode 100644 index 0000000..a2ff7d9 --- /dev/null +++ b/ethereum/test/token/token.js @@ -0,0 +1,78 @@ +const { shouldBehaveLikeBasicToken } = require("./BasicToken.behaviour.js") +const { shouldBehaveLikeDetailedERC20 } = require("./DetailedERC20.behaviour.js") +const { shouldBehaveLikeStandardToken } = require("./StandardToken.behaviour.js") +const { shouldBehaveLikeMintableToken } = require("./MintableToken.behaviour.js") +const { shouldBehaveLikePausableToken } = require("./PausableToken.behaviour.js") +const { shouldBehaveLikeBurnableToken } = require("./BurnableToken.behaviour.js") + +const Token = artifacts.require("./token/WBTC.sol"); + +contract('shouldBehaveLikeDetailedERC20', function (accounts) { + const initialBalance = 100; + const owner = accounts[0]; + + beforeEach(async function () { + this.detailedERC20 = await Token.new({ from: owner }); + }); + + shouldBehaveLikeDetailedERC20(accounts, "Wrapped BTC", "WBTC", 8); +}); + + +contract('BasicToken', function ([owner, recipient, anotherAccount]) { + const initialBalance = 100; + + beforeEach(async function () { + this.token = await Token.new({ from: owner }); + await this.token.mint(owner, initialBalance); + }); + + shouldBehaveLikeBasicToken([owner, recipient, anotherAccount]); +}); + + +contract('StandardToken', function ([owner, recipient, anotherAccount]) { + const initialBalance = 100; + + beforeEach(async function () { + this.token = await Token.new({ from: owner }); + await this.token.mint(owner, initialBalance); + }); + + shouldBehaveLikeStandardToken([owner, recipient, anotherAccount]); +}); + + +contract('PausableToken', function ([owner, recipient, anotherAccount]) { + const initialBalance = 100; + + beforeEach(async function () { + this.token = await Token.new({ from: owner }); + await this.token.mint(owner, initialBalance); + }); + + shouldBehaveLikePausableToken([owner, recipient, anotherAccount]); +}); + + +contract('MintableToken', function ([owner, anotherAccount]) { + const minter = owner; + + beforeEach(async function () { + this.token = await Token.new({ from: owner }); + }); + + shouldBehaveLikeMintableToken([owner, anotherAccount, minter]); +}); + + +contract('BurnableToken', function ([owner, anotherAccount]) { + const initialBalance = 1000; + + beforeEach(async function () { + this.token = await Token.new({ from: owner }); + await this.token.mint(owner, initialBalance); + }); + + shouldBehaveLikeBurnableToken([owner, anotherAccount], initialBalance); +}); \ No newline at end of file diff --git a/ethereum/test/utils/indexedMapping.js b/ethereum/test/utils/indexedMapping.js new file mode 100644 index 0000000..040c9c7 --- /dev/null +++ b/ethereum/test/utils/indexedMapping.js @@ -0,0 +1,316 @@ +const BigNumber = web3.BigNumber + +const { ZEPPELIN_LOCATION } = require("../helper.js"); +const { expectThrow } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/expectThrow'); + +require("chai") + .use(require("chai-as-promised")) + .use(require('chai-bignumber')(BigNumber)) + .should() + +const IndexedMappingWrapper = artifacts.require("./mock/IndexedMappingWrapper.sol"); + +contract('IndexedMappingWrapper', function(accounts) { + + beforeEach('setup contract for each test', async () => { + admin = accounts[0]; + user1 = accounts[1]; + user2 = accounts[2]; + user3 = accounts[3]; + user4 = accounts[4]; + indexedMappingWrapper = await IndexedMappingWrapper.new(); + }); + + it("add one address and check it exists.", async function () { + await indexedMappingWrapper.add(user1); + exists = await indexedMappingWrapper.exists(user1); + exists.should.equal(true); + }); + + it("add one address and check first value is it.", async function () { + await indexedMappingWrapper.add(user1); + v0 = await indexedMappingWrapper.getValue(0); + v0.should.equal(user1); + }); + + it("add one address and check value list.", async function () { + await indexedMappingWrapper.add(user1); + valueList = await indexedMappingWrapper.getValueList(); + valueList[0].should.equal(user1); + (valueList.length).should.equal(1); + }); + + it("one add and one remove, check address does not exist.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.remove(user1); + exists = await indexedMappingWrapper.exists(user1); + exists.should.equal(false); + }); + + it("one add and one remove, check reading index 0 reverts.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.remove(user1); + await expectThrow(indexedMappingWrapper.getValue(0)); + }); + + it("one add and one remove, check value list is empty.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.remove(user1); + + valueList = await indexedMappingWrapper.getValueList(); + (valueList.length).should.equal(0); + }); + + it("add multiple (3) addreses, check they all exist.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + exists1 = await indexedMappingWrapper.exists(user1); + exists2 = await indexedMappingWrapper.exists(user2); + exists3 = await indexedMappingWrapper.exists(user3); + + exists1.should.equal(true); + exists2.should.equal(true); + exists3.should.equal(true); + }); + + it("add multiple (3) addreses, check get value for each.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + v0 = await indexedMappingWrapper.getValue(0); + v1 = await indexedMappingWrapper.getValue(1); + v2 = await indexedMappingWrapper.getValue(2); + + v0.should.equal(user1); + v1.should.equal(user2); + v2.should.equal(user3); + }); + + it("add multiple (3) addreses, check value list.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + valueList = await indexedMappingWrapper.getValueList(); + + (valueList.length).should.equal(3); + valueList[0].should.equal(user1); + valueList[1].should.equal(user2); + valueList[2].should.equal(user3); + }); + + it("multiple (3) adds and remove all, check addresses do not exist.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + await indexedMappingWrapper.remove(user1); + await indexedMappingWrapper.remove(user2); + await indexedMappingWrapper.remove(user3); + + exists1 = await indexedMappingWrapper.exists(user1); + exists2 = await indexedMappingWrapper.exists(user2); + exists3 = await indexedMappingWrapper.exists(user3); + + exists1.should.equal(false); + exists2.should.equal(false); + exists3.should.equal(false); + }); + + + it("multiple (3) adds and remove all, check reading index 0 reverts.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + await indexedMappingWrapper.remove(user1); + await indexedMappingWrapper.remove(user2); + await indexedMappingWrapper.remove(user3); + + await expectThrow(indexedMappingWrapper.getValue(0)); + }); + + it("multiple (3) adds and remove first, check remaining values.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + await indexedMappingWrapper.remove(user1); + + valueList = await indexedMappingWrapper.getValueList(); + (valueList.length).should.equal(2); + (valueList[0]).should.equal(user3); + (valueList[1]).should.equal(user2); + + exists1 = await indexedMappingWrapper.exists(user1); + exists1.should.equal(false); + exists2 = await indexedMappingWrapper.exists(user2); + exists2.should.equal(true); + exists3 = await indexedMappingWrapper.exists(user3); + exists3.should.equal(true); + + }); + + it("multiple (3) adds and remove second, check remaining values.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + await indexedMappingWrapper.remove(user2); + + valueList = await indexedMappingWrapper.getValueList(); + (valueList.length).should.equal(2); + (valueList[0]).should.equal(user1); + (valueList[1]).should.equal(user3); + + exists1 = await indexedMappingWrapper.exists(user1); + exists1.should.equal(true); + exists2 = await indexedMappingWrapper.exists(user2); + exists2.should.equal(false); + exists3 = await indexedMappingWrapper.exists(user3); + exists3.should.equal(true); + }); + + it("multiple (3) adds and remove last, check remaining values.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + await indexedMappingWrapper.remove(user3); + + valueList = await indexedMappingWrapper.getValueList(); + (valueList.length).should.equal(2); + (valueList[0]).should.equal(user1); + (valueList[1]).should.equal(user2); + + exists1 = await indexedMappingWrapper.exists(user1); + exists1.should.equal(true); + exists2 = await indexedMappingWrapper.exists(user2); + exists2.should.equal(true); + exists3 = await indexedMappingWrapper.exists(user3); + exists3.should.equal(false); + }); + + it("multiple (3) adds and remove all, check value list is empty.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + await indexedMappingWrapper.remove(user1); + await indexedMappingWrapper.remove(user2); + await indexedMappingWrapper.remove(user3); + + valueList = await indexedMappingWrapper.getValueList(); + (valueList.length).should.equal(0); + }); + + it("multiple (3) adds and remove some (2), check expected address exist.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + await indexedMappingWrapper.remove(user1); + await indexedMappingWrapper.remove(user3); + + exists1 = await indexedMappingWrapper.exists(user1); + exists2 = await indexedMappingWrapper.exists(user2); + exists3 = await indexedMappingWrapper.exists(user3); + + exists1.should.equal(false); + exists2.should.equal(true); + exists3.should.equal(false); + }); + + + it("multiple (3) adds and remove some (2), check index 0 and that access index 1 reverts.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + await indexedMappingWrapper.remove(user1); + await indexedMappingWrapper.remove(user3); + + v0 = await indexedMappingWrapper.getValue(0); + v0.should.equal(user2); + + await expectThrow(indexedMappingWrapper.getValue(1)); + }); + + it("multiple (3) adds and remove some (2), check value list.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + await indexedMappingWrapper.remove(user1); + await indexedMappingWrapper.remove(user3); + + valueList = await indexedMappingWrapper.getValueList(); + (valueList.length).should.equal(1); + (valueList[0]).should.equal(user2); + }); + + it("add, remove, add and check it exists.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.remove(user1); + await indexedMappingWrapper.add(user2); + + exists = await indexedMappingWrapper.exists(user2); + exists.should.equal(true); + }); + + it("add, remove, add and check first value is it.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.remove(user1); + await indexedMappingWrapper.add(user2); + + v0 = await indexedMappingWrapper.getValue(0); + v0.should.equal(user2); + }); + + it("add, remove, add and check value list.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.remove(user1); + await indexedMappingWrapper.add(user2); + + valueList = await indexedMappingWrapper.getValueList(); + valueList[0].should.equal(user2); + (valueList.length).should.equal(1); + }); + + it("add already existing value, see that getting false and value list is not malformed.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + await indexedMappingWrapper.add(user4); + + added = await indexedMappingWrapper.add.call(user3); + await indexedMappingWrapper.add(user3); + added.should.equal(false); + + valueList = await indexedMappingWrapper.getValueList(); + (valueList.length).should.equal(4); + valueList[0].should.equal(user1); + valueList[1].should.equal(user2); + valueList[2].should.equal(user3); + valueList[3].should.equal(user4); + }); + + it("remove non existing value, see that getting false and value list is not malformed.", async function () { + await indexedMappingWrapper.add(user1); + await indexedMappingWrapper.add(user2); + await indexedMappingWrapper.add(user3); + + removed = await indexedMappingWrapper.remove.call(user4); + await indexedMappingWrapper.remove(user4); + + removed.should.equal(false); + + valueList = await indexedMappingWrapper.getValueList(); + (valueList.length).should.equal(3); + valueList[0].should.equal(user1); + valueList[1].should.equal(user2); + valueList[2].should.equal(user3); + }); +}); diff --git a/ethereum/test/utils/ownableContractOwner.js b/ethereum/test/utils/ownableContractOwner.js new file mode 100644 index 0000000..461e73a --- /dev/null +++ b/ethereum/test/utils/ownableContractOwner.js @@ -0,0 +1,130 @@ +const BigNumber = web3.BigNumber + +const { ZEPPELIN_LOCATION , ZERO_ADDRESS} = require("../helper.js"); +const { expectThrow } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/expectThrow'); +const { ethSendTransaction, ethGetBalance } = require(ZEPPELIN_LOCATION + 'openzeppelin-solidity/test/helpers/web3'); + +require("chai") + .use(require("chai-as-promised")) + .use(require('chai-bignumber')(BigNumber)) + .should() + +const OwnableContract = artifacts.require("./utils/OwnableContract.sol"); +const OwnableContractOwner = artifacts.require("./utils/OwnableContractOwner.sol"); +const BasicTokenMock = artifacts.require('BasicTokenMock'); + +contract('OwnableContractOwner', function(accounts) { + + const admin = accounts[0]; + const newOwner = accounts[1]; + const nonOwner = accounts[2]; + + beforeEach('setup contracts for each test', async () => { + ownableContractOwner = await OwnableContractOwner.new(); + ownableContract = await OwnableContract.new(); + + await ownableContract.transferOwnership(ownableContractOwner.address) + await ownableContractOwner.callClaimOwnership(ownableContract.address) + + token = await BasicTokenMock.new(admin, 100); + }); + + describe('as owner of the ownable contract', function () { + const from = admin; + + it('verify calling transferOwnership directly on the owned contract fails', async function () { + await expectThrow(ownableContract.transferOwnership(newOwner)); + }); + + it('should check callTransferOwnership transfers ownership', async function () { + const pendingOwnerBefore = await ownableContract.pendingOwner.call(); + pendingOwnerBefore.should.equal(ZERO_ADDRESS) + + await ownableContractOwner.callTransferOwnership(ownableContract.address, newOwner, { from }) + const pendingOwnerAfter = await ownableContract.pendingOwner.call(); + pendingOwnerAfter.should.equal(newOwner) + }); + + it('should check callTransferOwnership to 0 address fails', async function () { + await expectThrow(ownableContractOwner.callTransferOwnership(ownableContract.address, 0, { from }), "invalid newOwner address"); + }); + + it('should check callTransferOwnership emits an event', async function () { + const { logs } = await ownableContractOwner.callTransferOwnership(ownableContract.address, newOwner, { from }); + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'CalledTransferOwnership'); + assert.equal(logs[0].args.ownedContract, ownableContract.address); + assert.equal(logs[0].args.newOwner, newOwner); + }); + + it('should check callClaimOwnership claims ownership', async function () { + otherOwnableContractOwner = await OwnableContractOwner.new(); + + await ownableContractOwner.callTransferOwnership(ownableContract.address, otherOwnableContractOwner.address, { from }) + const pendingOwnerBefore = await ownableContract.pendingOwner.call(); + pendingOwnerBefore.should.equal(otherOwnableContractOwner.address) + + await otherOwnableContractOwner.callClaimOwnership(ownableContract.address, { from }); + const pendingOwnerAfter = await ownableContract.pendingOwner.call(); + pendingOwnerAfter.should.equal(ZERO_ADDRESS); + const ownerAfter = await ownableContract.owner.call(); + ownerAfter.should.equal(otherOwnableContractOwner.address); + }); + + it('should check callClaimOwnership emits an event', async function () { + otherOwnableContractOwner = await OwnableContractOwner.new(); + await ownableContractOwner.callTransferOwnership(ownableContract.address, otherOwnableContractOwner.address, { from }) + const { logs } = await otherOwnableContractOwner.callClaimOwnership(ownableContract.address, { from }); + + assert.equal(logs.length, 2); + assert.equal(logs[0].event, 'OwnershipTransferred'); + assert.equal(logs[0].args.previousOwner, ownableContractOwner.address); + assert.equal(logs[0].args.newOwner, otherOwnableContractOwner.address); + assert.equal(logs[1].event, 'CalledClaimOwnership'); + assert.equal(logs[1].args.contractToOwn, ownableContract.address); + }); + + it('should check callReclaimToken reclaims token', async function () { + const amount = 50; + await token.transfer(ownableContract.address, amount); + const balance = await token.balanceOf(ownableContractOwner.address); + assert.equal(balance, 0); + + await ownableContractOwner.callReclaimToken(ownableContract.address, token.address); + const newBalance = await token.balanceOf(ownableContractOwner.address); + assert.equal(newBalance, amount); + }); + + it('should check callReclaimToken with 0 token address fails', async function () { + await expectThrow(ownableContractOwner.callReclaimToken(ownableContract.address, 0), "invalid _token address"); + }); + + it('should check callReclaimToken emits an event', async function () { + const amount = 50; + await token.transfer(ownableContract.address, amount); + const { logs } = await ownableContractOwner.callReclaimToken(ownableContract.address, token.address); + assert.equal(logs.length, 1); + assert.equal(logs[0].event, 'CalledReclaimToken'); + assert.equal(logs[0].args.ownedContract, ownableContract.address); + assert.equal(logs[0].args._token, token.address); + }); + }); + + describe('not as owner of the ownable contract', function () { + const from = nonOwner; + it('should check callTransferOwnership transfers reverts', async function () { + await expectThrow(ownableContractOwner.callTransferOwnership(ownableContract.address, newOwner, { from })); + }); + + it('should check callClaimOwnership claims reverts', async function () { + await expectThrow(ownableContractOwner.callTransferOwnership(ownableContract.address, otherOwnableContractOwner.address, { from })); + }); + + it('should check callReclaimToken reverts', async function () { + const amount = 50; + await token.transfer(ownableContract.address, amount); + await expectThrow(ownableContractOwner.callReclaimToken(ownableContract.address, token.address, {from} )); + }); + }); +}); + diff --git a/ethereum/truffle.js b/ethereum/truffle.js new file mode 100644 index 0000000..fcf6547 --- /dev/null +++ b/ethereum/truffle.js @@ -0,0 +1,24 @@ +module.exports = { + solc: { + optimizer: { + enabled: true, + runs: 200 + } + }, + networks: { + development: { + host: "localhost", + port: 8545, + gas: 6000000, + gasPrice: 40000000000, + network_id: "*" // Match any network id + }, + coverage: { + host: "localhost", + network_id: "*", + port: 8555, // <-- If you change this, also set the port option in .solcover.js. + gas: 0xfffffffffff, // <-- Use this high gas value + gasPrice: 0x01 // <-- Use this low gas price + }, + }, +}; From e700e70e74f75b40798566ecde702c412c89ee4e Mon Sep 17 00:00:00 2001 From: Andrew Drury Date: Tue, 18 May 2021 13:15:21 -0700 Subject: [PATCH 2/3] Updating readme to specify this is the original eth code, not deployed --- README.md | 3 +++ ethereum/README.md | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 587ebbd..a5da7b2 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,6 @@ This repository has the contracts that implement the wrapped tokens. # Tron network [tron/README.md](tron/README.md) + +# Original Ethereum network +[ethereum/README.md](ethereum/README.md) \ No newline at end of file diff --git a/ethereum/README.md b/ethereum/README.md index a70dfbd..bb3a7bf 100644 --- a/ethereum/README.md +++ b/ethereum/README.md @@ -1,4 +1,6 @@ -This repository has the contracts that implement the wrapped btc token. +This repository has the orginal contracts that implement the wrapped btc token. +The contracts in this repo are NOT deployed. You can find the deployed contracts +for the wrapped btc token on the Ethereum network in [ethereumV2/README.md](ethereumV2/README.md). # Installation From a883a2c1865a82839752214741be71634792b46d Mon Sep 17 00:00:00 2001 From: Andrew Drury Date: Tue, 18 May 2021 13:25:51 -0700 Subject: [PATCH 3/3] Updating broken readme link --- ethereum/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/README.md b/ethereum/README.md index bb3a7bf..6c342b0 100644 --- a/ethereum/README.md +++ b/ethereum/README.md @@ -1,6 +1,6 @@ This repository has the orginal contracts that implement the wrapped btc token. The contracts in this repo are NOT deployed. You can find the deployed contracts -for the wrapped btc token on the Ethereum network in [ethereumV2/README.md](ethereumV2/README.md). +for the wrapped btc token on the Ethereum network in [ethereumV2/README.md](../ethereumV2/README.md). # Installation